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

Unified Diff: chrome/browser/ui/app_list/app_list_service_mac.mm

Issue 22730003: Warm-up the App List when enabled from the webstore and not shown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/app_list_service_mac.mm
diff --git a/chrome/browser/ui/app_list/app_list_service_mac.mm b/chrome/browser/ui/app_list/app_list_service_mac.mm
index 56b9db4639e13a1d1b361286307aff7ea1c7a136..9fd8bf75b3c2b4ef2f0e7eda3d34de1e53778c00 100644
--- a/chrome/browser/ui/app_list/app_list_service_mac.mm
+++ b/chrome/browser/ui/app_list/app_list_service_mac.mm
@@ -59,11 +59,11 @@ class AppListServiceMac : public AppListServiceImpl,
LeakySingletonTraits<AppListServiceMac> >::get();
}
- void CreateAppList(Profile* profile);
void ShowWindowNearDock();
// AppListService overrides:
virtual void Init(Profile* initial_profile) OVERRIDE;
+ virtual void CreateForProfile(Profile* requested_profile) OVERRIDE;
virtual void ShowForProfile(Profile* requested_profile) OVERRIDE;
virtual void DismissAppList() OVERRIDE;
virtual bool IsAppListVisible() const OVERRIDE;
@@ -268,22 +268,6 @@ void AppListControllerDelegateCocoa::LaunchApp(
profile, extension, NEW_FOREGROUND_TAB));
}
-void AppListServiceMac::CreateAppList(Profile* requested_profile) {
- if (profile() == requested_profile)
- return;
-
- // The Objective C objects might be released at some unknown point in the
- // future, so explicitly clear references to C++ objects.
- [[window_controller_ appListViewController]
- setDelegate:scoped_ptr<app_list::AppListViewDelegate>()];
-
- SetProfile(requested_profile);
- scoped_ptr<app_list::AppListViewDelegate> delegate(
- new AppListViewDelegate(new AppListControllerDelegateCocoa(), profile()));
- window_controller_.reset([[AppListWindowController alloc] init]);
- [[window_controller_ appListViewController] setDelegate:delegate.Pass()];
-}
-
void AppListServiceMac::Init(Profile* initial_profile) {
// On Mac, Init() is called multiple times for a process: any time there is no
// browser window open and a new window is opened, and during process startup
@@ -311,6 +295,22 @@ void AppListServiceMac::Init(Profile* initial_profile) {
AppListServiceMac::GetInstance());
}
+void AppListServiceMac::CreateForProfile(Profile* requested_profile) {
+ if (profile() == requested_profile)
+ return;
+
+ // The Objective C objects might be released at some unknown point in the
+ // future, so explicitly clear references to C++ objects.
+ [[window_controller_ appListViewController]
+ setDelegate:scoped_ptr<app_list::AppListViewDelegate>()];
+
+ SetProfile(requested_profile);
+ scoped_ptr<app_list::AppListViewDelegate> delegate(
+ new AppListViewDelegate(new AppListControllerDelegateCocoa(), profile()));
+ window_controller_.reset([[AppListWindowController alloc] init]);
+ [[window_controller_ appListViewController] setDelegate:delegate.Pass()];
+}
+
void AppListServiceMac::ShowForProfile(Profile* requested_profile) {
InvalidatePendingProfileLoads();
@@ -322,7 +322,7 @@ void AppListServiceMac::ShowForProfile(Profile* requested_profile) {
SetProfilePath(requested_profile->GetPath());
DismissAppList();
- CreateAppList(requested_profile);
+ CreateForProfile(requested_profile);
ShowWindowNearDock();
}
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_disabled.cc ('k') | chrome/browser/ui/ash/app_list/app_list_service_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698