Chromium Code Reviews| Index: ash/app_list/app_list_presenter_delegate.cc | 
| diff --git a/ash/app_list/app_list_presenter_delegate.cc b/ash/app_list/app_list_presenter_delegate.cc | 
| index 0bbb1c18acfe2b35a5501b6ce39a07356125bfe2..e5eac84cb5b2be0ebffcd431d4bbe0aee8015eda 100644 | 
| --- a/ash/app_list/app_list_presenter_delegate.cc | 
| +++ b/ash/app_list/app_list_presenter_delegate.cc | 
| @@ -14,6 +14,7 @@ | 
| #include "ash/shelf/shelf_layout_manager.h" | 
| #include "ash/shelf/shelf_widget.h" | 
| #include "ash/shell.h" | 
| +#include "ash/shell_observer.h" | 
| #include "ash/shell_port.h" | 
| #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 
| #include "base/command_line.h" | 
| @@ -119,26 +120,19 @@ void AppListPresenterDelegate::Init(app_list::AppListView* view, | 
| void AppListPresenterDelegate::OnShown(int64_t display_id) { | 
| is_visible_ = true; | 
| - // Update applist button status when app list visibility is changed. | 
| aura::Window* root_window = | 
| ShellPort::Get()->GetRootWindowForDisplayId(display_id); | 
| - AppListButton* app_list_button = | 
| - Shelf::ForWindow(root_window)->shelf_widget()->GetAppListButton(); | 
| - if (app_list_button) | 
| - app_list_button->OnAppListShown(); | 
| + Shell::Get()->NotifyAppListShownOrDismissed(is_visible_, root_window); | 
| 
 
xiyuan
2017/06/01 15:15:13
Not directly related to this CL. But along with sk
 
msw
2017/06/01 20:03:45
+1 for simplifying AppList visibility observation
 
newcomer
2017/06/05 22:01:44
OK! I just created a bug for xiyuan, msw, and sky'
 
 | 
| } | 
| void AppListPresenterDelegate::OnDismissed() { | 
| DCHECK(is_visible_); | 
| DCHECK(view_); | 
| - | 
| is_visible_ = false; | 
| - // Update applist button status when app list visibility is changed. | 
| - Shelf* shelf = Shelf::ForWindow(view_->GetWidget()->GetNativeWindow()); | 
| - AppListButton* app_list_button = shelf->shelf_widget()->GetAppListButton(); | 
| - if (app_list_button) | 
| - app_list_button->OnAppListDismissed(); | 
| + aura::Window* root_window = | 
| + RootWindowController::ForTargetRootWindow()->GetRootWindow(); | 
| + Shell::Get()->NotifyAppListShownOrDismissed(is_visible_, root_window); | 
| } | 
| void AppListPresenterDelegate::UpdateBounds() { |