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

Unified Diff: chrome/browser/profiles/profile.cc

Issue 2494873003: [Sync] Allow sync start without sign-in if the local sync backend is on. (Closed)
Patch Set: Merge pref changes from https://codereview.chromium.org/2528163002/. Created 4 years 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/profiles/profile.cc
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
index 65ac81bd893736a0a77146bb53e61eb02f41b803..f4a7b14795659cef407acc4a96da7f8d278334ca 100644
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -211,9 +211,8 @@ bool Profile::IsNewProfile() {
}
bool Profile::IsSyncAllowed() {
- if (ProfileSyncServiceFactory::HasProfileSyncService(this)) {
+ if (ProfileSyncServiceFactory::HasProfileSyncService(this))
return ProfileSyncServiceFactory::GetForProfile(this)->IsSyncAllowed();
- }
// No ProfileSyncService created yet - we don't want to create one, so just
// infer the accessible state by looking at prefs/command line flags.
@@ -222,6 +221,16 @@ bool Profile::IsSyncAllowed() {
!prefs.IsManaged();
}
+bool Profile::IsLocalSyncEnabled() {
Nicolas Zea 2016/12/15 00:37:28 Do we really need this exposed here? Can we just h
pastarmovj 2016/12/16 17:04:48 As suggested reverted this change.
+ if (ProfileSyncServiceFactory::HasProfileSyncService(this))
+ return ProfileSyncServiceFactory::GetForProfile(this)->IsLocalSyncEnabled();
+
+ // No ProfileSyncService created yet - we don't want to create one, so just
+ // infer the accessible state by looking at prefs/command line flags.
+ syncer::SyncPrefs prefs(GetPrefs());
+ return prefs.IsLocalSyncEnabled();
+}
+
void Profile::MaybeSendDestroyedNotification() {
if (!sent_destroyed_notification_) {
sent_destroyed_notification_ = true;

Powered by Google App Engine
This is Rietveld 408576698