Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: ash/app_list/app_list_delegate_impl.cc

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Sync and rebase. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shelf/app_list_button.h" 8 #include "ash/shelf/app_list_button.h"
9 #include "ash/shelf/shelf_widget.h" 9 #include "ash/shelf/shelf_widget.h"
10 #include "ash/shelf/wm_shelf.h" 10 #include "ash/shelf/wm_shelf.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/shell_port.h" 12 #include "ash/shell_port.h"
13 #include "ash/wm_window.h"
13 #include "ui/app_list/presenter/app_list.h" 14 #include "ui/app_list/presenter/app_list.h"
14 15
15 namespace ash { 16 namespace ash {
16 17
17 AppListDelegateImpl::AppListDelegateImpl() { 18 AppListDelegateImpl::AppListDelegateImpl() {
18 Shell::Get()->app_list()->set_delegate(this); 19 Shell::Get()->app_list()->set_delegate(this);
19 } 20 }
20 21
21 AppListDelegateImpl::~AppListDelegateImpl() { 22 AppListDelegateImpl::~AppListDelegateImpl() {
22 Shell::Get()->app_list()->set_delegate(nullptr); 23 Shell::Get()->app_list()->set_delegate(nullptr);
23 } 24 }
24 25
25 void AppListDelegateImpl::OnAppListVisibilityChanged(bool visible, 26 void AppListDelegateImpl::OnAppListVisibilityChanged(bool visible,
26 int64_t display_id) { 27 int64_t display_id) {
27 WmWindow* root_window = 28 aura::Window* root_window =
28 ShellPort::Get()->GetRootWindowForDisplayId(display_id); 29 ShellPort::Get()->GetRootWindowForDisplayId(display_id)->aura_window();
James Cook 2017/05/17 23:41:49 optional: Do you think it makes sense to change Sh
msw 2017/05/18 20:28:00 Done.
29 AppListButton* app_list_button = 30 AppListButton* app_list_button =
30 WmShelf::ForWindow(root_window)->shelf_widget()->GetAppListButton(); 31 WmShelf::ForWindow(root_window)->shelf_widget()->GetAppListButton();
31 if (!app_list_button) 32 if (!app_list_button)
32 return; 33 return;
33 34
34 if (visible) 35 if (visible)
35 app_list_button->OnAppListShown(); 36 app_list_button->OnAppListShown();
36 else 37 else
37 app_list_button->OnAppListDismissed(); 38 app_list_button->OnAppListDismissed();
38 } 39 }
39 40
40 } // namespace ash 41 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698