• 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/users/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 
CanLockScreen()27 bool DefaultUserFlow::CanLockScreen() {
28   return true;
29 }
30 
ShouldShowSettings()31 bool DefaultUserFlow::ShouldShowSettings() {
32   return true;
33 }
34 
ShouldLaunchBrowser()35 bool DefaultUserFlow::ShouldLaunchBrowser() {
36   return true;
37 }
38 
ShouldSkipPostLoginScreens()39 bool DefaultUserFlow::ShouldSkipPostLoginScreens() {
40   return false;
41 }
42 
HandleLoginFailure(const LoginFailure & failure)43 bool DefaultUserFlow::HandleLoginFailure(const LoginFailure& failure) {
44   return false;
45 }
46 
HandleLoginSuccess(const UserContext & context)47 void DefaultUserFlow::HandleLoginSuccess(const UserContext& context) {}
48 
HandlePasswordChangeDetected()49 bool DefaultUserFlow::HandlePasswordChangeDetected() {
50   return false;
51 }
52 
HandleOAuthTokenStatusChange(User::OAuthTokenStatus status)53 void DefaultUserFlow::HandleOAuthTokenStatusChange(
54     User::OAuthTokenStatus status) {
55 }
56 
LaunchExtraSteps(Profile * profile)57 void DefaultUserFlow::LaunchExtraSteps(Profile* profile) {
58 }
59 
ExtendedUserFlow(const std::string & user_id)60 ExtendedUserFlow::ExtendedUserFlow(const std::string& user_id)
61     : user_id_(user_id) {
62 }
63 
~ExtendedUserFlow()64 ExtendedUserFlow::~ExtendedUserFlow() {
65 }
66 
ShouldShowSettings()67 bool ExtendedUserFlow::ShouldShowSettings() {
68   return true;
69 }
70 
UnregisterFlowSoon()71 void ExtendedUserFlow::UnregisterFlowSoon() {
72   std::string id_copy(user_id());
73   base::MessageLoop::current()->PostTask(FROM_HERE,
74       base::Bind(&UnregisterFlow,
75                  id_copy));
76 }
77 
78 }  // namespace chromeos
79