| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/signin/signin_manager.h" | 5 #include "chrome/browser/signin/signin_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 | 583 |
| 584 DCHECK(!temp_oauth_login_tokens_.refresh_token.empty()); | 584 DCHECK(!temp_oauth_login_tokens_.refresh_token.empty()); |
| 585 DCHECK(!GetAuthenticatedUsername().empty()); | 585 DCHECK(!GetAuthenticatedUsername().empty()); |
| 586 ProfileOAuth2TokenService* token_service = | 586 ProfileOAuth2TokenService* token_service = |
| 587 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); | 587 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); |
| 588 token_service->UpdateCredentials(GetAuthenticatedUsername(), | 588 token_service->UpdateCredentials(GetAuthenticatedUsername(), |
| 589 temp_oauth_login_tokens_.refresh_token); | 589 temp_oauth_login_tokens_.refresh_token); |
| 590 temp_oauth_login_tokens_ = ClientOAuthResult(); | 590 temp_oauth_login_tokens_ = ClientOAuthResult(); |
| 591 | 591 |
| 592 if (do_merge_session_in_signin_manager) | 592 if (do_merge_session_in_signin_manager) |
| 593 merge_session_helper_->LogIn(); | 593 merge_session_helper_->LogIn(GetAuthenticatedUsername()); |
| 594 } | 594 } |
| 595 | 595 |
| 596 void SigninManager::OnExternalSigninCompleted(const std::string& username) { | 596 void SigninManager::OnExternalSigninCompleted(const std::string& username) { |
| 597 OnSignedIn(username); | 597 OnSignedIn(username); |
| 598 } | 598 } |
| 599 | 599 |
| 600 void SigninManager::OnSignedIn(const std::string& username) { | 600 void SigninManager::OnSignedIn(const std::string& username) { |
| 601 SetAuthenticatedUsername(username); | 601 SetAuthenticatedUsername(username); |
| 602 possibly_invalid_username_.clear(); | 602 possibly_invalid_username_.clear(); |
| 603 profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, | 603 profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 } | 645 } |
| 646 } | 646 } |
| 647 | 647 |
| 648 void SigninManager::ProhibitSignout(bool prohibit_signout) { | 648 void SigninManager::ProhibitSignout(bool prohibit_signout) { |
| 649 prohibit_signout_ = prohibit_signout; | 649 prohibit_signout_ = prohibit_signout; |
| 650 } | 650 } |
| 651 | 651 |
| 652 bool SigninManager::IsSignoutProhibited() const { | 652 bool SigninManager::IsSignoutProhibited() const { |
| 653 return prohibit_signout_; | 653 return prohibit_signout_; |
| 654 } | 654 } |
| OLD | NEW |