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 "base/prefs/pref_registry_simple.h" | 7 #include "base/prefs/pref_registry_simple.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/first_run/first_run.h" | 9 #include "chrome/browser/first_run/first_run.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 PrefRegistrySyncable::SYNCABLE_PREF); | 60 PrefRegistrySyncable::SYNCABLE_PREF); |
61 registry->RegisterBooleanPref(prefs::kDeleteFormData, | 61 registry->RegisterBooleanPref(prefs::kDeleteFormData, |
62 false, | 62 false, |
63 PrefRegistrySyncable::SYNCABLE_PREF); | 63 PrefRegistrySyncable::SYNCABLE_PREF); |
64 registry->RegisterBooleanPref(prefs::kDeleteHostedAppsData, | 64 registry->RegisterBooleanPref(prefs::kDeleteHostedAppsData, |
65 false, | 65 false, |
66 PrefRegistrySyncable::SYNCABLE_PREF); | 66 PrefRegistrySyncable::SYNCABLE_PREF); |
67 registry->RegisterIntegerPref(prefs::kDeleteTimePeriod, | 67 registry->RegisterIntegerPref(prefs::kDeleteTimePeriod, |
68 0, | 68 0, |
69 PrefRegistrySyncable::SYNCABLE_PREF); | 69 PrefRegistrySyncable::SYNCABLE_PREF); |
| 70 |
70 registry->RegisterInt64Pref(prefs::kLastClearBrowsingDataTime, | 71 registry->RegisterInt64Pref(prefs::kLastClearBrowsingDataTime, |
71 0, | 72 0, |
72 PrefRegistrySyncable::UNSYNCABLE_PREF); | 73 PrefRegistrySyncable::UNSYNCABLE_PREF); |
73 registry->RegisterBooleanPref(prefs::kCheckDefaultBrowser, | 74 registry->RegisterBooleanPref(prefs::kCheckDefaultBrowser, |
74 true, | 75 true, |
75 PrefRegistrySyncable::UNSYNCABLE_PREF); | 76 PrefRegistrySyncable::UNSYNCABLE_PREF); |
76 #if defined(OS_WIN) | 77 #if defined(OS_WIN) |
77 // As with Mac-spacific code above, it should be in a platform-specific | 78 // As with Mac-spacific code above, it should be in a platform-specific |
78 // section somewhere, but there is no good place for it. | 79 // section somewhere, but there is no good place for it. |
79 registry->RegisterBooleanPref(prefs::kSuppressSwitchToMetroModeOnSetDefault, | 80 registry->RegisterBooleanPref(prefs::kSuppressSwitchToMetroModeOnSetDefault, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 PrefRegistrySyncable::SYNCABLE_PREF); | 144 PrefRegistrySyncable::SYNCABLE_PREF); |
144 | 145 |
145 // We need to register the type of these preferences in order to query | 146 // We need to register the type of these preferences in order to query |
146 // them even though they're only typically controlled via policy. | 147 // them even though they're only typically controlled via policy. |
147 registry->RegisterBooleanPref(prefs::kPluginsAllowOutdated, | 148 registry->RegisterBooleanPref(prefs::kPluginsAllowOutdated, |
148 false, | 149 false, |
149 PrefRegistrySyncable::UNSYNCABLE_PREF); | 150 PrefRegistrySyncable::UNSYNCABLE_PREF); |
150 registry->RegisterBooleanPref(prefs::kPluginsAlwaysAuthorize, | 151 registry->RegisterBooleanPref(prefs::kPluginsAlwaysAuthorize, |
151 false, | 152 false, |
152 PrefRegistrySyncable::UNSYNCABLE_PREF); | 153 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 154 registry->RegisterBooleanPref(prefs::kResetDefaultSearchEngine, |
| 155 true, |
| 156 PrefRegistrySyncable::SYNCABLE_PREF); |
| 157 registry->RegisterBooleanPref(prefs::kResetHomepage, |
| 158 true, |
| 159 PrefRegistrySyncable::SYNCABLE_PREF); |
| 160 registry->RegisterBooleanPref(prefs::kResetContentSettings, |
| 161 true, |
| 162 PrefRegistrySyncable::SYNCABLE_PREF); |
| 163 registry->RegisterBooleanPref(prefs::kResetCookiesAndSiteData, |
| 164 true, |
| 165 PrefRegistrySyncable::SYNCABLE_PREF); |
| 166 registry->RegisterBooleanPref(prefs::kResetExtensions, |
| 167 true, |
| 168 PrefRegistrySyncable::SYNCABLE_PREF); |
| 169 registry->RegisterIntegerPref(prefs::kResetExtensionsHandling, |
| 170 0, |
| 171 PrefRegistrySyncable::SYNCABLE_PREF); |
153 registry->RegisterBooleanPref(prefs::kClearPluginLSODataEnabled, | 172 registry->RegisterBooleanPref(prefs::kClearPluginLSODataEnabled, |
154 true, | 173 true, |
155 PrefRegistrySyncable::UNSYNCABLE_PREF); | 174 PrefRegistrySyncable::UNSYNCABLE_PREF); |
156 registry->RegisterBooleanPref(prefs::kHideWebStoreIcon, | 175 registry->RegisterBooleanPref(prefs::kHideWebStoreIcon, |
157 false, | 176 false, |
158 PrefRegistrySyncable::UNSYNCABLE_PREF); | 177 PrefRegistrySyncable::UNSYNCABLE_PREF); |
159 } | 178 } |
160 | 179 |
161 void RegisterAppPrefs(const std::string& app_name, Profile* profile) { | 180 void RegisterAppPrefs(const std::string& app_name, Profile* profile) { |
162 // We need to register the window position pref. | 181 // We need to register the window position pref. |
163 // | 182 // |
164 // TODO(mnissler): Use a separate pref name pointing to a single | 183 // TODO(mnissler): Use a separate pref name pointing to a single |
165 // dictionary instead. Also tracked as http://crbug.com/167256 | 184 // dictionary instead. Also tracked as http://crbug.com/167256 |
166 std::string window_pref(prefs::kBrowserWindowPlacement); | 185 std::string window_pref(prefs::kBrowserWindowPlacement); |
167 window_pref.append("_"); | 186 window_pref.append("_"); |
168 window_pref.append(app_name); | 187 window_pref.append(app_name); |
169 PrefService* prefs = profile->GetPrefs(); | 188 PrefService* prefs = profile->GetPrefs(); |
170 if (!prefs->FindPreference(window_pref.c_str())) { | 189 if (!prefs->FindPreference(window_pref.c_str())) { |
171 // TODO(joi): Do all registration up front. | 190 // TODO(joi): Do all registration up front. |
172 scoped_refptr<PrefRegistrySyncable> registry( | 191 scoped_refptr<PrefRegistrySyncable> registry( |
173 static_cast<PrefRegistrySyncable*>(prefs->DeprecatedGetPrefRegistry())); | 192 static_cast<PrefRegistrySyncable*>(prefs->DeprecatedGetPrefRegistry())); |
174 registry->RegisterDictionaryPref(window_pref.c_str(), | 193 registry->RegisterDictionaryPref(window_pref.c_str(), |
175 PrefRegistrySyncable::UNSYNCABLE_PREF); | 194 PrefRegistrySyncable::UNSYNCABLE_PREF); |
176 } | 195 } |
177 } | 196 } |
178 | 197 |
179 | 198 |
180 } // namespace chrome | 199 } // namespace chrome |
OLD | NEW |