Commit f16917c7 authored by xiyuan@chromium.org's avatar xiyuan@chromium.org

[ChromeOS] Fake OAUTH_TOKEN_STATUS_VALID when "--skip-oauth-login" is set.

BUG=chromium-os:18740
TEST=Add "--skip-oauth-login" in command line and focusing on user pod should stay, i.e. no auto switching to Gaia.

Review URL: http://codereview.chromium.org/7583010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95653 0039d316-1c4b-4281-b951-d872f2087c98
parent d613a990
...@@ -289,13 +289,19 @@ std::vector<UserManager::User> UserManager::GetUsers() const { ...@@ -289,13 +289,19 @@ std::vector<UserManager::User> UserManager::GetUsers() const {
user.set_email(email); user.set_email(email);
// Get OAuth token status. // Get OAuth token status.
int oauth_token_status; if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSkipOAuthLogin)) {
// Use OAUTH_TOKEN_STATUS_VALID flag if kSkipOAuthLogin is present.
user.set_oauth_token_status(OAUTH_TOKEN_STATUS_VALID);
} else {
int oauth_token_status = OAUTH_TOKEN_STATUS_UNKNOWN;
if (prefs_oauth_status && if (prefs_oauth_status &&
prefs_oauth_status->GetIntegerWithoutPathExpansion(email, prefs_oauth_status->GetIntegerWithoutPathExpansion(email,
&oauth_token_status)) { &oauth_token_status)) {
user.set_oauth_token_status( user.set_oauth_token_status(
static_cast<OAuthTokenStatus>(oauth_token_status)); static_cast<OAuthTokenStatus>(oauth_token_status));
} }
}
UserImages::const_iterator image_it = user_images_.find(email); UserImages::const_iterator image_it = user_images_.find(email);
std::string image_path; std::string image_path;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment