| 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" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |