| OLD | NEW |
| 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 { | 13 namespace { |
| 14 | 14 |
| 15 void UnregisterFlow(const std::string& user_id) { | 15 void UnregisterFlow(const AccountId& account_id) { |
| 16 ChromeUserManager::Get()->ResetUserFlow(AccountId::FromUserEmail(user_id)); | 16 ChromeUserManager::Get()->ResetUserFlow(account_id); |
| 17 } | 17 } |
| 18 | 18 |
| 19 } // namespace | 19 } // namespace |
| 20 | 20 |
| 21 | 21 |
| 22 UserFlow::UserFlow() : host_(NULL) {} | 22 UserFlow::UserFlow() : host_(NULL) {} |
| 23 | 23 |
| 24 UserFlow::~UserFlow() {} | 24 UserFlow::~UserFlow() {} |
| 25 | 25 |
| 26 void UserFlow::SetHost(LoginDisplayHost* host) { | 26 void UserFlow::SetHost(LoginDisplayHost* host) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 return false; | 63 return false; |
| 64 } | 64 } |
| 65 | 65 |
| 66 void DefaultUserFlow::HandleOAuthTokenStatusChange( | 66 void DefaultUserFlow::HandleOAuthTokenStatusChange( |
| 67 user_manager::User::OAuthTokenStatus status) { | 67 user_manager::User::OAuthTokenStatus status) { |
| 68 } | 68 } |
| 69 | 69 |
| 70 void DefaultUserFlow::LaunchExtraSteps(Profile* profile) { | 70 void DefaultUserFlow::LaunchExtraSteps(Profile* profile) { |
| 71 } | 71 } |
| 72 | 72 |
| 73 ExtendedUserFlow::ExtendedUserFlow(const std::string& user_id) | 73 ExtendedUserFlow::ExtendedUserFlow(const AccountId& account_id) |
| 74 : user_id_(user_id) { | 74 : account_id_(account_id) {} |
| 75 } | |
| 76 | 75 |
| 77 ExtendedUserFlow::~ExtendedUserFlow() { | 76 ExtendedUserFlow::~ExtendedUserFlow() { |
| 78 } | 77 } |
| 79 | 78 |
| 80 void ExtendedUserFlow::AppendAdditionalCommandLineSwitches() { | 79 void ExtendedUserFlow::AppendAdditionalCommandLineSwitches() { |
| 81 } | 80 } |
| 82 | 81 |
| 83 bool ExtendedUserFlow::ShouldShowSettings() { | 82 bool ExtendedUserFlow::ShouldShowSettings() { |
| 84 return true; | 83 return true; |
| 85 } | 84 } |
| 86 | 85 |
| 87 void ExtendedUserFlow::HandleOAuthTokenStatusChange( | 86 void ExtendedUserFlow::HandleOAuthTokenStatusChange( |
| 88 user_manager::User::OAuthTokenStatus status) { | 87 user_manager::User::OAuthTokenStatus status) { |
| 89 } | 88 } |
| 90 | 89 |
| 91 void ExtendedUserFlow::UnregisterFlowSoon() { | 90 void ExtendedUserFlow::UnregisterFlowSoon() { |
| 92 std::string id_copy(user_id()); | 91 base::MessageLoop::current()->PostTask( |
| 93 base::MessageLoop::current()->PostTask(FROM_HERE, | 92 FROM_HERE, base::Bind(&UnregisterFlow, account_id())); |
| 94 base::Bind(&UnregisterFlow, | |
| 95 id_copy)); | |
| 96 } | 93 } |
| 97 | 94 |
| 98 } // namespace chromeos | 95 } // namespace chromeos |
| OLD | NEW |