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

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

Issue 2143893002: Purge the App Launcher code from Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comment Created 4 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 unified diff | Download patch
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 27 matching lines...) Expand all
38 if (command_line.HasSwitch(switches::kOriginalProcessStartTime)) { 38 if (command_line.HasSwitch(switches::kOriginalProcessStartTime)) {
39 std::string start_time_string = 39 std::string start_time_string =
40 command_line.GetSwitchValueASCII(switches::kOriginalProcessStartTime); 40 command_line.GetSwitchValueASCII(switches::kOriginalProcessStartTime);
41 int64_t remote_start_time; 41 int64_t remote_start_time;
42 base::StringToInt64(start_time_string, &remote_start_time); 42 base::StringToInt64(start_time_string, &remote_start_time);
43 return base::Time::FromInternalValue(remote_start_time); 43 return base::Time::FromInternalValue(remote_start_time);
44 } 44 }
45 45
46 // base::CurrentProcessInfo::CreationTime() is only defined on some 46 // base::CurrentProcessInfo::CreationTime() is only defined on some
47 // platforms. 47 // platforms.
48 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) 48 #if defined(OS_LINUX)
49 return base::CurrentProcessInfo::CreationTime(); 49 return base::CurrentProcessInfo::CreationTime();
50 #else 50 #else
51 return base::Time(); 51 return base::Time();
52 #endif 52 #endif
53 } 53 }
54 54
55 StartupType GetStartupType(const base::CommandLine& command_line) { 55 StartupType GetStartupType(const base::CommandLine& command_line) {
56 // The presence of kOriginalProcessStartTime implies that another process 56 // The presence of kOriginalProcessStartTime implies that another process
57 // has sent us its command line to handle, ie: we are already running. 57 // has sent us its command line to handle, ie: we are already running.
58 if (command_line.HasSwitch(switches::kOriginalProcessStartTime)) { 58 if (command_line.HasSwitch(switches::kOriginalProcessStartTime)) {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 void AppListService::RegisterPrefs(PrefRegistrySimple* registry) { 141 void AppListService::RegisterPrefs(PrefRegistrySimple* registry) {
142 registry->RegisterInt64Pref(prefs::kLastAppListLaunchPing, 0); 142 registry->RegisterInt64Pref(prefs::kLastAppListLaunchPing, 0);
143 registry->RegisterIntegerPref(prefs::kAppListLaunchCount, 0); 143 registry->RegisterIntegerPref(prefs::kAppListLaunchCount, 0);
144 registry->RegisterInt64Pref(prefs::kLastAppListAppLaunchPing, 0); 144 registry->RegisterInt64Pref(prefs::kLastAppListAppLaunchPing, 0);
145 registry->RegisterIntegerPref(prefs::kAppListAppLaunchCount, 0); 145 registry->RegisterIntegerPref(prefs::kAppListAppLaunchCount, 0);
146 registry->RegisterStringPref(prefs::kAppListProfile, std::string()); 146 registry->RegisterStringPref(prefs::kAppListProfile, std::string());
147 registry->RegisterBooleanPref(prefs::kAppLauncherHasBeenEnabled, false); 147 registry->RegisterBooleanPref(prefs::kAppLauncherHasBeenEnabled, false);
148 registry->RegisterIntegerPref(prefs::kAppListEnableMethod, 148 registry->RegisterIntegerPref(prefs::kAppListEnableMethod,
149 ENABLE_NOT_RECORDED); 149 ENABLE_NOT_RECORDED);
150 registry->RegisterInt64Pref(prefs::kAppListEnableTime, 0); 150 registry->RegisterInt64Pref(prefs::kAppListEnableTime, 0);
151 registry->RegisterInt64Pref(prefs::kAppListLastLaunchTime, 0);
152 151
153 #if defined(OS_MACOSX) 152 #if defined(OS_MACOSX)
154 registry->RegisterIntegerPref(prefs::kAppLauncherShortcutVersion, 0); 153 registry->RegisterIntegerPref(prefs::kAppLauncherShortcutVersion, 0);
155 #endif 154 #endif
156 155
157 // Identifies whether we should show the app launcher promo or not. This 156 // Identifies whether we should show the app launcher promo or not. This
158 // becomes false when the user dismisses the promo. 157 // becomes false when the user dismisses the promo.
159 registry->RegisterBooleanPref(prefs::kShowAppLauncherPromo, true); 158 registry->RegisterBooleanPref(prefs::kShowAppLauncherPromo, true);
160 } 159 }
161 160
162 // static 161 // static
163 bool AppListService::HandleLaunchCommandLine( 162 bool AppListService::HandleLaunchCommandLine(
164 const base::CommandLine& command_line, 163 const base::CommandLine& command_line,
165 Profile* launch_profile) { 164 Profile* launch_profile) {
166 InitAll(launch_profile, launch_profile->GetPath()); 165 InitAll(launch_profile, launch_profile->GetPath());
167 if (!command_line.HasSwitch(switches::kShowAppList)) 166 if (!command_line.HasSwitch(switches::kShowAppList))
168 return false; 167 return false;
169 168
170 AppListService* service = Get(); 169 AppListService* service = Get();
171 DCHECK(service); 170 DCHECK(service);
172 RecordStartupInfo(service, command_line, launch_profile); 171 RecordStartupInfo(service, command_line, launch_profile);
173 service->ShowForProfile(launch_profile); 172 service->ShowForProfile(launch_profile);
174 return true; 173 return true;
175 } 174 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698