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)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 ShouldShowSettings()27bool DefaultUserFlow::ShouldShowSettings() { 28 return true; 29 } 30 ShouldLaunchBrowser()31bool DefaultUserFlow::ShouldLaunchBrowser() { 32 return true; 33 } 34 ShouldSkipPostLoginScreens()35bool DefaultUserFlow::ShouldSkipPostLoginScreens() { 36 return false; 37 } 38 HandleLoginFailure(const LoginFailure & failure)39bool DefaultUserFlow::HandleLoginFailure(const LoginFailure& failure) { 40 return false; 41 } 42 HandlePasswordChangeDetected()43bool DefaultUserFlow::HandlePasswordChangeDetected() { 44 return false; 45 } 46 HandleOAuthTokenStatusChange(User::OAuthTokenStatus status)47void DefaultUserFlow::HandleOAuthTokenStatusChange( 48 User::OAuthTokenStatus status) { 49 } 50 LaunchExtraSteps(Profile * profile)51void DefaultUserFlow::LaunchExtraSteps(Profile* profile) { 52 } 53 ExtendedUserFlow(const std::string & user_id)54ExtendedUserFlow::ExtendedUserFlow(const std::string& user_id) 55 : user_id_(user_id) { 56 } 57 ~ExtendedUserFlow()58ExtendedUserFlow::~ExtendedUserFlow() { 59 } 60 ShouldShowSettings()61bool ExtendedUserFlow::ShouldShowSettings() { 62 return true; 63 } 64 UnregisterFlowSoon()65void 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