diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-08 18:34:19 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-08 18:34:19 +0000 |
commit | 6825759582fd94ee046f8c2e1dada868e127c7e3 (patch) | |
tree | 8274906c1b23ff45a3bdaeab641e971b7d0f1c7f /ash | |
parent | dd688d5585357f7dcb5f9e268b4a86dc2ee4a4fb (diff) | |
download | chromium_src-6825759582fd94ee046f8c2e1dada868e127c7e3.zip chromium_src-6825759582fd94ee046f8c2e1dada868e127c7e3.tar.gz chromium_src-6825759582fd94ee046f8c2e1dada868e127c7e3.tar.bz2 |
Fixes bug where launcher background would remain painted when it
shouldn't. We need to invoke UpdateShelfVisibility after
BaseLayoutManager::ShowStateChanged since it ShowStateChanged() may
change the visiblity of the window, which effects what
UpdateShelfVisibility returns.
BUG=141391
TEST=covered by unit tests
R=skuhne@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10824219
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150592 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/launcher/background_animator.h | 1 | ||||
-rw-r--r-- | ash/launcher/launcher.h | 3 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_layout_manager.cc | 5 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_manager_unittest.cc | 13 |
4 files changed, 20 insertions, 2 deletions
diff --git a/ash/launcher/background_animator.h b/ash/launcher/background_animator.h index 8b27f65..cb4bdcd 100644 --- a/ash/launcher/background_animator.h +++ b/ash/launcher/background_animator.h @@ -41,6 +41,7 @@ class ASH_EXPORT BackgroundAnimator : public ui::AnimationDelegate { // is |CHANGE_IMMEDIATE| and an animation is not in progress this notifies // the delegate immediately (synchronously from this method). void SetPaintsBackground(bool value, ChangeType type); + bool paints_background() const { return paints_background_; } // Current alpha. int alpha() const { return alpha_; } diff --git a/ash/launcher/launcher.h b/ash/launcher/launcher.h index 3b5cbc6..eb35297 100644 --- a/ash/launcher/launcher.h +++ b/ash/launcher/launcher.h @@ -56,6 +56,9 @@ class ASH_EXPORT Launcher : public internal::BackgroundAnimatorDelegate { void SetPaintsBackground( bool value, internal::BackgroundAnimator::ChangeType change_type); + bool paints_background() const { + return background_animator_.paints_background(); + } // Sets the size of the status area. void SetStatusSize(const gfx::Size& size); diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc index d8e3f06..d75bae3 100644 --- a/ash/wm/workspace/workspace_layout_manager.cc +++ b/ash/wm/workspace/workspace_layout_manager.cc @@ -106,11 +106,12 @@ void WorkspaceLayoutManager::ShowStateChanged( !workspace_manager_->Contains(window)) { workspace_manager_->AddWindow(window); } - } else { - workspace_manager_->UpdateShelfVisibility(); } BaseLayoutManager::ShowStateChanged(window, last_show_state); workspace_manager_->ShowStateChanged(window); + // As BaseLayoutManager::ShowStateChanged() may change the visibility of the + // window we need to invoke UpdateShelfVisibility() after ShowStateChanged(). + workspace_manager_->UpdateShelfVisibility(); } } // namespace internal diff --git a/ash/wm/workspace/workspace_manager_unittest.cc b/ash/wm/workspace/workspace_manager_unittest.cc index c1f2e9f..7c858d7 100644 --- a/ash/wm/workspace/workspace_manager_unittest.cc +++ b/ash/wm/workspace/workspace_manager_unittest.cc @@ -695,5 +695,18 @@ TEST_F(WorkspaceManagerTest, MaximizeDontPersistEndsUpInOwnWorkspace) { EXPECT_FALSE(manager_->Contains(w1.get())); } +// Verifies going from maximized to minimized sets the right state for painting +// the background of the launcher. +TEST_F(WorkspaceManagerTest, MinimizeResetsVisibility) { + scoped_ptr<Window> w1(CreateTestWindow()); + w1->Show(); + wm::ActivateWindow(w1.get()); + w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MAXIMIZED); + w1->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_MINIMIZED); + EXPECT_EQ(ShelfLayoutManager::VISIBLE, + Shell::GetInstance()->shelf()->visibility_state()); + EXPECT_FALSE(Shell::GetInstance()->launcher()->paints_background()); +} + } // namespace internal } // namespace ash |