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

Unified Diff: chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc

Issue 12077030: Allow signin to continue even if sync is disabled by policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup after self-review Created 7 years, 11 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/ui/webui/sync_promo/sync_promo_ui.cc
diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc b/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc
index 6e00ca14e4f8e10bd1531731f77db45273d6b4fd..0ac2fac22f2ee8680b89d32e432de96c3dcff016 100644
--- a/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc
+++ b/chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc
@@ -16,6 +16,8 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/signin/signin_manager.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/webui/options/core_options_handler.h"
@@ -126,8 +128,13 @@ bool SyncPromoUI::ShouldShowSyncPromo(Profile* profile) {
return false;
// Honor the sync policies.
- if (!profile->GetOriginalProfile()->IsSyncAccessible())
- return false;
+ profile = profile->GetOriginalProfile();
sail 2013/01/29 19:17:16 Changing passed in parameters is really confusing.
Andrew T Wilson (Slow) 2013/01/30 13:55:50 Done.
+ if (!profile->IsSyncAccessible()) {
+ // Sync is disabled by policy - display the promo if the user is not signed
sail 2013/01/29 19:17:16 I don't understand this. This implies that if sync
Andrew T Wilson (Slow) 2013/01/30 07:43:41 If sync is accessible (meaning not disabled by pol
Andrew T Wilson (Slow) 2013/01/30 13:55:50 Actually, after re-reading your comment, I've chan
sail 2013/01/30 17:51:01 Awesome!
+ // in.
+ SigninManager* signin = SigninManagerFactory::GetForProfile(profile);
+ return signin->GetAuthenticatedUsername().empty();
+ }
// If the user is already signed into sync then don't show the promo.
ProfileSyncService* service =
« no previous file with comments | « chrome/browser/ui/webui/options/browser_options_handler.cc ('k') | chrome/browser/ui/webui/sync_setup_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698