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

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

Issue 2647833003: Adds AppListDelegate to AppList that is notified on visibility changes (Closed)
Patch Set: move Created 3 years, 11 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
« no previous file with comments | « ash/app_list/app_list_delegate_impl.h ('k') | ash/app_list/app_list_presenter_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/app_list/app_list_delegate_impl.h"
6
7 #include "ash/common/shelf/app_list_button.h"
8 #include "ash/common/shelf/shelf_widget.h"
9 #include "ash/common/shelf/wm_shelf.h"
10 #include "ash/common/wm_shell.h"
11 #include "ash/root_window_controller.h"
12 #include "ui/app_list/presenter/app_list.h"
13
14 namespace ash {
15
16 AppListDelegateImpl::AppListDelegateImpl() {
17 WmShell::Get()->app_list()->set_delegate(this);
18 }
19
20 AppListDelegateImpl::~AppListDelegateImpl() {
21 WmShell::Get()->app_list()->set_delegate(nullptr);
22 }
23
24 void AppListDelegateImpl::OnAppListVisibilityChanged(bool visible,
25 int64_t display_id) {
26 WmWindow* root_window = WmShell::Get()->GetRootWindowForDisplayId(display_id);
27 AppListButton* app_list_button =
28 WmShelf::ForWindow(root_window)->shelf_widget()->GetAppListButton();
29 if (!app_list_button)
30 return;
31
32 if (visible)
33 app_list_button->OnAppListShown();
34 else
35 app_list_button->OnAppListDismissed();
36 }
37
38 } // namespace ash
OLDNEW
« no previous file with comments | « ash/app_list/app_list_delegate_impl.h ('k') | ash/app_list/app_list_presenter_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698