From 2858471151cdf8627595bf006355fa3fe89280da Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 10 Jan 2020 09:11:38 -0800 Subject: [PATCH] feat: remove visibleOnFullscreen option (#21706) --- docs/api/browser-window.md | 5 +---- shell/browser/api/atom_api_top_level_window.cc | 9 ++------- shell/browser/api/atom_api_top_level_window.h | 2 +- shell/browser/native_window.h | 3 +-- shell/browser/native_window_mac.h | 3 +-- shell/browser/native_window_mac.mm | 5 +---- shell/browser/native_window_views.cc | 3 +-- shell/browser/native_window_views.h | 3 +-- 8 files changed, 9 insertions(+), 24 deletions(-) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 9455d2cf176..e83833e55d9 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -1627,12 +1627,9 @@ can still bring up the menu bar by pressing the single `Alt` key. Returns `Boolean` - Whether the menu bar is visible. -#### `win.setVisibleOnAllWorkspaces(visible[, options])` +#### `win.setVisibleOnAllWorkspaces(visible)` * `visible` Boolean -* `options` Object (optional) - * `visibleOnFullScreen` Boolean (optional) _macOS_ - Sets whether - the window should be visible above fullscreen windows Sets whether the window should be visible on all workspaces. diff --git a/shell/browser/api/atom_api_top_level_window.cc b/shell/browser/api/atom_api_top_level_window.cc index 81b6680777c..b9bf8dfb5c3 100644 --- a/shell/browser/api/atom_api_top_level_window.cc +++ b/shell/browser/api/atom_api_top_level_window.cc @@ -790,13 +790,8 @@ void TopLevelWindow::SetOverlayIcon(const gfx::Image& overlay, window_->SetOverlayIcon(overlay, description); } -void TopLevelWindow::SetVisibleOnAllWorkspaces(bool visible, - gin_helper::Arguments* args) { - gin_helper::Dictionary options; - bool visibleOnFullScreen = false; - args->GetNext(&options) && - options.Get("visibleOnFullScreen", &visibleOnFullScreen); - return window_->SetVisibleOnAllWorkspaces(visible, visibleOnFullScreen); +void TopLevelWindow::SetVisibleOnAllWorkspaces(bool visible) { + return window_->SetVisibleOnAllWorkspaces(visible); } bool TopLevelWindow::IsVisibleOnAllWorkspaces() { diff --git a/shell/browser/api/atom_api_top_level_window.h b/shell/browser/api/atom_api_top_level_window.h index 5b86c88e61d..7e69e5ff5a6 100644 --- a/shell/browser/api/atom_api_top_level_window.h +++ b/shell/browser/api/atom_api_top_level_window.h @@ -181,7 +181,7 @@ class TopLevelWindow : public gin_helper::TrackableObject, void SetProgressBar(double progress, gin_helper::Arguments* args); void SetOverlayIcon(const gfx::Image& overlay, const std::string& description); - void SetVisibleOnAllWorkspaces(bool visible, gin_helper::Arguments* args); + void SetVisibleOnAllWorkspaces(bool visible); bool IsVisibleOnAllWorkspaces(); void SetAutoHideCursor(bool auto_hide); virtual void SetVibrancy(v8::Isolate* isolate, v8::Local value); diff --git a/shell/browser/native_window.h b/shell/browser/native_window.h index 36da3c2edab..ca61be67156 100644 --- a/shell/browser/native_window.h +++ b/shell/browser/native_window.h @@ -185,8 +185,7 @@ class NativeWindow : public base::SupportsUserData, const std::string& description) = 0; // Workspace APIs. - virtual void SetVisibleOnAllWorkspaces(bool visible, - bool visibleOnFullScreen = false) = 0; + virtual void SetVisibleOnAllWorkspaces(bool visible) = 0; virtual bool IsVisibleOnAllWorkspaces() = 0; diff --git a/shell/browser/native_window_mac.h b/shell/browser/native_window_mac.h index f8191ae5846..c4c4f09b591 100644 --- a/shell/browser/native_window_mac.h +++ b/shell/browser/native_window_mac.h @@ -117,8 +117,7 @@ class NativeWindowMac : public NativeWindow { void SetOverlayIcon(const gfx::Image& overlay, const std::string& description) override; - void SetVisibleOnAllWorkspaces(bool visible, - bool visibleOnFullScreen) override; + void SetVisibleOnAllWorkspaces(bool visible) override; bool IsVisibleOnAllWorkspaces() override; void SetAutoHideCursor(bool auto_hide) override; diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 84c9498a6af..cb018f44b5e 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -1271,11 +1271,8 @@ void NativeWindowMac::SetProgressBar(double progress, void NativeWindowMac::SetOverlayIcon(const gfx::Image& overlay, const std::string& description) {} -void NativeWindowMac::SetVisibleOnAllWorkspaces(bool visible, - bool visibleOnFullScreen) { +void NativeWindowMac::SetVisibleOnAllWorkspaces(bool visible) { SetCollectionBehavior(visible, NSWindowCollectionBehaviorCanJoinAllSpaces); - SetCollectionBehavior(visibleOnFullScreen, - NSWindowCollectionBehaviorFullScreenAuxiliary); } bool NativeWindowMac::IsVisibleOnAllWorkspaces() { diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index 06bdb2bce71..3a4edf1052e 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -1156,8 +1156,7 @@ bool NativeWindowViews::IsMenuBarVisible() { return root_view_->IsMenuBarVisible(); } -void NativeWindowViews::SetVisibleOnAllWorkspaces(bool visible, - bool visibleOnFullScreen) { +void NativeWindowViews::SetVisibleOnAllWorkspaces(bool visible) { widget()->SetVisibleOnAllWorkspaces(visible); } diff --git a/shell/browser/native_window_views.h b/shell/browser/native_window_views.h index 0f1ad3ef46b..ac0feafe80b 100644 --- a/shell/browser/native_window_views.h +++ b/shell/browser/native_window_views.h @@ -123,8 +123,7 @@ class NativeWindowViews : public NativeWindow, void SetMenuBarVisibility(bool visible) override; bool IsMenuBarVisible() override; - void SetVisibleOnAllWorkspaces(bool visible, - bool visibleOnFullScreen) override; + void SetVisibleOnAllWorkspaces(bool visible) override; bool IsVisibleOnAllWorkspaces() override;