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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/browser_ui_prefs.h"
7 #include "base/prefs/pref_registry_simple.h"
8 #include "base/prefs/pref_service.h"
9 #include "base/prefs/scoped_user_pref_update.h"
10 #include "chrome/browser/first_run/first_run.h"
11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/common/pref_names.h"
13 #include "components/pref_registry/pref_registry_syncable.h"
14 #include "components/translate/core/common/translate_pref_names.h"
18 void RegisterBrowserPrefs(PrefRegistrySimple
* registry
) {
19 registry
->RegisterIntegerPref(prefs::kOptionsWindowLastTabIndex
, 0);
20 registry
->RegisterBooleanPref(prefs::kAllowFileSelectionDialogs
, true);
21 registry
->RegisterIntegerPref(prefs::kShowFirstRunBubbleOption
,
22 first_run::FIRST_RUN_BUBBLE_DONT_SHOW
);
25 void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable
* registry
) {
26 registry
->RegisterBooleanPref(
27 prefs::kHomePageIsNewTabPage
,
29 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
30 registry
->RegisterBooleanPref(
31 prefs::kShowHomeButton
,
33 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
34 #if defined(OS_MACOSX)
35 // This really belongs in platform code, but there's no good place to
36 // initialize it between the time when the AppController is created
37 // (where there's no profile) and the time the controller gets another
38 // crack at the start of the main event loop. By that time,
39 // StartupBrowserCreator has already created the browser window, and it's too
40 // late: we need the pref to be already initialized. Doing it here also saves
41 // us from having to hard-code pref registration in the several unit tests
42 // that use this preference.
43 registry
->RegisterBooleanPref(
44 prefs::kShowUpdatePromotionInfoBar
,
46 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
48 registry
->RegisterBooleanPref(
49 prefs::kDeleteBrowsingHistory
,
51 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
52 registry
->RegisterBooleanPref(
53 prefs::kDeleteDownloadHistory
,
55 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
56 registry
->RegisterBooleanPref(
59 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
60 registry
->RegisterBooleanPref(
61 prefs::kDeleteCookies
,
63 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
64 registry
->RegisterBooleanPref(
65 prefs::kDeletePasswords
,
67 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
68 registry
->RegisterBooleanPref(
69 prefs::kDeleteFormData
,
71 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
72 registry
->RegisterBooleanPref(
73 prefs::kDeleteHostedAppsData
,
75 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
76 registry
->RegisterIntegerPref(
77 prefs::kDeleteTimePeriod
,
79 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
80 registry
->RegisterInt64Pref(
81 prefs::kLastClearBrowsingDataTime
,
83 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
84 registry
->RegisterIntegerPref(prefs::kModuleConflictBubbleShown
,
86 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
87 registry
->RegisterBooleanPref(
88 prefs::kCheckDefaultBrowser
,
90 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
91 registry
->RegisterBooleanPref(
92 prefs::kWebAppCreateOnDesktop
,
94 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
95 registry
->RegisterBooleanPref(
96 prefs::kWebAppCreateInAppsMenu
,
98 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
99 registry
->RegisterBooleanPref(
100 prefs::kWebAppCreateInQuickLaunchBar
,
102 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
103 registry
->RegisterBooleanPref(
104 prefs::kEnableTranslate
,
106 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
107 registry
->RegisterStringPref(
108 prefs::kCloudPrintEmail
,
110 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
111 registry
->RegisterBooleanPref(
112 prefs::kCloudPrintProxyEnabled
,
114 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
115 registry
->RegisterBooleanPref(
116 prefs::kCloudPrintSubmitEnabled
,
118 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
119 registry
->RegisterBooleanPref(
120 prefs::kDevToolsDisabled
,
122 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
123 registry
->RegisterDictionaryPref(
124 prefs::kBrowserWindowPlacement
,
125 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
126 registry
->RegisterDictionaryPref(
127 prefs::kBrowserWindowPlacementPopup
,
128 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
129 registry
->RegisterDictionaryPref(
130 prefs::kAppWindowPlacement
,
131 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
132 registry
->RegisterBooleanPref(
133 prefs::kImportAutofillFormData
,
135 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
136 registry
->RegisterBooleanPref(
137 prefs::kImportBookmarks
,
139 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
140 registry
->RegisterBooleanPref(
141 prefs::kImportHistory
,
143 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
144 registry
->RegisterBooleanPref(
145 prefs::kImportHomepage
,
147 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
148 registry
->RegisterBooleanPref(
149 prefs::kImportSavedPasswords
,
151 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
152 registry
->RegisterBooleanPref(
153 prefs::kImportSearchEngine
,
155 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
156 registry
->RegisterBooleanPref(
157 prefs::kEnableDoNotTrack
,
159 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
160 #if defined(ENABLE_WEBRTC)
161 registry
->RegisterBooleanPref(
162 prefs::kWebRTCMultipleRoutesEnabled
,
164 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
167 // Dictionaries to keep track of default tasks in the file browser.
168 registry
->RegisterDictionaryPref(
169 prefs::kDefaultTasksByMimeType
,
170 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
171 registry
->RegisterDictionaryPref(
172 prefs::kDefaultTasksBySuffix
,
173 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF
);
175 // We need to register the type of these preferences in order to query
176 // them even though they're only typically controlled via policy.
177 registry
->RegisterBooleanPref(
178 prefs::kPluginsAllowOutdated
,
180 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
181 registry
->RegisterBooleanPref(
182 prefs::kPluginsAlwaysAuthorize
,
184 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
185 registry
->RegisterBooleanPref(
186 prefs::kClearPluginLSODataEnabled
,
188 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
189 registry
->RegisterBooleanPref(
190 prefs::kHideWebStoreIcon
,
192 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
193 #if !defined(OS_MACOSX)
194 registry
->RegisterBooleanPref(
195 prefs::kFullscreenAllowed
,
197 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
201 } // namespace chrome