| 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 "apps/prefs.h" | 5 #include "apps/prefs.h" |
| 6 | 6 |
| 7 #include "apps/app_launcher.h" | 7 #include "apps/app_launcher.h" |
| 8 #include "apps/pref_names.h" | 8 #include "apps/pref_names.h" |
| 9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
| 10 #include "components/user_prefs/pref_registry_syncable.h" | 10 #include "components/user_prefs/pref_registry_syncable.h" |
| 11 | 11 |
| 12 namespace apps { | 12 namespace apps { |
| 13 | 13 |
| 14 void RegisterPrefs(PrefRegistrySimple* registry) { | 14 void RegisterPrefs(PrefRegistrySimple* registry) { |
| 15 // This pref is a cache of the value from the registry the last time it was | 15 // This pref is a cache of the value from the registry the last time it was |
| 16 // checked. | 16 // checked. |
| 17 // | 17 // |
| 18 // During the pref initialization, if it is impossible to synchronously | 18 // During the pref initialization, if it is impossible to synchronously |
| 19 // determine whether the app launcher is enabled, assume it is disabled. | 19 // determine whether the app launcher is enabled, assume it is disabled. |
| 20 // Anything that needs to know the absolute truth should call | 20 // Anything that needs to know the absolute truth should call |
| 21 // GetIsAppLauncherEnabled(). | 21 // GetIsAppLauncherEnabled(). |
| 22 registry->RegisterBooleanPref(prefs::kAppLauncherIsEnabled, false); | 22 registry->RegisterBooleanPref(prefs::kAppLauncherIsEnabled, false); |
| 23 registry->RegisterBooleanPref(prefs::kAppLauncherHasBeenEnabled, false); |
| 23 | 24 |
| 24 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
| 25 registry->RegisterStringPref(prefs::kAppLaunchForMetroRestart, ""); | 26 registry->RegisterStringPref(prefs::kAppLaunchForMetroRestart, ""); |
| 26 registry->RegisterStringPref(prefs::kAppLaunchForMetroRestartProfile, ""); | 27 registry->RegisterStringPref(prefs::kAppLaunchForMetroRestartProfile, ""); |
| 27 registry->RegisterBooleanPref(prefs::kAppLauncherHasBeenEnabled, false); | |
| 28 #endif | 28 #endif |
| 29 | 29 |
| 30 // Identifies whether we should show the app launcher promo or not. | 30 // Identifies whether we should show the app launcher promo or not. |
| 31 // Now that a field trial also controls the showing, so the promo won't show | 31 // Now that a field trial also controls the showing, so the promo won't show |
| 32 // unless the pref is set AND the field trial is set to a proper group. | 32 // unless the pref is set AND the field trial is set to a proper group. |
| 33 registry->RegisterBooleanPref(prefs::kShowAppLauncherPromo, true); | 33 registry->RegisterBooleanPref(prefs::kShowAppLauncherPromo, true); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 36 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 37 // Indicates whether app shortcuts have been created. | 37 // Indicates whether app shortcuts have been created. |
| 38 registry->RegisterBooleanPref( | 38 registry->RegisterBooleanPref( |
| 39 prefs::kShortcutsHaveBeenCreated, false, | 39 prefs::kShortcutsHaveBeenCreated, false, |
| 40 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 40 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace apps | 43 } // namespace apps |
| OLD | NEW |