Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(802)

Side by Side Diff: chrome/browser/chromeos/login/user_flow.h

Issue 656283002: [session_manager] Move user session initialization code out of ExistingUserController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move first run session init and browser launch out of EUC Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_FLOW_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_FLOW_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_FLOW_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_FLOW_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chromeos/login/auth/auth_status_consumer.h" 10 #include "chromeos/login/auth/auth_status_consumer.h"
11 #include "components/user_manager/user.h" 11 #include "components/user_manager/user.h"
12 12
13 namespace chromeos { 13 namespace chromeos {
14 14
15 class UserContext; 15 class UserContext;
16 16
17 class LoginDisplayHost; 17 class LoginDisplayHost;
18 // Defines possible variants of user flow upon logging in. 18 // Defines possible variants of user flow upon logging in.
19 // See UserManager::SetUserFlow for usage contract. 19 // See UserManager::SetUserFlow for usage contract.
20 class UserFlow { 20 class UserFlow {
21 public: 21 public:
22 UserFlow(); 22 UserFlow();
23 virtual ~UserFlow() = 0; 23 virtual ~UserFlow() = 0;
24
25 // Provides ability to alter command line before session has started.
26 virtual void AppendAdditionalCommandLineSwitches() = 0;
27
24 // Indicates if screen locking should be enabled or disabled for a flow. 28 // Indicates if screen locking should be enabled or disabled for a flow.
25 virtual bool CanLockScreen() = 0; 29 virtual bool CanLockScreen() = 0;
30
Denis Kuznetsov (DE-MUC) 2014/10/16 12:21:42 Do we need empty line here?
Nikita (slow) 2014/10/17 13:17:41 Done.
26 virtual bool ShouldShowSettings() = 0; 31 virtual bool ShouldShowSettings() = 0;
27 virtual bool ShouldLaunchBrowser() = 0; 32 virtual bool ShouldLaunchBrowser() = 0;
28 virtual bool ShouldSkipPostLoginScreens() = 0; 33 virtual bool ShouldSkipPostLoginScreens() = 0;
29 virtual bool HandleLoginFailure(const AuthFailure& failure) = 0; 34 virtual bool HandleLoginFailure(const AuthFailure& failure) = 0;
30 virtual void HandleLoginSuccess(const UserContext& context) = 0; 35 virtual void HandleLoginSuccess(const UserContext& context) = 0;
31 virtual bool HandlePasswordChangeDetected() = 0; 36 virtual bool HandlePasswordChangeDetected() = 0;
32 virtual void HandleOAuthTokenStatusChange( 37 virtual void HandleOAuthTokenStatusChange(
33 user_manager::User::OAuthTokenStatus status) = 0; 38 user_manager::User::OAuthTokenStatus status) = 0;
34 virtual void LaunchExtraSteps(Profile* profile) = 0; 39 virtual void LaunchExtraSteps(Profile* profile) = 0;
35 40
36 void set_host(LoginDisplayHost* host) { 41 void set_host(LoginDisplayHost* host) {
37 host_ = host; 42 host_ = host;
38 } 43 }
39 44
40 LoginDisplayHost* host() { 45 LoginDisplayHost* host() {
41 return host_; 46 return host_;
42 } 47 }
43 48
44 private: 49 private:
45 LoginDisplayHost* host_; 50 LoginDisplayHost* host_;
46 }; 51 };
47 52
48 // UserFlow implementation for regular login flow. 53 // UserFlow implementation for regular login flow.
49 class DefaultUserFlow : public UserFlow { 54 class DefaultUserFlow : public UserFlow {
50 public: 55 public:
51 virtual ~DefaultUserFlow(); 56 virtual ~DefaultUserFlow();
52 57
58 virtual void AppendAdditionalCommandLineSwitches() override;
53 virtual bool CanLockScreen() override; 59 virtual bool CanLockScreen() override;
54 virtual bool ShouldShowSettings() override; 60 virtual bool ShouldShowSettings() override;
55 virtual bool ShouldLaunchBrowser() override; 61 virtual bool ShouldLaunchBrowser() override;
56 virtual bool ShouldSkipPostLoginScreens() override; 62 virtual bool ShouldSkipPostLoginScreens() override;
57 virtual bool HandleLoginFailure(const AuthFailure& failure) override; 63 virtual bool HandleLoginFailure(const AuthFailure& failure) override;
58 virtual void HandleLoginSuccess(const UserContext& context) override; 64 virtual void HandleLoginSuccess(const UserContext& context) override;
59 virtual bool HandlePasswordChangeDetected() override; 65 virtual bool HandlePasswordChangeDetected() override;
60 virtual void HandleOAuthTokenStatusChange( 66 virtual void HandleOAuthTokenStatusChange(
61 user_manager::User::OAuthTokenStatus status) override; 67 user_manager::User::OAuthTokenStatus status) override;
62 virtual void LaunchExtraSteps(Profile* profile) override; 68 virtual void LaunchExtraSteps(Profile* profile) override;
63 }; 69 };
64 70
65 // UserFlow stub for non-regular flows. 71 // UserFlow stub for non-regular flows.
66 class ExtendedUserFlow : public UserFlow { 72 class ExtendedUserFlow : public UserFlow {
67 public: 73 public:
68 explicit ExtendedUserFlow(const std::string& user_id); 74 explicit ExtendedUserFlow(const std::string& user_id);
69 virtual ~ExtendedUserFlow(); 75 virtual ~ExtendedUserFlow();
70 76
77 virtual void AppendAdditionalCommandLineSwitches() override;
71 virtual bool ShouldShowSettings() override; 78 virtual bool ShouldShowSettings() override;
79 virtual void HandleOAuthTokenStatusChange(
80 user_manager::User::OAuthTokenStatus status) override;
72 81
73 protected: 82 protected:
74 // Subclasses can call this method to unregister flow in the next event. 83 // Subclasses can call this method to unregister flow in the next event.
75 virtual void UnregisterFlowSoon(); 84 virtual void UnregisterFlowSoon();
76 std::string user_id() { 85 std::string user_id() {
77 return user_id_; 86 return user_id_;
78 } 87 }
79 88
80 private: 89 private:
81 std::string user_id_; 90 std::string user_id_;
82 }; 91 };
83 92
84 } // namespace chromeos 93 } // namespace chromeos
85 94
86 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_FLOW_H_ 95 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_FLOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698