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

Unified Diff: chrome/browser/sync/glue/session_model_associator.cc

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add to PrefRegistrySyncable and PrefServiceSyncable to let sync know of pre-registered prefs. 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/glue/session_model_associator.cc
diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc
index e2ee5220daefafa979efb053f5691e78bb2550d4..19109b7c879d30abd3f0640659ae7437d1083efb 100644
--- a/chrome/browser/sync/glue/session_model_associator.cc
+++ b/chrome/browser/sync/glue/session_model_associator.cc
@@ -16,7 +16,8 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/history/history_service.h"
-#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/prefs/pref_registry_syncable.h"
+#include "chrome/browser/prefs/pref_service_syncable.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_id.h"
#include "chrome/browser/sync/glue/device_info.h"
@@ -95,15 +96,17 @@ SessionModelAssociator::SessionModelAssociator(ProfileSyncService* sync_service,
waiting_for_change_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(test_weak_factory_(this)),
profile_(sync_service->profile()),
- pref_service_(profile_->GetPrefs()),
+ pref_service_(PrefServiceSyncable::FromProfile(profile_)),
error_handler_(error_handler) {
DCHECK(CalledOnValidThread());
DCHECK(sync_service_);
DCHECK(profile_);
if (pref_service_->FindPreference(kSyncSessionsGUID) == NULL) {
- pref_service_->RegisterStringPref(kSyncSessionsGUID,
- std::string(),
- PrefServiceSyncable::UNSYNCABLE_PREF);
+ static_cast<PrefRegistrySyncable*>(
+ pref_service_->DeprecatedGetPrefRegistry())->RegisterStringPref(
+ kSyncSessionsGUID,
+ std::string(),
+ PrefRegistrySyncable::UNSYNCABLE_PREF);
}
}

Powered by Google App Engine
This is Rietveld 408576698