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 |