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

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

Issue 12313075: [sync] Upstream the Android ProfileSyncService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 9 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 a2f2bdd4d90f03ea01d3ddb0d1201f1ceb52ddbf..df68a731f36df5143c3275642069b57999e9c391 100644
--- a/chrome/browser/sync/glue/session_model_associator.cc
+++ b/chrome/browser/sync/glue/session_model_associator.cc
@@ -96,18 +96,10 @@ SessionModelAssociator::SessionModelAssociator(ProfileSyncService* sync_service,
waiting_for_change_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(test_weak_factory_(this)),
profile_(sync_service->profile()),
- pref_service_(PrefServiceSyncable::FromProfile(profile_)),
error_handler_(error_handler) {
DCHECK(CalledOnValidThread());
DCHECK(sync_service_);
DCHECK(profile_);
- if (pref_service_->FindPreference(kSyncSessionsGUID) == NULL) {
- static_cast<PrefRegistrySyncable*>(
- pref_service_->DeprecatedGetPrefRegistry())->RegisterStringPref(
- kSyncSessionsGUID,
- std::string(),
- PrefRegistrySyncable::UNSYNCABLE_PREF);
- }
}
SessionModelAssociator::SessionModelAssociator(ProfileSyncService* sync_service,
@@ -120,7 +112,6 @@ SessionModelAssociator::SessionModelAssociator(ProfileSyncService* sync_service,
waiting_for_change_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(test_weak_factory_(this)),
profile_(sync_service->profile()),
- pref_service_(NULL),
error_handler_(NULL) {
DCHECK(CalledOnValidThread());
DCHECK(sync_service_);
@@ -724,8 +715,8 @@ void SessionModelAssociator::InitializeCurrentMachineTag(
DCHECK(CalledOnValidThread());
DCHECK(current_machine_tag_.empty());
std::string persisted_guid;
- if (pref_service_)
- persisted_guid = pref_service_->GetString(kSyncSessionsGUID);
+ browser_sync::SyncPrefs prefs(profile_->GetPrefs());
+ persisted_guid = prefs.GetSyncSessionsGUID();
if (!persisted_guid.empty()) {
current_machine_tag_ = persisted_guid;
DVLOG(1) << "Restoring persisted session sync guid: "
@@ -733,8 +724,7 @@ void SessionModelAssociator::InitializeCurrentMachineTag(
} else {
current_machine_tag_ = GetMachineTagFromTransaction(trans);
DVLOG(1) << "Creating session sync guid: " << current_machine_tag_;
- if (pref_service_)
- pref_service_->SetString(kSyncSessionsGUID, current_machine_tag_);
+ prefs.SetSyncSessionsGUID(current_machine_tag_);
}
tab_pool_.set_machine_tag(current_machine_tag_);
« no previous file with comments | « chrome/browser/sync/glue/session_model_associator.h ('k') | chrome/browser/sync/profile_sync_service_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698