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

Unified Diff: chrome/browser/google_apis/auth_service.cc

Issue 13495003: Add LoginState class to src/chromeos/login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Elim LOGGED_IN_LOCKED Created 7 years, 8 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
Index: chrome/browser/google_apis/auth_service.cc
diff --git a/chrome/browser/google_apis/auth_service.cc b/chrome/browser/google_apis/auth_service.cc
index 5fb137efaafcfe6ecbd182ab0904561147ab1d14..8ce5fc99c4125ebf580e9d0ff788d8a72a7f012f 100644
--- a/chrome/browser/google_apis/auth_service.cc
+++ b/chrome/browser/google_apis/auth_service.cc
@@ -26,7 +26,7 @@
#include "google_apis/gaia/oauth2_access_token_fetcher.h"
#if defined(OS_CHROMEOS)
-#include "chrome/browser/chromeos/login/user_manager.h"
+#include "chromeos/login/login_state.h"
#endif // OS_CHROMEOS
using content::BrowserThread;
@@ -290,9 +290,13 @@ void AuthService::Observe(int type,
// static
bool AuthService::CanAuthenticate(Profile* profile) {
#if defined(OS_CHROMEOS)
- if (!chromeos::UserManager::Get()->IsUserLoggedIn() ||
- chromeos::UserManager::Get()->IsLoggedInAsGuest() ||
- chromeos::UserManager::Get()->IsLoggedInAsDemoUser())
+ if (!chromeos::LoginState::IsInitialized())
+ return false;
+ chromeos::LoginState::LoggedInUserType user_type =
+ chromeos::LoginState::Get()->GetLoggedInUserType();
+ if (user_type == chromeos::LoginState::LOGGED_IN_USER_NONE ||
+ user_type == chromeos::LoginState::LOGGED_IN_USER_GUEST ||
+ user_type == chromeos::LoginState::LOGGED_IN_USER_RETAIL_MODE)
return false;
Nikita (slow) 2013/04/10 08:09:22 nit: Add {}
stevenjb 2013/04/10 16:32:17 Done.
#endif // OS_CHROMEOS

Powered by Google App Engine
This is Rietveld 408576698