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

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

Issue 10829029: sync: don't display one-click if setup is in progress (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 8 years, 5 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/sync/one_click_signin_helper.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc
index fe024634f7698f3bb93eec96341912e62b18f263..b388be38b64b46d204e9f83e9bd0a69013b384df 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -18,6 +18,7 @@
#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/tab_contents/confirm_infobar_delegate.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -225,6 +226,21 @@ bool OneClickSigninHelper::CanOffer(content::WebContents* web_contents,
if (!manager->GetAuthenticatedUsername().empty())
return false;
+
+ // If we're about to show a one-click infobar but the user has started
+ // a concurrent signin flow (perhaps via the promo), we may not have yet
+ // established an authenticated username but we still shouldn't move
+ // forward with two simultaneous signin processes. This is a bit
+ // contentious as the one-click flow is a much smoother flow from the user
+ // perspective, but it's much more difficult to hijack the other flow from
+ // here as it is to bail.
+ ProfileSyncService* service =
+ ProfileSyncServiceFactory::GetForProfile(profile);
+ if (!service)
+ return false;
+
+ if (service->FirstSetupInProgress())
+ return false;
}
return true;
« no previous file with comments | « chrome/browser/sync/test_profile_sync_service.h ('k') | chrome/browser/ui/sync/one_click_signin_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698