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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 false, | 189 false, |
190 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 190 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
191 registry->RegisterBooleanPref( | 191 registry->RegisterBooleanPref( |
192 prefs::kClearPluginLSODataEnabled, | 192 prefs::kClearPluginLSODataEnabled, |
193 true, | 193 true, |
194 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 194 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
195 registry->RegisterBooleanPref( | 195 registry->RegisterBooleanPref( |
196 prefs::kHideWebStoreIcon, | 196 prefs::kHideWebStoreIcon, |
197 false, | 197 false, |
198 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 198 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
199 | |
200 registry->RegisterBooleanPref( | |
201 prefs::kResetDefaultSearchEngine, | |
202 true, | |
203 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
204 registry->RegisterBooleanPref( | |
205 prefs::kResetHomepage, | |
206 true, | |
207 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
208 registry->RegisterBooleanPref( | |
209 prefs::kResetContentSettings, | |
210 true, | |
211 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
212 registry->RegisterBooleanPref( | |
213 prefs::kResetCookiesAndSiteData, | |
214 true, | |
215 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
216 registry->RegisterBooleanPref( | |
217 prefs::kResetExtensions, | |
218 true, | |
219 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
220 registry->RegisterIntegerPref( | |
221 prefs::kResetExtensionsHandling, | |
222 0, | |
223 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
sky
2013/05/21 15:08:29
I haven't been involved with this feature, so forg
battre
2013/05/21 16:29:31
The reason for preferences is mostly to be consist
| |
199 } | 224 } |
200 | 225 |
201 void RegisterAppPrefs(const std::string& app_name, Profile* profile) { | 226 void RegisterAppPrefs(const std::string& app_name, Profile* profile) { |
202 // We need to register the window position pref. | 227 // We need to register the window position pref. |
203 // | 228 // |
204 // TODO(mnissler): Use a separate pref name pointing to a single | 229 // TODO(mnissler): Use a separate pref name pointing to a single |
205 // dictionary instead. Also tracked as http://crbug.com/167256 | 230 // dictionary instead. Also tracked as http://crbug.com/167256 |
206 std::string window_pref(prefs::kBrowserWindowPlacement); | 231 std::string window_pref(prefs::kBrowserWindowPlacement); |
207 window_pref.append("_"); | 232 window_pref.append("_"); |
208 window_pref.append(app_name); | 233 window_pref.append(app_name); |
209 PrefService* prefs = profile->GetPrefs(); | 234 PrefService* prefs = profile->GetPrefs(); |
210 if (!prefs->FindPreference(window_pref.c_str())) { | 235 if (!prefs->FindPreference(window_pref.c_str())) { |
211 // TODO(joi): Do all registration up front. | 236 // TODO(joi): Do all registration up front. |
212 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( | 237 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( |
213 static_cast<user_prefs::PrefRegistrySyncable*>( | 238 static_cast<user_prefs::PrefRegistrySyncable*>( |
214 prefs->DeprecatedGetPrefRegistry())); | 239 prefs->DeprecatedGetPrefRegistry())); |
215 registry->RegisterDictionaryPref( | 240 registry->RegisterDictionaryPref( |
216 window_pref.c_str(), user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 241 window_pref.c_str(), user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
217 } | 242 } |
218 } | 243 } |
219 | 244 |
220 | 245 |
221 } // namespace chrome | 246 } // namespace chrome |
OLD | NEW |