| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_ui_prefs.h" | 5 #include "chrome/browser/ui/browser_ui_prefs.h" |
| 6 | 6 |
| 7 #include "chrome/browser/prefs/pref_service.h" | 7 #include "chrome/browser/prefs/pref_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 | 10 |
| 11 namespace chrome { | 11 namespace chrome { |
| 12 | 12 |
| 13 void RegisterBrowserPrefs(PrefService* prefs) { | 13 void RegisterBrowserPrefs(PrefService* prefs) { |
| 14 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0); | 14 prefs->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex, 0); |
| 15 prefs->RegisterBooleanPref(prefs::kAllowFileSelectionDialogs, true); | 15 prefs->RegisterBooleanPref(prefs::kAllowFileSelectionDialogs, true); |
| 16 prefs->RegisterBooleanPref(prefs::kShouldShowFirstRunBubble, false); | 16 prefs->RegisterBooleanPref(prefs::kShouldShowFirstRunBubble, false); |
| 17 } | 17 } |
| 18 | 18 |
| 19 void RegisterBrowserUserPrefs(PrefService* prefs) { | 19 void RegisterBrowserUserPrefs(PrefService* prefs) { |
| 20 prefs->RegisterBooleanPref(prefs::kHomePageChanged, | 20 prefs->RegisterBooleanPref(prefs::kHomePageChanged, |
| 21 false, | 21 false, |
| 22 PrefService::UNSYNCABLE_PREF); | 22 PrefService::UNSYNCABLE_PREF); |
| 23 prefs->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, | 23 prefs->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, |
| 24 true, | 24 true, |
| 25 PrefService::SYNCABLE_PREF); | 25 PrefService::SYNCABLE_PREF); |
| 26 prefs->RegisterBooleanPref(prefs::kShowHomeButton, | 26 prefs->RegisterBooleanPref(prefs::kShowHomeButton, |
| 27 false, | 27 false, |
| 28 PrefService::SYNCABLE_PREF); | 28 PrefService::SYNCABLE_PREF); |
| 29 prefs->RegisterIntegerPref(prefs::kExtensionsSideloadWipeoutBubbleShown, |
| 30 0, |
| 31 PrefService::SYNCABLE_PREF); |
| 29 #if defined(OS_MACOSX) | 32 #if defined(OS_MACOSX) |
| 30 // This really belongs in platform code, but there's no good place to | 33 // This really belongs in platform code, but there's no good place to |
| 31 // initialize it between the time when the AppController is created | 34 // initialize it between the time when the AppController is created |
| 32 // (where there's no profile) and the time the controller gets another | 35 // (where there's no profile) and the time the controller gets another |
| 33 // crack at the start of the main event loop. By that time, | 36 // crack at the start of the main event loop. By that time, |
| 34 // StartupBrowserCreator has already created the browser window, and it's too | 37 // StartupBrowserCreator has already created the browser window, and it's too |
| 35 // late: we need the pref to be already initialized. Doing it here also saves | 38 // late: we need the pref to be already initialized. Doing it here also saves |
| 36 // us from having to hard-code pref registration in the several unit tests | 39 // us from having to hard-code pref registration in the several unit tests |
| 37 // that use this preference. | 40 // that use this preference. |
| 38 prefs->RegisterBooleanPref(prefs::kShowUpdatePromotionInfoBar, | 41 prefs->RegisterBooleanPref(prefs::kShowUpdatePromotionInfoBar, |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 window_pref.append(app_name); | 158 window_pref.append(app_name); |
| 156 PrefService* prefs = profile->GetPrefs(); | 159 PrefService* prefs = profile->GetPrefs(); |
| 157 if (!prefs->FindPreference(window_pref.c_str())) { | 160 if (!prefs->FindPreference(window_pref.c_str())) { |
| 158 prefs->RegisterDictionaryPref(window_pref.c_str(), | 161 prefs->RegisterDictionaryPref(window_pref.c_str(), |
| 159 PrefService::UNSYNCABLE_PREF); | 162 PrefService::UNSYNCABLE_PREF); |
| 160 } | 163 } |
| 161 } | 164 } |
| 162 | 165 |
| 163 | 166 |
| 164 } // namespace chrome | 167 } // namespace chrome |
| OLD | NEW |