Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / chromeos / login / user_flow.cc
blobbff2445fd556f962b6ee17c5fdc758fca4564f71
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 // TODO(antrim): remove this output once crash reason is found.
27 LOG(ERROR) << "Flow " << this << " got host " << host;
28 host_ = host;
31 DefaultUserFlow::~DefaultUserFlow() {}
33 void DefaultUserFlow::AppendAdditionalCommandLineSwitches() {
36 bool DefaultUserFlow::CanLockScreen() {
37 return true;
40 bool DefaultUserFlow::ShouldShowSettings() {
41 return true;
44 bool DefaultUserFlow::ShouldLaunchBrowser() {
45 return true;
48 bool DefaultUserFlow::ShouldSkipPostLoginScreens() {
49 return false;
52 bool DefaultUserFlow::SupportsEarlyRestartToApplyFlags() {
53 return true;
56 bool DefaultUserFlow::HandleLoginFailure(const AuthFailure& failure) {
57 return false;
60 void DefaultUserFlow::HandleLoginSuccess(const UserContext& context) {}
62 bool DefaultUserFlow::HandlePasswordChangeDetected() {
63 return false;
66 void DefaultUserFlow::HandleOAuthTokenStatusChange(
67 user_manager::User::OAuthTokenStatus status) {
70 void DefaultUserFlow::LaunchExtraSteps(Profile* profile) {
73 ExtendedUserFlow::ExtendedUserFlow(const std::string& user_id)
74 : user_id_(user_id) {
77 ExtendedUserFlow::~ExtendedUserFlow() {
80 void ExtendedUserFlow::AppendAdditionalCommandLineSwitches() {
83 bool ExtendedUserFlow::ShouldShowSettings() {
84 return true;
87 void ExtendedUserFlow::HandleOAuthTokenStatusChange(
88 user_manager::User::OAuthTokenStatus status) {
91 void ExtendedUserFlow::UnregisterFlowSoon() {
92 std::string id_copy(user_id());
93 base::MessageLoop::current()->PostTask(FROM_HERE,
94 base::Bind(&UnregisterFlow,
95 id_copy));
98 } // namespace chromeos