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

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

Issue 16980002: Reset profile: unpin all pinned tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android compilation Created 7 years, 6 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698