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

Unified Diff: chrome/browser/signin/signin_manager.cc

Issue 12258036: Properly handle disabling sync via the google dashboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Skip signout on cros. 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/signin/signin_manager.h ('k') | chrome/browser/signin/signin_manager_fake.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/signin_manager.cc
diff --git a/chrome/browser/signin/signin_manager.cc b/chrome/browser/signin/signin_manager.cc
index a5047b1c67b08008e295a9f976357fa2fe1a686e..fb94eb1c3942f6f45af04b458eb937f439ec71f8 100644
--- a/chrome/browser/signin/signin_manager.cc
+++ b/chrome/browser/signin/signin_manager.cc
@@ -194,6 +194,7 @@ bool SigninManager::IsAllowedUsername(const std::string& username,
SigninManager::SigninManager()
: profile_(NULL),
+ prohibit_signout_(false),
had_two_factor_error_(false),
type_(SIGNIN_TYPE_NONE),
weak_pointer_factory_(this) {
@@ -542,6 +543,10 @@ void SigninManager::HandleAuthError(const GoogleServiceAuthError& error,
void SigninManager::SignOut() {
DCHECK(IsInitialized());
+ if (prohibit_signout_) {
+ DVLOG(1) << "Ignoring attempt to sign out while signout is prohibited";
+ return;
+ }
if (authenticated_username_.empty() && !client_login_.get()) {
// Clean up our transient data and exit if we aren't signed in (or in the
// process of signing in). This avoids a perf regression from clearing out
@@ -889,6 +894,14 @@ void SigninManager::Shutdown() {
}
}
+void SigninManager::ProhibitSignout() {
+ prohibit_signout_ = true;
+}
+
+bool SigninManager::IsSignoutProhibited() const {
+ return prohibit_signout_;
+}
+
void SigninManager::OnGoogleServicesUsernamePatternChanged() {
if (!authenticated_username_.empty() &&
!IsAllowedUsername(authenticated_username_)) {
« no previous file with comments | « chrome/browser/signin/signin_manager.h ('k') | chrome/browser/signin/signin_manager_fake.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698