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

Unified Diff: ui/aura_shell/window_util.cc

Issue 8895003: Aura: Add --aura-laptop-mode to fill the workspace with a single window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: maximize ALL the windows Created 9 years 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
« ui/aura_shell/shell.cc ('K') | « ui/aura_shell/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/aura_shell/window_util.cc
diff --git a/ui/aura_shell/window_util.cc b/ui/aura_shell/window_util.cc
index 68fcab7ad55fac4bcc3766e34629c502f6074ecf..ec7f187405f0ccc4dc60eac4aa894f5cc8ac593a 100644
--- a/ui/aura_shell/window_util.cc
+++ b/ui/aura_shell/window_util.cc
@@ -6,13 +6,43 @@
#include "ui/aura/window.h"
#include "ui/aura/client/aura_constants.h"
+#include "ui/aura_shell/property_util.h"
#include "ui/base/ui_base_types.h"
+#include "ui/gfx/screen.h"
namespace aura_shell {
+namespace window_util {
bool IsWindowMaximized(aura::Window* window) {
return window->GetIntProperty(aura::kShowStateKey) ==
ui::SHOW_STATE_MAXIMIZED;
}
+void UpdateBoundsFromShowState(aura::Window* window) {
+ switch (window->GetIntProperty(aura::kShowStateKey)) {
+ case ui::SHOW_STATE_NORMAL: {
+ const gfx::Rect* restore = GetRestoreBounds(window);
+ window->SetProperty(aura::kRestoreBoundsKey, NULL);
+ if (restore)
+ window->SetBounds(*restore);
+ delete restore;
+ break;
+ }
+
+ case ui::SHOW_STATE_MAXIMIZED:
+ SetRestoreBoundsIfNotSet(window);
+ window->SetBounds(gfx::Screen::GetMonitorWorkAreaNearestWindow(window));
+ break;
+
+ case ui::SHOW_STATE_FULLSCREEN:
+ SetRestoreBoundsIfNotSet(window);
+ window->SetBounds(gfx::Screen::GetMonitorAreaNearestWindow(window));
+ break;
+
+ default:
+ break;
+ }
+}
+
+} // namespace window_util
} // namespace aura_shell
« ui/aura_shell/shell.cc ('K') | « ui/aura_shell/window_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698