Elim cr-checkbox
[chromium-blink-merge.git] / chrome / browser / chromeos / login / user_flow.cc
blob7f48e1b1c1375f39c8c17108da2e7b59bea47d50
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.
5 #include "base/bind.h"
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"
10 namespace chromeos {
12 namespace {
14 void UnregisterFlow(const std::string& user_id) {
15 ChromeUserManager::Get()->ResetUserFlow(user_id);
18 } // namespace
21 UserFlow::UserFlow() : host_(NULL) {}
23 UserFlow::~UserFlow() {}
25 void UserFlow::SetHost(LoginDisplayHost* host) {
26 VLOG(1) << "Flow " << this << " got host " << host;
27 host_ = host;
30 DefaultUserFlow::~DefaultUserFlow() {}
32 void DefaultUserFlow::AppendAdditionalCommandLineSwitches() {
35 bool DefaultUserFlow::CanLockScreen() {
36 return true;
39 bool DefaultUserFlow::ShouldShowSettings() {
40 return true;
43 bool DefaultUserFlow::ShouldLaunchBrowser() {
44 return true;
47 bool DefaultUserFlow::ShouldSkipPostLoginScreens() {
48 return false;
51 bool DefaultUserFlow::SupportsEarlyRestartToApplyFlags() {
52 return true;
55 bool DefaultUserFlow::HandleLoginFailure(const AuthFailure& failure) {
56 return false;
59 void DefaultUserFlow::HandleLoginSuccess(const UserContext& context) {}
61 bool DefaultUserFlow::HandlePasswordChangeDetected() {
62 return false;
65 void DefaultUserFlow::HandleOAuthTokenStatusChange(
66 user_manager::User::OAuthTokenStatus status) {
69 void DefaultUserFlow::LaunchExtraSteps(Profile* profile) {
72 ExtendedUserFlow::ExtendedUserFlow(const std::string& user_id)
73 : user_id_(user_id) {
76 ExtendedUserFlow::~ExtendedUserFlow() {
79 void ExtendedUserFlow::AppendAdditionalCommandLineSwitches() {
82 bool ExtendedUserFlow::ShouldShowSettings() {
83 return true;
86 void ExtendedUserFlow::HandleOAuthTokenStatusChange(
87 user_manager::User::OAuthTokenStatus status) {
90 void ExtendedUserFlow::UnregisterFlowSoon() {
91 std::string id_copy(user_id());
92 base::MessageLoop::current()->PostTask(FROM_HERE,
93 base::Bind(&UnregisterFlow,
94 id_copy));
97 } // namespace chromeos