diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-21 02:32:31 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-21 02:32:31 +0000 |
commit | c7ca3d2e4439a33da51b34e308a7365230df47e8 (patch) | |
tree | c7139bbd544358e7a633538ef625acd0d83f2cfa | |
parent | 15951fe061d9cb608affb1996f41056e6cede0d5 (diff) | |
download | chromium_src-c7ca3d2e4439a33da51b34e308a7365230df47e8.zip chromium_src-c7ca3d2e4439a33da51b34e308a7365230df47e8.tar.gz chromium_src-c7ca3d2e4439a33da51b34e308a7365230df47e8.tar.bz2 |
ash: Fix app window controls on minimize/restore
We were unnecessarily tearing down and rebuilding the window frame for
apps when they are minimized. Since the (restored) bounds don't change
we no longer do a Layout() on the transition. We don't need to replace
the window frame in this case, so only do it when transitioning into
and out of maximized, which was the original intent of this code.
BUG=150981
TEST=manual, open file manager (Ctrl-M), click launcher icon to minimize, click launcher icon to restore, verify restore and close buttons are still visible
Review URL: https://chromiumcodereview.appspot.com/10966017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157902 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/views/frame/browser_frame_aura.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/ui/views/frame/browser_frame_aura.cc b/chrome/browser/ui/views/frame/browser_frame_aura.cc index 5eca7e7..1d3a7d8 100644 --- a/chrome/browser/ui/views/frame/browser_frame_aura.cc +++ b/chrome/browser/ui/views/frame/browser_frame_aura.cc @@ -48,9 +48,16 @@ class BrowserFrameAura::WindowPropertyWatcher : public aura::WindowObserver { if (key != aura::client::kShowStateKey) return; - // Allow the frame to be replaced when maximizing an app. + ui::WindowShowState old_state = static_cast<ui::WindowShowState>(old); + ui::WindowShowState new_state = + window->GetProperty(aura::client::kShowStateKey); + + // Allow the frame to be replaced when entering or exiting the maximized + // state. if (browser_frame_->non_client_view() && - browser_frame_aura_->browser_view()->browser()->is_app()) { + browser_frame_aura_->browser_view()->browser()->is_app() && + (old_state == ui::SHOW_STATE_MAXIMIZED || + new_state == ui::SHOW_STATE_MAXIMIZED)) { // Defer frame layout when replacing the frame. Layout will occur when the // window's bounds are updated. The window maximize/restore animations // clone the window's layers and rely on the subsequent layout to set |