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

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

Issue 1016503006: Don't warmup the app list if it hasn't been used in the past 28 days. [Win] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_da_check_save
Patch Set: fix_unittests Created 5 years, 8 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 | « no previous file | chrome/browser/ui/app_list/app_list_service_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.h" 5 #include "chrome/browser/ui/app_list/app_list_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/process/process_info.h" 10 #include "base/process/process_info.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 void AppListService::RegisterPrefs(PrefRegistrySimple* registry) { 138 void AppListService::RegisterPrefs(PrefRegistrySimple* registry) {
139 registry->RegisterInt64Pref(prefs::kLastAppListLaunchPing, 0); 139 registry->RegisterInt64Pref(prefs::kLastAppListLaunchPing, 0);
140 registry->RegisterIntegerPref(prefs::kAppListLaunchCount, 0); 140 registry->RegisterIntegerPref(prefs::kAppListLaunchCount, 0);
141 registry->RegisterInt64Pref(prefs::kLastAppListAppLaunchPing, 0); 141 registry->RegisterInt64Pref(prefs::kLastAppListAppLaunchPing, 0);
142 registry->RegisterIntegerPref(prefs::kAppListAppLaunchCount, 0); 142 registry->RegisterIntegerPref(prefs::kAppListAppLaunchCount, 0);
143 registry->RegisterStringPref(prefs::kAppListProfile, std::string()); 143 registry->RegisterStringPref(prefs::kAppListProfile, std::string());
144 registry->RegisterBooleanPref(prefs::kAppLauncherHasBeenEnabled, false); 144 registry->RegisterBooleanPref(prefs::kAppLauncherHasBeenEnabled, false);
145 registry->RegisterIntegerPref(prefs::kAppListEnableMethod, 145 registry->RegisterIntegerPref(prefs::kAppListEnableMethod,
146 ENABLE_NOT_RECORDED); 146 ENABLE_NOT_RECORDED);
147 registry->RegisterInt64Pref(prefs::kAppListEnableTime, 0); 147 registry->RegisterInt64Pref(prefs::kAppListEnableTime, 0);
148 registry->RegisterInt64Pref(prefs::kAppListLastLaunchTime, 0);
148 149
149 #if defined(OS_MACOSX) 150 #if defined(OS_MACOSX)
150 registry->RegisterIntegerPref(prefs::kAppLauncherShortcutVersion, 0); 151 registry->RegisterIntegerPref(prefs::kAppLauncherShortcutVersion, 0);
151 #endif 152 #endif
152 153
153 // Identifies whether we should show the app launcher promo or not. This 154 // Identifies whether we should show the app launcher promo or not. This
154 // becomes false when the user dismisses the promo. 155 // becomes false when the user dismisses the promo.
155 registry->RegisterBooleanPref(prefs::kShowAppLauncherPromo, true); 156 registry->RegisterBooleanPref(prefs::kShowAppLauncherPromo, true);
156 } 157 }
157 158
158 // static 159 // static
159 bool AppListService::HandleLaunchCommandLine( 160 bool AppListService::HandleLaunchCommandLine(
160 const base::CommandLine& command_line, 161 const base::CommandLine& command_line,
161 Profile* launch_profile) { 162 Profile* launch_profile) {
162 InitAll(launch_profile, launch_profile->GetPath()); 163 InitAll(launch_profile, launch_profile->GetPath());
163 if (!command_line.HasSwitch(switches::kShowAppList)) 164 if (!command_line.HasSwitch(switches::kShowAppList))
164 return false; 165 return false;
165 166
166 // The --show-app-list switch is used for shortcuts on the native desktop. 167 // The --show-app-list switch is used for shortcuts on the native desktop.
167 AppListService* service = Get(chrome::HOST_DESKTOP_TYPE_NATIVE); 168 AppListService* service = Get(chrome::HOST_DESKTOP_TYPE_NATIVE);
168 DCHECK(service); 169 DCHECK(service);
169 RecordStartupInfo(service, command_line, launch_profile); 170 RecordStartupInfo(service, command_line, launch_profile);
170 service->ShowForProfile(launch_profile); 171 service->ShowForProfile(launch_profile);
171 return true; 172 return true;
172 } 173 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/app_list_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698