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

Side by Side 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 3 years, 12 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/sync/sync_promo_ui.h" 5 #include "chrome/browser/ui/sync/sync_promo_ui.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/signin/signin_promo_util.h" 8 #include "chrome/browser/signin/signin_promo_util.h"
9 #include "components/sync/base/sync_prefs.h"
9 10
10 bool SyncPromoUI::ShouldShowSyncPromo(Profile* profile) { 11 bool SyncPromoUI::ShouldShowSyncPromo(Profile* profile) {
11 // Don't show sync promo if the sign in promo should not be shown. 12 // Don't show sync promo if the sign in promo should not be shown.
12 if (!signin::ShouldShowPromo(profile)) { 13 if (!signin::ShouldShowPromo(profile)) {
13 return false; 14 return false;
14 } 15 }
15 16
16 // Don't show if sync is not allowed to start. 17 syncer::SyncPrefs prefs(profile->GetPrefs());
17 if (!profile->IsSyncAllowed()) 18 // Don't show if sync is not allowed to start or is running in local mode.
19 if (!profile->IsSyncAllowed() || prefs.IsLocalSyncEnabled())
18 return false; 20 return false;
19 21
20 return true; 22 return true;
21 } 23 }
OLDNEW
« 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