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

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

Issue 12088040: Add a SigninAllowed policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nits and rebase to ToT. Created 7 years, 10 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
« no previous file with comments | « chrome/browser/ui/chrome_pages.cc ('k') | chrome/browser/ui/sync/one_click_signin_helper_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7a898bad89ee47a1e4956eb38230e2c40297c99f..812b9e3643cf423e01d3adb2e542a4c7ec9624a7 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -540,6 +540,11 @@ bool OneClickSigninHelper::CanOffer(content::WebContents* web_contents,
if (!profile)
return false;
+ SigninManager* manager =
+ SigninManagerFactory::GetForProfile(profile);
+ if (manager && !manager->IsSigninAllowed())
+ return false;
+
if (can_offer_for == CAN_OFFER_FOR_INTERSTITAL_ONLY &&
!profile->GetPrefs()->GetBoolean(prefs::kReverseAutologinEnabled))
return false;
@@ -548,8 +553,6 @@ bool OneClickSigninHelper::CanOffer(content::WebContents* web_contents,
return false;
if (!email.empty()) {
- SigninManager* manager =
- SigninManagerFactory::GetForProfile(profile);
if (!manager)
return false;
@@ -661,6 +664,9 @@ OneClickSigninHelper::Offer OneClickSigninHelper::CanOfferOnIOThreadImpl(
if (io_data->is_incognito())
return DONT_OFFER;
+ if (!SigninManager::IsSigninAllowedOnIOThread(io_data))
+ return DONT_OFFER;
+
if (!io_data->reverse_autologin_enabled()->GetValue())
return DONT_OFFER;
« no previous file with comments | « chrome/browser/ui/chrome_pages.cc ('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