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

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

Issue 1494153002: This CL replaces e-mail with AccountId in easy signin code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bugfix in original easy unlock code' Created 5 years 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
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "chrome/browser/chromeos/login/user_flow.h" 7 #include "chrome/browser/chromeos/login/user_flow.h"
8 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" 8 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
9 #include "components/signin/core/account_id/account_id.h" 9 #include "components/signin/core/account_id/account_id.h"
10 10
11 namespace chromeos { 11 namespace chromeos {
12 12
13 namespace {
14
15 void UnregisterFlow(const std::string& user_id) {
16 ChromeUserManager::Get()->ResetUserFlow(AccountId::FromUserEmail(user_id));
17 }
18
19 } // namespace
20
21
22 UserFlow::UserFlow() : host_(NULL) {} 13 UserFlow::UserFlow() : host_(NULL) {}
23 14
24 UserFlow::~UserFlow() {} 15 UserFlow::~UserFlow() {}
25 16
26 void UserFlow::SetHost(LoginDisplayHost* host) { 17 void UserFlow::SetHost(LoginDisplayHost* host) {
27 VLOG(1) << "Flow " << this << " got host " << host; 18 VLOG(1) << "Flow " << this << " got host " << host;
28 host_ = host; 19 host_ = host;
29 } 20 }
30 21
31 DefaultUserFlow::~DefaultUserFlow() {} 22 DefaultUserFlow::~DefaultUserFlow() {}
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return false; 54 return false;
64 } 55 }
65 56
66 void DefaultUserFlow::HandleOAuthTokenStatusChange( 57 void DefaultUserFlow::HandleOAuthTokenStatusChange(
67 user_manager::User::OAuthTokenStatus status) { 58 user_manager::User::OAuthTokenStatus status) {
68 } 59 }
69 60
70 void DefaultUserFlow::LaunchExtraSteps(Profile* profile) { 61 void DefaultUserFlow::LaunchExtraSteps(Profile* profile) {
71 } 62 }
72 63
73 ExtendedUserFlow::ExtendedUserFlow(const std::string& user_id) 64 ExtendedUserFlow::ExtendedUserFlow(const AccountId& account_id)
74 : user_id_(user_id) { 65 : account_id_(account_id) {}
75 }
76 66
77 ExtendedUserFlow::~ExtendedUserFlow() { 67 ExtendedUserFlow::~ExtendedUserFlow() {
78 } 68 }
79 69
80 void ExtendedUserFlow::AppendAdditionalCommandLineSwitches() { 70 void ExtendedUserFlow::AppendAdditionalCommandLineSwitches() {
81 } 71 }
82 72
83 bool ExtendedUserFlow::ShouldShowSettings() { 73 bool ExtendedUserFlow::ShouldShowSettings() {
84 return true; 74 return true;
85 } 75 }
86 76
87 void ExtendedUserFlow::HandleOAuthTokenStatusChange( 77 void ExtendedUserFlow::HandleOAuthTokenStatusChange(
88 user_manager::User::OAuthTokenStatus status) { 78 user_manager::User::OAuthTokenStatus status) {
89 } 79 }
90 80
91 void ExtendedUserFlow::UnregisterFlowSoon() { 81 void ExtendedUserFlow::UnregisterFlowSoon() {
92 std::string id_copy(user_id()); 82 base::MessageLoop::current()->PostTask(
93 base::MessageLoop::current()->PostTask(FROM_HERE, 83 FROM_HERE,
94 base::Bind(&UnregisterFlow, 84 base::Bind(&ChromeUserManager::ResetUserFlow,
95 id_copy)); 85 base::Unretained(ChromeUserManager::Get()), account_id()));
96 } 86 }
97 87
98 } // namespace chromeos 88 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user_flow.h ('k') | chrome/browser/chromeos/login/users/chrome_user_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698