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

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: rebase, fix unit test build 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
« no previous file with comments | « 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 82e987547228d84ee426dfa192bac48bfe3084f6..133962d3d91157f02be8ef17ea6620ab5ed5bc7c 100644
--- a/ui/aura_shell/window_util.cc
+++ b/ui/aura_shell/window_util.cc
@@ -9,7 +9,9 @@
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
#include "ui/aura_shell/activation_controller.h"
+#include "ui/aura_shell/property_util.h"
#include "ui/base/ui_base_types.h"
+#include "ui/gfx/screen.h"
namespace aura_shell {
@@ -38,4 +40,30 @@ aura::Window* GetActivatableWindow(aura::Window* window) {
return internal::ActivationController::GetActivatableWindow(window);
}
+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 aura_shell
« no previous file with comments | « ui/aura_shell/window_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698