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

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

Issue 9295044: Start moving signin code out of browser/sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up unnecessary inclusions of signin_manager.h Created 8 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/sync/profile_sync_service.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 a45318f877a8392dd2a9982fcf912793df47b9ae..47c0c85d78a503bbb6b64f288ab189628c966bd5 100644
--- a/chrome/browser/signin/signin_manager.cc
+++ b/chrome/browser/signin/signin_manager.cc
@@ -68,8 +68,12 @@ const std::string& SigninManager::GetAuthenticatedUsername() {
}
void SigninManager::SetAuthenticatedUsername(const std::string& username) {
- DCHECK(authenticated_username_.empty() ||
- username == authenticated_username_);
+ if (!authenticated_username_.empty()) {
+ DLOG_IF(ERROR, username != authenticated_username_) <<
+ "Tried to change the authenticated username to something different: " <<
+ "Current: " << authenticated_username_ << ", New: " << username;
+ return;
+ }
authenticated_username_ = username;
// TODO(tim): We could go further in ensuring kGoogleServicesUsername and
// authenticated_username_ are consistent once established (e.g. remove
@@ -192,6 +196,10 @@ const GoogleServiceAuthError& SigninManager::GetLoginAuthError() const {
return last_login_auth_error_;
}
+bool SigninManager::AuthInProgress() const {
+ return !possibly_invalid_username_.empty();
+}
+
void SigninManager::OnClientLoginSuccess(const ClientLoginResult& result) {
DCHECK(!browser_sync::IsUsingOAuth());
last_result_ = result;
@@ -204,10 +212,8 @@ void SigninManager::OnGetUserInfoSuccess(const std::string& key,
const std::string& value) {
DCHECK(!browser_sync::IsUsingOAuth());
DCHECK(key == kGetInfoEmailKey);
- DCHECK(authenticated_username_.empty() || authenticated_username_ == value);
-
last_login_auth_error_ = GoogleServiceAuthError::None();
- authenticated_username_ = value;
+ SetAuthenticatedUsername(value);
possibly_invalid_username_.clear();
profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
authenticated_username_);
« no previous file with comments | « chrome/browser/signin/signin_manager.h ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698