Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: chrome/browser/ui/browser_ui_prefs.cc

Issue 14924002: WebUI for Profile Settings Reset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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);
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698