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
3 // found in the LICENSE file.
6 #include "base/message_loop/message_loop.h"
7 #include "chrome/browser/chromeos/login/user_flow.h"
8 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
14 void UnregisterFlow(const std::string
& user_id
) {
15 ChromeUserManager::Get()->ResetUserFlow(user_id
);
21 UserFlow::UserFlow() : host_(NULL
) {}
23 UserFlow::~UserFlow() {}
25 void UserFlow::SetHost(LoginDisplayHost
* host
) {
26 // TODO(antrim): remove this output once crash reason is found.
27 LOG(ERROR
) << "Flow " << this << " got host " << host
;
31 DefaultUserFlow::~DefaultUserFlow() {}
33 void DefaultUserFlow::AppendAdditionalCommandLineSwitches() {
36 bool DefaultUserFlow::CanLockScreen() {
40 bool DefaultUserFlow::ShouldShowSettings() {
44 bool DefaultUserFlow::ShouldLaunchBrowser() {
48 bool DefaultUserFlow::ShouldSkipPostLoginScreens() {
52 bool DefaultUserFlow::SupportsEarlyRestartToApplyFlags() {
56 bool DefaultUserFlow::HandleLoginFailure(const AuthFailure
& failure
) {
60 void DefaultUserFlow::HandleLoginSuccess(const UserContext
& context
) {}
62 bool DefaultUserFlow::HandlePasswordChangeDetected() {
66 void DefaultUserFlow::HandleOAuthTokenStatusChange(
67 user_manager::User::OAuthTokenStatus status
) {
70 void DefaultUserFlow::LaunchExtraSteps(Profile
* profile
) {
73 ExtendedUserFlow::ExtendedUserFlow(const std::string
& user_id
)
77 ExtendedUserFlow::~ExtendedUserFlow() {
80 void ExtendedUserFlow::AppendAdditionalCommandLineSwitches() {
83 bool ExtendedUserFlow::ShouldShowSettings() {
87 void ExtendedUserFlow::HandleOAuthTokenStatusChange(
88 user_manager::User::OAuthTokenStatus status
) {
91 void ExtendedUserFlow::UnregisterFlowSoon() {
92 std::string
id_copy(user_id());
93 base::MessageLoop::current()->PostTask(FROM_HERE
,
94 base::Bind(&UnregisterFlow
,
98 } // namespace chromeos