Chromium Code Reviews| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 true, | 205 true, |
| 206 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 206 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 207 registry->RegisterBooleanPref( | 207 registry->RegisterBooleanPref( |
| 208 prefs::kResetCookiesAndSiteData, | 208 prefs::kResetCookiesAndSiteData, |
| 209 true, | 209 true, |
| 210 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 210 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 211 registry->RegisterBooleanPref( | 211 registry->RegisterBooleanPref( |
| 212 prefs::kResetExtensions, | 212 prefs::kResetExtensions, |
| 213 true, | 213 true, |
| 214 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 214 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 215 registry->RegisterIntegerPref( | |
| 216 prefs::kResetExtensionsHandling, | |
| 217 0, | |
| 218 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
|
battre
2013/06/13 18:28:22
You should also remove code from reset_profile_set
vasilii
2013/06/14 17:21:53
Done.
| |
| 219 } | 215 } |
| 220 | 216 |
| 221 void RegisterAppPrefs(const std::string& app_name, Profile* profile) { | 217 void RegisterAppPrefs(const std::string& app_name, Profile* profile) { |
| 222 // We need to register the window position pref. | 218 // We need to register the window position pref. |
| 223 // | 219 // |
| 224 // TODO(mnissler): Use a separate pref name pointing to a single | 220 // TODO(mnissler): Use a separate pref name pointing to a single |
| 225 // dictionary instead. Also tracked as http://crbug.com/167256 | 221 // dictionary instead. Also tracked as http://crbug.com/167256 |
| 226 std::string window_pref(prefs::kBrowserWindowPlacement); | 222 std::string window_pref(prefs::kBrowserWindowPlacement); |
| 227 window_pref.append("_"); | 223 window_pref.append("_"); |
| 228 window_pref.append(app_name); | 224 window_pref.append(app_name); |
| 229 PrefService* prefs = profile->GetPrefs(); | 225 PrefService* prefs = profile->GetPrefs(); |
| 230 if (!prefs->FindPreference(window_pref.c_str())) { | 226 if (!prefs->FindPreference(window_pref.c_str())) { |
| 231 // TODO(joi): Do all registration up front. | 227 // TODO(joi): Do all registration up front. |
| 232 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( | 228 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( |
| 233 static_cast<user_prefs::PrefRegistrySyncable*>( | 229 static_cast<user_prefs::PrefRegistrySyncable*>( |
| 234 prefs->DeprecatedGetPrefRegistry())); | 230 prefs->DeprecatedGetPrefRegistry())); |
| 235 registry->RegisterDictionaryPref( | 231 registry->RegisterDictionaryPref( |
| 236 window_pref.c_str(), user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 232 window_pref.c_str(), user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 237 } | 233 } |
| 238 } | 234 } |
| 239 | 235 |
| 240 | 236 |
| 241 } // namespace chrome | 237 } // namespace chrome |
| OLD | NEW |