• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
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/user_manager.h"
9 
10 namespace chromeos {
11 
12 namespace {
13 
UnregisterFlow(const std::string & user_id)14 void UnregisterFlow(const std::string& user_id) {
15   UserManager::Get()->ResetUserFlow(user_id);
16 }
17 
18 } // namespace
19 
20 
UserFlow()21 UserFlow::UserFlow() : host_(NULL) {}
22 
~UserFlow()23 UserFlow::~UserFlow() {}
24 
~DefaultUserFlow()25 DefaultUserFlow::~DefaultUserFlow() {}
26 
ShouldShowSettings()27 bool DefaultUserFlow::ShouldShowSettings() {
28   return true;
29 }
30 
ShouldLaunchBrowser()31 bool DefaultUserFlow::ShouldLaunchBrowser() {
32   return true;
33 }
34 
ShouldSkipPostLoginScreens()35 bool DefaultUserFlow::ShouldSkipPostLoginScreens() {
36   return false;
37 }
38 
HandleLoginFailure(const LoginFailure & failure)39 bool DefaultUserFlow::HandleLoginFailure(const LoginFailure& failure) {
40   return false;
41 }
42 
HandlePasswordChangeDetected()43 bool DefaultUserFlow::HandlePasswordChangeDetected() {
44   return false;
45 }
46 
HandleOAuthTokenStatusChange(User::OAuthTokenStatus status)47 void DefaultUserFlow::HandleOAuthTokenStatusChange(
48     User::OAuthTokenStatus status) {
49 }
50 
LaunchExtraSteps(Profile * profile)51 void DefaultUserFlow::LaunchExtraSteps(Profile* profile) {
52 }
53 
ExtendedUserFlow(const std::string & user_id)54 ExtendedUserFlow::ExtendedUserFlow(const std::string& user_id)
55     : user_id_(user_id) {
56 }
57 
~ExtendedUserFlow()58 ExtendedUserFlow::~ExtendedUserFlow() {
59 }
60 
ShouldShowSettings()61 bool ExtendedUserFlow::ShouldShowSettings() {
62   return true;
63 }
64 
UnregisterFlowSoon()65 void ExtendedUserFlow::UnregisterFlowSoon() {
66   std::string id_copy(user_id());
67   base::MessageLoop::current()->PostTask(FROM_HERE,
68       base::Bind(&UnregisterFlow,
69                  id_copy));
70 }
71 
72 }  // namespace chromeos
73