Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 #if defined(OS_MACOSX) | 153 #if defined(OS_MACOSX) |
| 154 registry->RegisterIntegerPref(prefs::kAppLauncherShortcutVersion, 0); | 154 registry->RegisterIntegerPref(prefs::kAppLauncherShortcutVersion, 0); |
| 155 #endif | 155 #endif |
| 156 | 156 |
| 157 // Identifies whether we should show the app launcher promo or not. This | 157 // Identifies whether we should show the app launcher promo or not. This |
| 158 // becomes false when the user dismisses the promo. | 158 // becomes false when the user dismisses the promo. |
| 159 registry->RegisterBooleanPref(prefs::kShowAppLauncherPromo, true); | 159 registry->RegisterBooleanPref(prefs::kShowAppLauncherPromo, true); |
| 160 } | 160 } |
| 161 | 161 |
| 162 // static | 162 // static |
| 163 bool AppListService::HandleLaunchCommandLine( | 163 bool AppListService::HandleLaunchCommandLine( |
|
tapted
2016/07/20 01:15:34
hm - I guess desktop linux will still call this. W
calamity
2016/07/25 02:34:22
Acknowledged.
| |
| 164 const base::CommandLine& command_line, | 164 const base::CommandLine& command_line, |
| 165 Profile* launch_profile) { | 165 Profile* launch_profile) { |
| 166 InitAll(launch_profile, launch_profile->GetPath()); | 166 InitAll(launch_profile, launch_profile->GetPath()); |
| 167 if (!command_line.HasSwitch(switches::kShowAppList)) | 167 if (!command_line.HasSwitch(switches::kShowAppList)) |
| 168 return false; | 168 return false; |
| 169 | 169 |
| 170 AppListService* service = Get(); | 170 AppListService* service = Get(); |
| 171 DCHECK(service); | 171 DCHECK(service); |
| 172 RecordStartupInfo(service, command_line, launch_profile); | 172 RecordStartupInfo(service, command_line, launch_profile); |
| 173 service->ShowForProfile(launch_profile); | 173 service->ShowForProfile(launch_profile); |
| 174 return true; | 174 return true; |
| 175 } | 175 } |
| OLD | NEW |