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

Side by Side Diff: components/signin/core/browser/signin_manager_base.cc

Issue 479353003: Add IsAuthenticated() method to SigninManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « components/signin/core/browser/signin_manager_base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/signin/core/browser/signin_manager_base.h" 5 #include "components/signin/core/browser/signin_manager_base.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // Go ahead and update the last signed in username here as well. Once a 89 // Go ahead and update the last signed in username here as well. Once a
90 // user is signed in the two preferences should match. Doing it here as 90 // user is signed in the two preferences should match. Doing it here as
91 // opposed to on signin allows us to catch the upgrade scenario. 91 // opposed to on signin allows us to catch the upgrade scenario.
92 client_->GetPrefs()->SetString(prefs::kGoogleServicesLastUsername, username); 92 client_->GetPrefs()->SetString(prefs::kGoogleServicesLastUsername, username);
93 } 93 }
94 94
95 void SigninManagerBase::clear_authenticated_username() { 95 void SigninManagerBase::clear_authenticated_username() {
96 authenticated_username_.clear(); 96 authenticated_username_.clear();
97 } 97 }
98 98
99 bool SigninManagerBase::IsAuthenticated() const {
100 return !GetAuthenticatedAccountId().empty();
101 }
102
99 bool SigninManagerBase::AuthInProgress() const { 103 bool SigninManagerBase::AuthInProgress() const {
100 // SigninManagerBase never kicks off auth processes itself. 104 // SigninManagerBase never kicks off auth processes itself.
101 return false; 105 return false;
102 } 106 }
103 107
104 void SigninManagerBase::Shutdown() {} 108 void SigninManagerBase::Shutdown() {}
105 109
106 void SigninManagerBase::AddObserver(Observer* observer) { 110 void SigninManagerBase::AddObserver(Observer* observer) {
107 observer_list_.AddObserver(observer); 111 observer_list_.AddObserver(observer);
108 } 112 }
(...skipping 20 matching lines...) Expand all
129 NotifySigninValueChanged(field, value)); 133 NotifySigninValueChanged(field, value));
130 } 134 }
131 135
132 void SigninManagerBase::NotifyDiagnosticsObservers( 136 void SigninManagerBase::NotifyDiagnosticsObservers(
133 const TimedSigninStatusField& field, 137 const TimedSigninStatusField& field,
134 const std::string& value) { 138 const std::string& value) {
135 FOR_EACH_OBSERVER(SigninDiagnosticsObserver, 139 FOR_EACH_OBSERVER(SigninDiagnosticsObserver,
136 signin_diagnostics_observers_, 140 signin_diagnostics_observers_,
137 NotifySigninValueChanged(field, value)); 141 NotifySigninValueChanged(field, value));
138 } 142 }
OLDNEW
« no previous file with comments | « components/signin/core/browser/signin_manager_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698