| 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 "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" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 14 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 | 18 |
| 18 enum StartupType { | 19 enum StartupType { |
| 19 COLD_START, | 20 COLD_START, |
| 20 WARM_START, | 21 WARM_START, |
| 21 WARM_START_FAST, | 22 WARM_START_FAST, |
| 22 }; | 23 }; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // Identifies whether we should show the app launcher promo or not. | 154 // Identifies whether we should show the app launcher promo or not. |
| 154 // Note that a field trial also controls the showing, so the promo won't show | 155 // Note that a field trial also controls the showing, so the promo won't show |
| 155 // unless the pref is set AND the field trial is set to a proper group. | 156 // unless the pref is set AND the field trial is set to a proper group. |
| 156 registry->RegisterBooleanPref(prefs::kShowAppLauncherPromo, true); | 157 registry->RegisterBooleanPref(prefs::kShowAppLauncherPromo, true); |
| 157 } | 158 } |
| 158 | 159 |
| 159 // static | 160 // static |
| 160 bool AppListService::HandleLaunchCommandLine( | 161 bool AppListService::HandleLaunchCommandLine( |
| 161 const base::CommandLine& command_line, | 162 const base::CommandLine& command_line, |
| 162 Profile* launch_profile) { | 163 Profile* launch_profile) { |
| 163 InitAll(launch_profile); | 164 InitAll(launch_profile, launch_profile->GetPath()); |
| 164 if (!command_line.HasSwitch(switches::kShowAppList)) | 165 if (!command_line.HasSwitch(switches::kShowAppList)) |
| 165 return false; | 166 return false; |
| 166 | 167 |
| 167 // The --show-app-list switch is used for shortcuts on the native desktop. | 168 // The --show-app-list switch is used for shortcuts on the native desktop. |
| 168 AppListService* service = Get(chrome::HOST_DESKTOP_TYPE_NATIVE); | 169 AppListService* service = Get(chrome::HOST_DESKTOP_TYPE_NATIVE); |
| 169 DCHECK(service); | 170 DCHECK(service); |
| 170 RecordStartupInfo(service, command_line, launch_profile); | 171 RecordStartupInfo(service, command_line, launch_profile); |
| 171 service->ShowForProfile(launch_profile); | 172 service->ShowForProfile(launch_profile); |
| 172 return true; | 173 return true; |
| 173 } | 174 } |
| OLD | NEW |