| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/app_list/app_list_delegate_impl.h" | 5 #include "ash/app_list/app_list_delegate_impl.h" |
| 6 | 6 |
| 7 #include "ash/common/shelf/app_list_button.h" | 7 #include "ash/common/shelf/app_list_button.h" |
| 8 #include "ash/common/shelf/shelf_widget.h" | 8 #include "ash/common/shelf/shelf_widget.h" |
| 9 #include "ash/common/shelf/wm_shelf.h" | 9 #include "ash/common/shelf/wm_shelf.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| 11 #include "ash/root_window_controller.h" | 11 #include "ash/root_window_controller.h" |
| 12 #include "ash/shell.h" |
| 12 #include "ui/app_list/presenter/app_list.h" | 13 #include "ui/app_list/presenter/app_list.h" |
| 13 | 14 |
| 14 namespace ash { | 15 namespace ash { |
| 15 | 16 |
| 16 AppListDelegateImpl::AppListDelegateImpl() { | 17 AppListDelegateImpl::AppListDelegateImpl() { |
| 17 WmShell::Get()->app_list()->set_delegate(this); | 18 Shell::Get()->app_list()->set_delegate(this); |
| 18 } | 19 } |
| 19 | 20 |
| 20 AppListDelegateImpl::~AppListDelegateImpl() { | 21 AppListDelegateImpl::~AppListDelegateImpl() { |
| 21 WmShell::Get()->app_list()->set_delegate(nullptr); | 22 Shell::Get()->app_list()->set_delegate(nullptr); |
| 22 } | 23 } |
| 23 | 24 |
| 24 void AppListDelegateImpl::OnAppListVisibilityChanged(bool visible, | 25 void AppListDelegateImpl::OnAppListVisibilityChanged(bool visible, |
| 25 int64_t display_id) { | 26 int64_t display_id) { |
| 26 WmWindow* root_window = WmShell::Get()->GetRootWindowForDisplayId(display_id); | 27 WmWindow* root_window = WmShell::Get()->GetRootWindowForDisplayId(display_id); |
| 27 AppListButton* app_list_button = | 28 AppListButton* app_list_button = |
| 28 WmShelf::ForWindow(root_window)->shelf_widget()->GetAppListButton(); | 29 WmShelf::ForWindow(root_window)->shelf_widget()->GetAppListButton(); |
| 29 if (!app_list_button) | 30 if (!app_list_button) |
| 30 return; | 31 return; |
| 31 | 32 |
| 32 if (visible) | 33 if (visible) |
| 33 app_list_button->OnAppListShown(); | 34 app_list_button->OnAppListShown(); |
| 34 else | 35 else |
| 35 app_list_button->OnAppListDismissed(); | 36 app_list_button->OnAppListDismissed(); |
| 36 } | 37 } |
| 37 | 38 |
| 38 } // namespace ash | 39 } // namespace ash |
| OLD | NEW |