summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/google_apis/auth_service.cc2
-rw-r--r--chromeos/login/login_state.cc6
-rw-r--r--chromeos/login/login_state.h4
3 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/google_apis/auth_service.cc b/chrome/browser/google_apis/auth_service.cc
index 2be910d..307dc7f 100644
--- a/chrome/browser/google_apis/auth_service.cc
+++ b/chrome/browser/google_apis/auth_service.cc
@@ -276,7 +276,7 @@ bool AuthService::CanAuthenticate(Profile* profile) {
#if defined(OS_CHROMEOS)
if (!chromeos::LoginState::IsInitialized())
return false;
- if (!chromeos::LoginState::Get()->IsUserAuthenticated())
+ if (!chromeos::LoginState::Get()->IsUserGaiaAuthenticated())
return false;
#endif // OS_CHROMEOS
diff --git a/chromeos/login/login_state.cc b/chromeos/login/login_state.cc
index 75fed89..67f9b06 100644
--- a/chromeos/login/login_state.cc
+++ b/chromeos/login/login_state.cc
@@ -88,6 +88,12 @@ bool LoginState::IsUserAuthenticated() const {
type == chromeos::LoginState::LOGGED_IN_USER_LOCALLY_MANAGED;
}
+bool LoginState::IsUserGaiaAuthenticated() const {
+ LoggedInUserType type = logged_in_user_type_;
+ return type == chromeos::LoginState::LOGGED_IN_USER_REGULAR ||
+ type == chromeos::LoginState::LOGGED_IN_USER_OWNER;
+}
+
// Private methods
LoginState::LoginState() : logged_in_state_(LOGGED_IN_OOBE),
diff --git a/chromeos/login/login_state.h b/chromeos/login/login_state.h
index 1d05788..6f09564 100644
--- a/chromeos/login/login_state.h
+++ b/chromeos/login/login_state.h
@@ -63,6 +63,10 @@ class CHROMEOS_EXPORT LoginState {
// Returns true if the user is an authenticated user (i.e. non public account)
bool IsUserAuthenticated() const;
+ // Returns true if the user is authenticated by logging into Google account
+ // (i.e., non public nor locally managed account).
+ bool IsUserGaiaAuthenticated() const;
+
private:
LoginState();
virtual ~LoginState();