File tree Expand file tree Collapse file tree 6 files changed +19
-11
lines changed Expand file tree Collapse file tree 6 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ namespace nw.currentWindowInternal {
23
23
24
24
interface Functions {
25
25
static void close(optional boolean force, optional long id);
26
- static void setShadow (boolean shadow);
26
+ static void setShadowInternal (boolean shadow, optional long id );
27
27
static void showDevToolsInternal(optional ShowDevToolsCallback callback);
28
28
static void showDevTools2Internal(long id, optional ShowDevToolsCallback callback);
29
29
static void closeDevTools();
Original file line number Diff line number Diff line change @@ -821,13 +821,21 @@ bool NwCurrentWindowInternalGetTitleInternalFunction::RunNWSync(base::ListValue*
821
821
}
822
822
823
823
ExtensionFunction::ResponseAction
824
- NwCurrentWindowInternalSetShadowFunction ::Run () {
824
+ NwCurrentWindowInternalSetShadowInternalFunction ::Run () {
825
825
#if defined(OS_MACOSX)
826
826
EXTENSION_FUNCTION_VALIDATE (args_);
827
827
bool shadow;
828
828
EXTENSION_FUNCTION_VALIDATE (args_->GetBoolean (0 , &shadow));
829
- AppWindow* window = getAppWindow (this );
830
- SetShadowOnWindow (window->GetNativeWindow ().GetNativeNSWindow (), shadow);
829
+ if (base::FeatureList::IsEnabled (::features::kNWNewWin )) {
830
+ int id = 0 ;
831
+ args_->GetInteger (1 , &id);
832
+ Browser* browser = getBrowser (this , id);
833
+ if (browser)
834
+ SetShadowOnWindow (browser->window ()->GetNativeWindow ().GetNativeNSWindow (), shadow);
835
+ } else {
836
+ AppWindow* window = getAppWindow (this );
837
+ SetShadowOnWindow (window->GetNativeWindow ().GetNativeNSWindow (), shadow);
838
+ }
831
839
#endif
832
840
return RespondNow (NoArguments ());
833
841
}
Original file line number Diff line number Diff line change @@ -136,19 +136,19 @@ class NwCurrentWindowInternalSetMenuFunction : public NWSyncExtensionFunction {
136
136
DISALLOW_COPY_AND_ASSIGN (NwCurrentWindowInternalSetMenuFunction);
137
137
};
138
138
139
- class NwCurrentWindowInternalSetShadowFunction : public ExtensionFunction {
139
+ class NwCurrentWindowInternalSetShadowInternalFunction : public ExtensionFunction {
140
140
public:
141
- NwCurrentWindowInternalSetShadowFunction (){}
141
+ NwCurrentWindowInternalSetShadowInternalFunction (){}
142
142
143
143
protected:
144
- ~NwCurrentWindowInternalSetShadowFunction () override {}
144
+ ~NwCurrentWindowInternalSetShadowInternalFunction () override {}
145
145
#if defined(OS_MACOSX)
146
146
void SetShadowOnWindow (NSWindow *window, bool shadow);
147
147
#endif
148
148
149
149
// ExtensionFunction:
150
150
ResponseAction Run () override ;
151
- DECLARE_EXTENSION_FUNCTION (" nw.currentWindowInternal.setShadow " , UNKNOWN)
151
+ DECLARE_EXTENSION_FUNCTION (" nw.currentWindowInternal.setShadowInternal " , UNKNOWN)
152
152
};
153
153
154
154
class NwCurrentWindowInternalSetBadgeLabelFunction : public ExtensionFunction {
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ - (void)drawRect:(NSRect)dirtyRect {
47
47
48
48
namespace extensions {
49
49
50
- void NwCurrentWindowInternalSetShadowFunction ::SetShadowOnWindow (NSWindow *window, bool shadow) {
50
+ void NwCurrentWindowInternalSetShadowInternalFunction ::SetShadowOnWindow (NSWindow *window, bool shadow) {
51
51
window.hasShadow = shadow;
52
52
}
53
53
Original file line number Diff line number Diff line change @@ -309,7 +309,7 @@ NWWindow.prototype.removeAllListeners = function (event) {
309
309
} ;
310
310
311
311
NWWindow . prototype . setShadow = function ( shadow ) {
312
- currentNWWindowInternal . setShadow ( shadow ) ;
312
+ currentNWWindowInternal . setShadowInternal ( shadow , this . cWindow . id ) ;
313
313
} ;
314
314
315
315
NWWindow . prototype . showDevTools = function ( frm , callback ) {
Original file line number Diff line number Diff line change @@ -344,7 +344,7 @@ apiBridge.registerCustomHook(function(bindingsAPI) {
344
344
} ;
345
345
346
346
NWWindow . prototype . setShadow = function ( shadow ) {
347
- currentNWWindowInternal . setShadow ( shadow ) ;
347
+ currentNWWindowInternal . setShadowInternal ( shadow ) ;
348
348
}
349
349
350
350
NWWindow . prototype . showDevTools = function ( frm , callback ) {
You can’t perform that action at this time.
0 commit comments