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

Side by Side Diff: chrome/browser/ui/app_list/app_list_service_views.cc

Issue 1137503005: Add launcherPage.hide() API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix mobile Created 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/ui/app_list/app_list_service_views.h" 5 #include "chrome/browser/ui/app_list/app_list_service_views.h"
6 6
7 #include "chrome/browser/apps/scoped_keep_alive.h" 7 #include "chrome/browser/apps/scoped_keep_alive.h"
8 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 8 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
9 #include "ui/app_list/app_list_switches.h" 9 #include "ui/app_list/app_list_switches.h"
10 #include "ui/app_list/views/app_list_main_view.h" 10 #include "ui/app_list/views/app_list_main_view.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 AppListServiceImpl::ShowForAppInstall(profile, extension_id, 43 AppListServiceImpl::ShowForAppInstall(profile, extension_id,
44 start_discovery_tracking); 44 start_discovery_tracking);
45 } 45 }
46 46
47 void AppListServiceViews::ShowForCustomLauncherPage(Profile* profile) { 47 void AppListServiceViews::ShowForCustomLauncherPage(Profile* profile) {
48 ShowForProfileInternal(profile, 48 ShowForProfileInternal(profile,
49 app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE); 49 app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE);
50 } 50 }
51 51
52 void AppListServiceViews::HideCustomLauncherPage() {
53 if (!shower_.IsAppListVisible())
54 return;
55
56 app_list::ContentsView* contents_view =
57 shower_.app_list()->app_list_main_view()->contents_view();
58
59 if (contents_view->IsStateActive(
60 app_list::AppListModel::STATE_CUSTOM_LAUNCHER_PAGE)) {
61 contents_view->SetActiveState(app_list::AppListModel::STATE_START, true);
62 }
63 }
64
52 void AppListServiceViews::DismissAppList() { 65 void AppListServiceViews::DismissAppList() {
53 if (!can_dismiss_) 66 if (!can_dismiss_)
54 return; 67 return;
55 68
56 shower_.DismissAppList(); 69 shower_.DismissAppList();
57 } 70 }
58 71
59 bool AppListServiceViews::IsAppListVisible() const { 72 bool AppListServiceViews::IsAppListVisible() const {
60 return shower_.IsAppListVisible(); 73 return shower_.IsAppListVisible();
61 } 74 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 if (state != app_list::AppListModel::INVALID_STATE) { 118 if (state != app_list::AppListModel::INVALID_STATE) {
106 app_list::ContentsView* contents_view = 119 app_list::ContentsView* contents_view =
107 shower_.app_list()->app_list_main_view()->contents_view(); 120 shower_.app_list()->app_list_main_view()->contents_view();
108 contents_view->SetActiveState(state, 121 contents_view->SetActiveState(state,
109 shower_.IsAppListVisible() /* animate */); 122 shower_.IsAppListVisible() /* animate */);
110 } 123 }
111 124
112 shower_.ShowForCurrentProfile(); 125 shower_.ShowForCurrentProfile();
113 RecordAppListLaunch(); 126 RecordAppListLaunch();
114 } 127 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_views.h ('k') | chrome/browser/ui/ash/app_list/app_list_service_ash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698