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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 merge_session_helper_->LogIn(GetAuthenticatedUsername()); | 616 merge_session_helper_->LogIn(GetAuthenticatedUsername()); |
617 } | 617 } |
618 | 618 |
619 void SigninManager::OnExternalSigninCompleted(const std::string& username) { | 619 void SigninManager::OnExternalSigninCompleted(const std::string& username) { |
620 OnSignedIn(username); | 620 OnSignedIn(username); |
621 } | 621 } |
622 | 622 |
623 void SigninManager::OnSignedIn(const std::string& username) { | 623 void SigninManager::OnSignedIn(const std::string& username) { |
624 SetAuthenticatedUsername(username); | 624 SetAuthenticatedUsername(username); |
625 possibly_invalid_username_.clear(); | 625 possibly_invalid_username_.clear(); |
626 profile_->GetPrefs()->SetString(prefs::kGoogleServicesUsername, | |
627 GetAuthenticatedUsername()); | |
628 | 626 |
629 // TODO(blundell): Eliminate this notification send once crbug.com/333997 is | 627 // TODO(blundell): Eliminate this notification send once crbug.com/333997 is |
630 // fixed. | 628 // fixed. |
631 GoogleServiceSigninSuccessDetails details(GetAuthenticatedUsername(), | 629 GoogleServiceSigninSuccessDetails details(GetAuthenticatedUsername(), |
632 password_); | 630 password_); |
633 content::NotificationService::current()->Notify( | 631 content::NotificationService::current()->Notify( |
634 chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, | 632 chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, |
635 content::Source<Profile>(profile_), | 633 content::Source<Profile>(profile_), |
636 content::Details<const GoogleServiceSigninSuccessDetails>(&details)); | 634 content::Details<const GoogleServiceSigninSuccessDetails>(&details)); |
637 | 635 |
(...skipping 28 matching lines...) Expand all Loading... |
666 signin_host_id_ = ChildProcessHost::kInvalidUniqueID; | 664 signin_host_id_ = ChildProcessHost::kInvalidUniqueID; |
667 } | 665 } |
668 | 666 |
669 void SigninManager::ProhibitSignout(bool prohibit_signout) { | 667 void SigninManager::ProhibitSignout(bool prohibit_signout) { |
670 prohibit_signout_ = prohibit_signout; | 668 prohibit_signout_ = prohibit_signout; |
671 } | 669 } |
672 | 670 |
673 bool SigninManager::IsSignoutProhibited() const { | 671 bool SigninManager::IsSignoutProhibited() const { |
674 return prohibit_signout_; | 672 return prohibit_signout_; |
675 } | 673 } |
OLD | NEW |