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)14void UnregisterFlow(const std::string& user_id) { 15 UserManager::Get()->ResetUserFlow(user_id); 16 } 17 18 } // namespace 19 20 UserFlow()21UserFlow::UserFlow() : host_(NULL) {} 22 ~UserFlow()23UserFlow::~UserFlow() {} 24 ~DefaultUserFlow()25DefaultUserFlow::~DefaultUserFlow() {} 26 CanLockScreen()27bool DefaultUserFlow::CanLockScreen() { 28 return true; 29 } 30 ShouldShowSettings()31bool DefaultUserFlow::ShouldShowSettings() { 32 return true; 33 } 34 ShouldLaunchBrowser()35bool DefaultUserFlow::ShouldLaunchBrowser() { 36 return true; 37 } 38 ShouldSkipPostLoginScreens()39bool DefaultUserFlow::ShouldSkipPostLoginScreens() { 40 return false; 41 } 42 HandleLoginFailure(const LoginFailure & failure)43bool DefaultUserFlow::HandleLoginFailure(const LoginFailure& failure) { 44 return false; 45 } 46 HandleLoginSuccess(const UserContext & context)47void DefaultUserFlow::HandleLoginSuccess(const UserContext& context) {} 48 HandlePasswordChangeDetected()49bool DefaultUserFlow::HandlePasswordChangeDetected() { 50 return false; 51 } 52 HandleOAuthTokenStatusChange(User::OAuthTokenStatus status)53void DefaultUserFlow::HandleOAuthTokenStatusChange( 54 User::OAuthTokenStatus status) { 55 } 56 LaunchExtraSteps(Profile * profile)57void DefaultUserFlow::LaunchExtraSteps(Profile* profile) { 58 } 59 ExtendedUserFlow(const std::string & user_id)60ExtendedUserFlow::ExtendedUserFlow(const std::string& user_id) 61 : user_id_(user_id) { 62 } 63 ~ExtendedUserFlow()64ExtendedUserFlow::~ExtendedUserFlow() { 65 } 66 ShouldShowSettings()67bool ExtendedUserFlow::ShouldShowSettings() { 68 return true; 69 } 70 UnregisterFlowSoon()71void 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