| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 false, | 184 false, |
| 185 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 185 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 186 registry->RegisterBooleanPref( | 186 registry->RegisterBooleanPref( |
| 187 prefs::kClearPluginLSODataEnabled, | 187 prefs::kClearPluginLSODataEnabled, |
| 188 true, | 188 true, |
| 189 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 189 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 190 registry->RegisterBooleanPref( | 190 registry->RegisterBooleanPref( |
| 191 prefs::kHideWebStoreIcon, | 191 prefs::kHideWebStoreIcon, |
| 192 false, | 192 false, |
| 193 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 193 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 194 | |
| 195 registry->RegisterBooleanPref( | |
| 196 prefs::kResetDefaultSearchEngine, | |
| 197 true, | |
| 198 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
| 199 registry->RegisterBooleanPref( | |
| 200 prefs::kResetHomepage, | |
| 201 true, | |
| 202 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
| 203 registry->RegisterBooleanPref( | |
| 204 prefs::kResetContentSettings, | |
| 205 true, | |
| 206 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
| 207 registry->RegisterBooleanPref( | |
| 208 prefs::kResetCookiesAndSiteData, | |
| 209 true, | |
| 210 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
| 211 registry->RegisterBooleanPref( | |
| 212 prefs::kResetExtensions, | |
| 213 true, | |
| 214 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
| 215 registry->RegisterIntegerPref( | |
| 216 prefs::kResetExtensionsHandling, | |
| 217 0, | |
| 218 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | |
| 219 } | 194 } |
| 220 | 195 |
| 221 void RegisterAppPrefs(const std::string& app_name, Profile* profile) { | 196 void RegisterAppPrefs(const std::string& app_name, Profile* profile) { |
| 222 // We need to register the window position pref. | 197 // We need to register the window position pref. |
| 223 // | 198 // |
| 224 // TODO(mnissler): Use a separate pref name pointing to a single | 199 // TODO(mnissler): Use a separate pref name pointing to a single |
| 225 // dictionary instead. Also tracked as http://crbug.com/167256 | 200 // dictionary instead. Also tracked as http://crbug.com/167256 |
| 226 std::string window_pref(prefs::kBrowserWindowPlacement); | 201 std::string window_pref(prefs::kBrowserWindowPlacement); |
| 227 window_pref.append("_"); | 202 window_pref.append("_"); |
| 228 window_pref.append(app_name); | 203 window_pref.append(app_name); |
| 229 PrefService* prefs = profile->GetPrefs(); | 204 PrefService* prefs = profile->GetPrefs(); |
| 230 if (!prefs->FindPreference(window_pref.c_str())) { | 205 if (!prefs->FindPreference(window_pref.c_str())) { |
| 231 // TODO(joi): Do all registration up front. | 206 // TODO(joi): Do all registration up front. |
| 232 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( | 207 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( |
| 233 static_cast<user_prefs::PrefRegistrySyncable*>( | 208 static_cast<user_prefs::PrefRegistrySyncable*>( |
| 234 prefs->DeprecatedGetPrefRegistry())); | 209 prefs->DeprecatedGetPrefRegistry())); |
| 235 registry->RegisterDictionaryPref( | 210 registry->RegisterDictionaryPref( |
| 236 window_pref.c_str(), user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 211 window_pref.c_str(), user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 237 } | 212 } |
| 238 } | 213 } |
| 239 | 214 |
| 240 | 215 |
| 241 } // namespace chrome | 216 } // namespace chrome |
| OLD | NEW |