diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-26 23:21:41 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-26 23:21:41 +0000 |
commit | ec8ee1ff175f1b212d691cc225289d6d59b8017a (patch) | |
tree | c0b38a51949eae3e5cad347c17031a35915eb057 /ash | |
parent | 327f97ef60f125947b19d6ae8657b1c987b4a18f (diff) | |
download | chromium_src-ec8ee1ff175f1b212d691cc225289d6d59b8017a.zip chromium_src-ec8ee1ff175f1b212d691cc225289d6d59b8017a.tar.gz chromium_src-ec8ee1ff175f1b212d691cc225289d6d59b8017a.tar.bz2 |
ash: Fix applist not going away regression.
Replace OnWidgetActivationChanged handling with OnWindowFocused handling because
we need notification on active window change for any window rather than just for
applist window.
BUG=124874
TEST=Verify fix for issue 124874.
Review URL: http://codereview.chromium.org/10233014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134175 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/app_list/app_list.cc | 28 | ||||
-rw-r--r-- | ash/app_list/app_list.h | 3 |
2 files changed, 14 insertions, 17 deletions
diff --git a/ash/app_list/app_list.cc b/ash/app_list/app_list.cc index cd56f6c..4f939026 100644 --- a/ash/app_list/app_list.cc +++ b/ash/app_list/app_list.cc @@ -240,6 +240,19 @@ void AppList::OnRootWindowResized(const aura::RootWindow* root, view_->GetWidget()->SetBounds(gfx::Rect(root->bounds().size())); } +void AppList::OnWindowFocused(aura::Window* window) { + if (view_ && is_visible_) { + aura::Window* applist_container = Shell::GetInstance()->GetContainer( + internal::kShellWindowId_AppListContainer); + aura::Window* bubble_container = Shell::GetInstance()->GetContainer( + internal::kShellWindowId_SettingBubbleContainer); + if (window->parent() != applist_container && + window->parent() != bubble_container) { + SetVisible(false); + } + } +} + //////////////////////////////////////////////////////////////////////////////// // AppList, ui::ImplicitAnimationObserver implementation: @@ -260,20 +273,5 @@ void AppList::OnWidgetClosing(views::Widget* widget) { ResetView(); } -void AppList::OnWidgetActivationChanged(views::Widget* widget, bool active) { - DCHECK(view_->GetWidget() == widget); - if (view_ && is_visible_ && !active) { - aura::Window* applist_container = Shell::GetInstance()->GetContainer( - internal::kShellWindowId_AppListContainer); - aura::Window* bubble_container = Shell::GetInstance()->GetContainer( - internal::kShellWindowId_SettingBubbleContainer); - aura::Window* active_window = ash::wm::GetActiveWindow(); - if (active_window->parent() != applist_container && - active_window->parent() != bubble_container) { - SetVisible(false); - } - } -} - } // namespace internal } // namespace ash diff --git a/ash/app_list/app_list.h b/ash/app_list/app_list.h index 64c4509..5725c4d 100644 --- a/ash/app_list/app_list.h +++ b/ash/app_list/app_list.h @@ -83,14 +83,13 @@ class AppList : public aura::EventFilter, // aura::RootWindowObserver overrides: virtual void OnRootWindowResized(const aura::RootWindow* root, const gfx::Size& old_size) OVERRIDE; + virtual void OnWindowFocused(aura::Window* window) OVERRIDE; // ui::ImplicitAnimationObserver overrides: virtual void OnImplicitAnimationsCompleted() OVERRIDE; // views::Widget::Observer overrides: virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; - virtual void OnWidgetActivationChanged(views::Widget* widget, - bool active) OVERRIDE; // Whether we should show or hide app list widget. bool is_visible_; |