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

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

Issue 12929026: Load sync token upon login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with ToT Created 7 years, 9 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 | chrome/browser/chromeos/login/login_utils.cc » ('j') | 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) 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/logging.h" 10 #include "base/logging.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/prefs/pref_service.h" 13 #include "base/prefs/pref_service.h"
14 #include "base/threading/thread_restrictions.h" 14 #include "base/threading/thread_restrictions.h"
15 #include "base/utf_string_conversions.h" 15 #include "base/utf_string_conversions.h"
16 #include "chrome/browser/browser_process.h" 16 #include "chrome/browser/browser_process.h"
17 #include "chrome/browser/chromeos/boot_times_loader.h" 17 #include "chrome/browser/chromeos/boot_times_loader.h"
18 #include "chrome/browser/chromeos/login/login_utils.h" 18 #include "chrome/browser/chromeos/login/login_utils.h"
19 #include "chrome/browser/chromeos/login/managed/locally_managed_user_login_flow. h"
19 #include "chrome/browser/chromeos/login/screen_locker.h" 20 #include "chrome/browser/chromeos/login/screen_locker.h"
20 #include "chrome/browser/chromeos/login/user_manager.h" 21 #include "chrome/browser/chromeos/login/user_manager.h"
21 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" 22 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h"
22 #include "chrome/browser/chromeos/settings/cros_settings.h" 23 #include "chrome/browser/chromeos/settings/cros_settings.h"
23 #include "chrome/browser/chromeos/settings/cros_settings_names.h" 24 #include "chrome/browser/chromeos/settings/cros_settings_names.h"
24 #include "chrome/browser/policy/browser_policy_connector.h" 25 #include "chrome/browser/policy/browser_policy_connector.h"
25 #include "chrome/browser/profiles/profile.h" 26 #include "chrome/browser/profiles/profile.h"
26 #include "chrome/browser/profiles/profile_manager.h" 27 #include "chrome/browser/profiles/profile_manager.h"
27 #include "chrome/common/chrome_notification_types.h" 28 #include "chrome/common/chrome_notification_types.h"
28 #include "chrome/common/pref_names.h" 29 #include "chrome/common/pref_names.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 LoginAsLocallyManagedUser(UserCredentials(user->email(), 274 LoginAsLocallyManagedUser(UserCredentials(user->email(),
274 password, 275 password,
275 std::string())); // auth_code 276 std::string())); // auth_code
276 } 277 }
277 278
278 void LoginPerformer::LoginAsLocallyManagedUser( 279 void LoginPerformer::LoginAsLocallyManagedUser(
279 const UserCredentials& credentials) { 280 const UserCredentials& credentials) {
280 DCHECK_EQ(UserManager::kLocallyManagedUserDomain, 281 DCHECK_EQ(UserManager::kLocallyManagedUserDomain,
281 gaia::ExtractDomainName(credentials.username)); 282 gaia::ExtractDomainName(credentials.username));
282 // TODO(nkostylev): Check that policy allows locally managed user login. 283 // TODO(nkostylev): Check that policy allows locally managed user login.
284
285 UserManager::Get()->SetUserFlow(credentials.username,
286 new LocallyManagedUserLoginFlow(
287 credentials.username));
283 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); 288 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this);
284 BrowserThread::PostTask( 289 BrowserThread::PostTask(
285 BrowserThread::UI, FROM_HERE, 290 BrowserThread::UI, FROM_HERE,
286 base::Bind(&Authenticator::LoginAsLocallyManagedUser, 291 base::Bind(&Authenticator::LoginAsLocallyManagedUser,
287 authenticator_.get(), 292 authenticator_.get(),
288 credentials)); 293 credentials));
289 } 294 }
290 295
291 void LoginPerformer::LoginRetailMode() { 296 void LoginPerformer::LoginRetailMode() {
292 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); 297 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this);
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 profile, 536 profile,
532 credentials_, 537 credentials_,
533 std::string(), 538 std::string(),
534 std::string())); 539 std::string()));
535 } 540 }
536 credentials_.password.clear(); 541 credentials_.password.clear();
537 credentials_.auth_code.clear(); 542 credentials_.auth_code.clear();
538 } 543 }
539 544
540 } // namespace chromeos 545 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/login_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698