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

Side by Side Diff: chrome/browser/chromeos/login/user_manager.cc

Issue 7583010: [ChromeOS] Fake OAUTH_TOKEN_STATUS_VALID when "--skip-oauth-login" is set. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: set initial value for oauth_token_status per sidor Created 9 years, 4 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 | « no previous file | 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chromeos/login/user_manager.h" 5 #include "chrome/browser/chromeos/login/user_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 282
283 for (ListValue::const_iterator it = prefs_users->begin(); 283 for (ListValue::const_iterator it = prefs_users->begin();
284 it != prefs_users->end(); 284 it != prefs_users->end();
285 ++it) { 285 ++it) {
286 std::string email; 286 std::string email;
287 if ((*it)->GetAsString(&email)) { 287 if ((*it)->GetAsString(&email)) {
288 User user; 288 User user;
289 user.set_email(email); 289 user.set_email(email);
290 290
291 // Get OAuth token status. 291 // Get OAuth token status.
292 int oauth_token_status; 292 if (CommandLine::ForCurrentProcess()->HasSwitch(
293 if (prefs_oauth_status && 293 switches::kSkipOAuthLogin)) {
294 prefs_oauth_status->GetIntegerWithoutPathExpansion(email, 294 // Use OAUTH_TOKEN_STATUS_VALID flag if kSkipOAuthLogin is present.
295 &oauth_token_status)) { 295 user.set_oauth_token_status(OAUTH_TOKEN_STATUS_VALID);
296 user.set_oauth_token_status( 296 } else {
297 static_cast<OAuthTokenStatus>(oauth_token_status)); 297 int oauth_token_status = OAUTH_TOKEN_STATUS_UNKNOWN;
298 if (prefs_oauth_status &&
299 prefs_oauth_status->GetIntegerWithoutPathExpansion(email,
300 &oauth_token_status)) {
301 user.set_oauth_token_status(
302 static_cast<OAuthTokenStatus>(oauth_token_status));
303 }
298 } 304 }
299 305
300 UserImages::const_iterator image_it = user_images_.find(email); 306 UserImages::const_iterator image_it = user_images_.find(email);
301 std::string image_path; 307 std::string image_path;
302 if (image_it == user_images_.end()) { 308 if (image_it == user_images_.end()) {
303 // Get account image path. 309 // Get account image path.
304 if (prefs_images && 310 if (prefs_images &&
305 prefs_images->GetStringWithoutPathExpansion(email, &image_path)) { 311 prefs_images->GetStringWithoutPathExpansion(email, &image_path)) {
306 int default_image_id = kDefaultImagesCount; 312 int default_image_id = kDefaultImagesCount;
307 if (IsDefaultImagePath(image_path, &default_image_id)) { 313 if (IsDefaultImagePath(image_path, &default_image_id)) {
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 } 706 }
701 707
702 void UserManager::NotifyLocalStateChanged() { 708 void UserManager::NotifyLocalStateChanged() {
703 FOR_EACH_OBSERVER( 709 FOR_EACH_OBSERVER(
704 Observer, 710 Observer,
705 observer_list_, 711 observer_list_,
706 LocalStateChanged(this)); 712 LocalStateChanged(this));
707 } 713 }
708 714
709 } // namespace chromeos 715 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698