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

Unified Diff: chrome/browser/ui/sync/sync_promo_ui.cc

Issue 2494873003: [Sync] Allow sync start without sign-in if the local sync backend is on. (Closed)
Patch Set: Remove ifdefs around include. 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
« no previous file with comments | « chrome/browser/sync/profile_sync_service_factory.cc ('k') | components/browser_sync/profile_sync_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sync/sync_promo_ui.cc
diff --git a/chrome/browser/ui/sync/sync_promo_ui.cc b/chrome/browser/ui/sync/sync_promo_ui.cc
index 3fa574b6483f4358dad9aa04427e099145d549d1..f84177a71287551dc23eaed6eb6898155f2cbaab 100644
--- a/chrome/browser/ui/sync/sync_promo_ui.cc
+++ b/chrome/browser/ui/sync/sync_promo_ui.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/signin_promo_util.h"
+#include "components/sync/base/sync_prefs.h"
bool SyncPromoUI::ShouldShowSyncPromo(Profile* profile) {
// Don't show sync promo if the sign in promo should not be shown.
@@ -13,8 +14,9 @@ bool SyncPromoUI::ShouldShowSyncPromo(Profile* profile) {
return false;
}
- // Don't show if sync is not allowed to start.
- if (!profile->IsSyncAllowed())
+ syncer::SyncPrefs prefs(profile->GetPrefs());
+ // Don't show if sync is not allowed to start or is running in local mode.
+ if (!profile->IsSyncAllowed() || prefs.IsLocalSyncEnabled())
return false;
return true;
« no previous file with comments | « chrome/browser/sync/profile_sync_service_factory.cc ('k') | components/browser_sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698