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

Side by Side Diff: chrome/browser/prefs/browser_prefs.cc

Issue 12320064: Fix prefs registration in promo code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge LKGR Created 7 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/web_resource/notification_promo.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/prefs/browser_prefs.h" 5 #include "chrome/browser/prefs/browser_prefs.h"
6 6
7 #include "apps/prefs.h" 7 #include "apps/prefs.h"
8 #include "base/prefs/pref_registry_simple.h" 8 #include "base/prefs/pref_registry_simple.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/about_flags.h" 10 #include "chrome/browser/about_flags.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 InstantUI::RegisterUserPrefs(registry); 286 InstantUI::RegisterUserPrefs(registry);
287 browser_sync::InvalidatorStorage::RegisterUserPrefs(registry); 287 browser_sync::InvalidatorStorage::RegisterUserPrefs(registry);
288 MediaCaptureDevicesDispatcher::RegisterUserPrefs(registry); 288 MediaCaptureDevicesDispatcher::RegisterUserPrefs(registry);
289 MediaStreamDevicesController::RegisterUserPrefs(registry); 289 MediaStreamDevicesController::RegisterUserPrefs(registry);
290 NetPrefObserver::RegisterUserPrefs(registry); 290 NetPrefObserver::RegisterUserPrefs(registry);
291 NewTabUI::RegisterUserPrefs(registry); 291 NewTabUI::RegisterUserPrefs(registry);
292 PasswordManager::RegisterUserPrefs(registry); 292 PasswordManager::RegisterUserPrefs(registry);
293 PrefProxyConfigTrackerImpl::RegisterUserPrefs(registry); 293 PrefProxyConfigTrackerImpl::RegisterUserPrefs(registry);
294 PrefsTabHelper::RegisterUserPrefs(registry); 294 PrefsTabHelper::RegisterUserPrefs(registry);
295 ProfileImpl::RegisterUserPrefs(registry); 295 ProfileImpl::RegisterUserPrefs(registry);
296 PromoResourceService::RegisterUserPrefs(user_prefs, registry); 296 PromoResourceService::RegisterUserPrefs(registry);
297 ProtocolHandlerRegistry::RegisterUserPrefs(registry); 297 ProtocolHandlerRegistry::RegisterUserPrefs(registry);
298 RegisterBrowserUserPrefs(registry); 298 RegisterBrowserUserPrefs(registry);
299 SessionStartupPref::RegisterUserPrefs(registry); 299 SessionStartupPref::RegisterUserPrefs(registry);
300 TemplateURLPrepopulateData::RegisterUserPrefs(registry); 300 TemplateURLPrepopulateData::RegisterUserPrefs(registry);
301 TranslatePrefs::RegisterUserPrefs(user_prefs, registry); 301 TranslatePrefs::RegisterUserPrefs(user_prefs, registry);
302 302
303 #if defined(ENABLE_CONFIGURATION_POLICY) 303 #if defined(ENABLE_CONFIGURATION_POLICY)
304 policy::URLBlacklistManager::RegisterUserPrefs(registry); 304 policy::URLBlacklistManager::RegisterUserPrefs(registry);
305 #endif 305 #endif
306 306
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 PrefRegistrySyncable::UNSYNCABLE_PREF); 362 PrefRegistrySyncable::UNSYNCABLE_PREF);
363 } 363 }
364 364
365 void MigrateUserPrefs(Profile* profile) { 365 void MigrateUserPrefs(Profile* profile) {
366 PrefService* prefs = profile->GetPrefs(); 366 PrefService* prefs = profile->GetPrefs();
367 367
368 // Cleanup prefs from now-removed protector feature. 368 // Cleanup prefs from now-removed protector feature.
369 prefs->ClearPref(kBackupPref); 369 prefs->ClearPref(kBackupPref);
370 370
371 PrefsTabHelper::MigrateUserPrefs(prefs); 371 PrefsTabHelper::MigrateUserPrefs(prefs);
372 PromoResourceService::MigrateUserPrefs(prefs);
372 } 373 }
373 374
374 void MigrateBrowserPrefs(Profile* profile, PrefService* local_state) { 375 void MigrateBrowserPrefs(Profile* profile, PrefService* local_state) {
375 // Copy pref values which have been migrated to user_prefs from local_state, 376 // Copy pref values which have been migrated to user_prefs from local_state,
376 // or remove them from local_state outright, if copying is not required. 377 // or remove them from local_state outright, if copying is not required.
377 int current_version = 378 int current_version =
378 local_state->GetInteger(prefs::kMultipleProfilePrefMigration); 379 local_state->GetInteger(prefs::kMultipleProfilePrefMigration);
379 PrefRegistrySimple* registry = static_cast<PrefRegistrySimple*>( 380 PrefRegistrySimple* registry = static_cast<PrefRegistrySimple*>(
380 local_state->DeprecatedGetPrefRegistry()); 381 local_state->DeprecatedGetPrefRegistry());
381 382
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 } 436 }
436 local_state->ClearPref(prefs::kLastPromptedGoogleURL); 437 local_state->ClearPref(prefs::kLastPromptedGoogleURL);
437 438
438 current_version |= GOOGLE_URL_TRACKER_PREFS; 439 current_version |= GOOGLE_URL_TRACKER_PREFS;
439 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, 440 local_state->SetInteger(prefs::kMultipleProfilePrefMigration,
440 current_version); 441 current_version);
441 } 442 }
442 } 443 }
443 444
444 } // namespace chrome 445 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/web_resource/notification_promo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698