Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1101)

Unified Diff: ui/wm/core/window_util.cc

Issue 2625113004: Unify window fullscreen and minimizing implementation (Closed)
Patch Set: Update Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ash/wm/window_util.cc ('K') | « ui/wm/core/window_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/window_util.cc
diff --git a/ui/wm/core/window_util.cc b/ui/wm/core/window_util.cc
index 39fa162969b966ccbbee172c43f5c6cde6b85117..da4a78b441d8a4a8cf2f741580f44b76431a0780 100644
--- a/ui/wm/core/window_util.cc
+++ b/ui/wm/core/window_util.cc
@@ -5,6 +5,7 @@
#include "ui/wm/core/window_util.h"
#include "base/memory/ptr_util.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_tree_owner.h"
@@ -84,6 +85,22 @@ bool CanActivateWindow(aura::Window* window) {
return client && client->CanActivateWindow(window);
}
+void SetWindowFullscreen(aura::Window* window, bool fullscreen) {
+ DCHECK(window);
+ bool is_fullscreen = window->GetProperty(aura::client::kShowStateKey) ==
+ ui::SHOW_STATE_FULLSCREEN;
+ if (fullscreen == is_fullscreen)
+ return;
+ if (fullscreen) {
+ window->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN);
+ } else {
+ auto state = window->GetProperty(aura::client::kPreFullscreenShowStateKey);
+ DCHECK_NE(state, ui::SHOW_STATE_MINIMIZED);
+ window->SetProperty(aura::client::kShowStateKey, state);
+ window->ClearProperty(aura::client::kPreFullscreenShowStateKey);
+ }
+}
+
aura::Window* GetActivatableWindow(aura::Window* window) {
aura::client::ActivationClient* client =
aura::client::GetActivationClient(window->GetRootWindow());
« ash/wm/window_util.cc ('K') | « ui/wm/core/window_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698