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

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

Issue 11649055: OAuth2 sign-in flow for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/login_performer.h" 5 #include "chrome/browser/chromeos/login/login_performer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 LoginPerformer::LoginPerformer(Delegate* delegate) 54 LoginPerformer::LoginPerformer(Delegate* delegate)
55 : ALLOW_THIS_IN_INITIALIZER_LIST(online_attempt_host_(this)), 55 : ALLOW_THIS_IN_INITIALIZER_LIST(online_attempt_host_(this)),
56 last_login_failure_(LoginFailure::None()), 56 last_login_failure_(LoginFailure::None()),
57 delegate_(delegate), 57 delegate_(delegate),
58 password_changed_(false), 58 password_changed_(false),
59 password_changed_callback_count_(0), 59 password_changed_callback_count_(0),
60 screen_lock_requested_(false), 60 screen_lock_requested_(false),
61 initial_online_auth_pending_(false), 61 initial_online_auth_pending_(false),
62 auth_mode_(AUTH_MODE_INTERNAL), 62 auth_mode_(AUTH_MODE_INTERNAL),
63 using_oauth_(
64 !CommandLine::ForCurrentProcess()->HasSwitch(
65 switches::kSkipOAuthLogin)),
66 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { 63 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
67 DCHECK(default_performer_ == NULL) 64 DCHECK(default_performer_ == NULL)
68 << "LoginPerformer should have only one instance."; 65 << "LoginPerformer should have only one instance.";
69 default_performer_ = this; 66 default_performer_ = this;
70 } 67 }
71 68
72 LoginPerformer::~LoginPerformer() { 69 LoginPerformer::~LoginPerformer() {
73 DVLOG(1) << "Deleting LoginPerformer"; 70 DVLOG(1) << "Deleting LoginPerformer";
74 DCHECK(default_performer_ != NULL) << "Default instance should exist."; 71 DCHECK(default_performer_ != NULL) << "Default instance should exist.";
75 default_performer_ = NULL; 72 default_performer_ = NULL;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 case Profile::CREATE_STATUS_INITIALIZED: 180 case Profile::CREATE_STATUS_INITIALIZED:
184 break; 181 break;
185 case Profile::CREATE_STATUS_CREATED: 182 case Profile::CREATE_STATUS_CREATED:
186 return; 183 return;
187 case Profile::CREATE_STATUS_FAIL: 184 case Profile::CREATE_STATUS_FAIL:
188 default: 185 default:
189 NOTREACHED(); 186 NOTREACHED();
190 return; 187 return;
191 } 188 }
192 189
193 if (using_oauth_) 190 LoginUtils::Get()->StartTokenServices(profile);
194 LoginUtils::Get()->StartTokenServices(profile);
195 191
196 // Don't unlock screen if it was locked while we're waiting 192 // Don't unlock screen if it was locked while we're waiting
197 // for initial online auth. 193 // for initial online auth.
198 if (ScreenLocker::default_screen_locker() && 194 if (ScreenLocker::default_screen_locker() &&
199 !initial_online_auth_pending_) { 195 !initial_online_auth_pending_) {
200 DVLOG(1) << "Online login OK - unlocking screen."; 196 DVLOG(1) << "Online login OK - unlocking screen.";
201 RequestScreenUnlock(); 197 RequestScreenUnlock();
202 // Do not delete itself just yet, wait for unlock. 198 // Do not delete itself just yet, wait for unlock.
203 // See ResolveScreenUnlocked(). 199 // See ResolveScreenUnlocked().
204 return; 200 return;
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 profile, 555 profile,
560 username_, 556 username_,
561 password_, 557 password_,
562 std::string(), 558 std::string(),
563 std::string())); 559 std::string()));
564 } 560 }
565 password_.clear(); 561 password_.clear();
566 } 562 }
567 563
568 } // namespace chromeos 564 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698