| OLD | NEW |
| 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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 public: | 22 public: |
| 23 UserFlow(); | 23 UserFlow(); |
| 24 virtual ~UserFlow() = 0; | 24 virtual ~UserFlow() = 0; |
| 25 | 25 |
| 26 // Provides ability to alter command line before session has started. | 26 // Provides ability to alter command line before session has started. |
| 27 virtual void AppendAdditionalCommandLineSwitches() = 0; | 27 virtual void AppendAdditionalCommandLineSwitches() = 0; |
| 28 | 28 |
| 29 // Indicates if screen locking should be enabled or disabled for a flow. | 29 // Indicates if screen locking should be enabled or disabled for a flow. |
| 30 virtual bool CanLockScreen() = 0; | 30 virtual bool CanLockScreen() = 0; |
| 31 virtual bool CanStartArc() = 0; | 31 virtual bool CanStartArc() = 0; |
| 32 virtual bool ShouldShowSettings() = 0; | 32 |
| 33 // Whether or not the settings icon should be enabled in the system tray menu. |
| 34 virtual bool ShouldEnableSettings() = 0; |
| 35 |
| 36 // Whether or not the notifications tray should be visible. |
| 33 virtual bool ShouldShowNotificationTray() = 0; | 37 virtual bool ShouldShowNotificationTray() = 0; |
| 38 |
| 34 virtual bool ShouldLaunchBrowser() = 0; | 39 virtual bool ShouldLaunchBrowser() = 0; |
| 35 virtual bool ShouldSkipPostLoginScreens() = 0; | 40 virtual bool ShouldSkipPostLoginScreens() = 0; |
| 36 virtual bool SupportsEarlyRestartToApplyFlags() = 0; | 41 virtual bool SupportsEarlyRestartToApplyFlags() = 0; |
| 37 virtual bool HandleLoginFailure(const AuthFailure& failure) = 0; | 42 virtual bool HandleLoginFailure(const AuthFailure& failure) = 0; |
| 38 virtual void HandleLoginSuccess(const UserContext& context) = 0; | 43 virtual void HandleLoginSuccess(const UserContext& context) = 0; |
| 39 virtual bool HandlePasswordChangeDetected() = 0; | 44 virtual bool HandlePasswordChangeDetected() = 0; |
| 40 virtual void HandleOAuthTokenStatusChange( | 45 virtual void HandleOAuthTokenStatusChange( |
| 41 user_manager::User::OAuthTokenStatus status) = 0; | 46 user_manager::User::OAuthTokenStatus status) = 0; |
| 42 virtual void LaunchExtraSteps(Profile* profile) = 0; | 47 virtual void LaunchExtraSteps(Profile* profile) = 0; |
| 43 void SetHost(LoginDisplayHost* host); | 48 void SetHost(LoginDisplayHost* host); |
| 44 | 49 |
| 45 LoginDisplayHost* host() { | 50 LoginDisplayHost* host() { |
| 46 return host_; | 51 return host_; |
| 47 } | 52 } |
| 48 | 53 |
| 49 private: | 54 private: |
| 50 LoginDisplayHost* host_; | 55 LoginDisplayHost* host_; |
| 51 }; | 56 }; |
| 52 | 57 |
| 53 // UserFlow implementation for regular login flow. | 58 // UserFlow implementation for regular login flow. |
| 54 class DefaultUserFlow : public UserFlow { | 59 class DefaultUserFlow : public UserFlow { |
| 55 public: | 60 public: |
| 56 ~DefaultUserFlow() override; | 61 ~DefaultUserFlow() override; |
| 57 | 62 |
| 63 // UserFlow: |
| 58 void AppendAdditionalCommandLineSwitches() override; | 64 void AppendAdditionalCommandLineSwitches() override; |
| 59 bool CanLockScreen() override; | 65 bool CanLockScreen() override; |
| 60 bool CanStartArc() override; | 66 bool CanStartArc() override; |
| 61 bool ShouldShowSettings() override; | 67 bool ShouldEnableSettings() override; |
| 62 bool ShouldShowNotificationTray() override; | 68 bool ShouldShowNotificationTray() override; |
| 63 bool ShouldLaunchBrowser() override; | 69 bool ShouldLaunchBrowser() override; |
| 64 bool ShouldSkipPostLoginScreens() override; | 70 bool ShouldSkipPostLoginScreens() override; |
| 65 bool SupportsEarlyRestartToApplyFlags() override; | 71 bool SupportsEarlyRestartToApplyFlags() override; |
| 66 bool HandleLoginFailure(const AuthFailure& failure) override; | 72 bool HandleLoginFailure(const AuthFailure& failure) override; |
| 67 void HandleLoginSuccess(const UserContext& context) override; | 73 void HandleLoginSuccess(const UserContext& context) override; |
| 68 bool HandlePasswordChangeDetected() override; | 74 bool HandlePasswordChangeDetected() override; |
| 69 void HandleOAuthTokenStatusChange( | 75 void HandleOAuthTokenStatusChange( |
| 70 user_manager::User::OAuthTokenStatus status) override; | 76 user_manager::User::OAuthTokenStatus status) override; |
| 71 void LaunchExtraSteps(Profile* profile) override; | 77 void LaunchExtraSteps(Profile* profile) override; |
| 72 }; | 78 }; |
| 73 | 79 |
| 74 // UserFlow stub for non-regular flows. | 80 // UserFlow stub for non-regular flows. |
| 75 class ExtendedUserFlow : public UserFlow { | 81 class ExtendedUserFlow : public UserFlow { |
| 76 public: | 82 public: |
| 77 explicit ExtendedUserFlow(const AccountId& account_id); | 83 explicit ExtendedUserFlow(const AccountId& account_id); |
| 78 ~ExtendedUserFlow() override; | 84 ~ExtendedUserFlow() override; |
| 79 | 85 |
| 86 // UserFlow: |
| 80 void AppendAdditionalCommandLineSwitches() override; | 87 void AppendAdditionalCommandLineSwitches() override; |
| 81 bool ShouldShowSettings() override; | 88 bool ShouldEnableSettings() override; |
| 82 bool ShouldShowNotificationTray() override; | 89 bool ShouldShowNotificationTray() override; |
| 83 void HandleOAuthTokenStatusChange( | 90 void HandleOAuthTokenStatusChange( |
| 84 user_manager::User::OAuthTokenStatus status) override; | 91 user_manager::User::OAuthTokenStatus status) override; |
| 85 | 92 |
| 86 protected: | 93 protected: |
| 87 // Subclasses can call this method to unregister flow in the next event. | 94 // Subclasses can call this method to unregister flow in the next event. |
| 88 virtual void UnregisterFlowSoon(); | 95 virtual void UnregisterFlowSoon(); |
| 89 const AccountId& account_id() { return account_id_; } | 96 const AccountId& account_id() { return account_id_; } |
| 90 | 97 |
| 91 private: | 98 private: |
| 92 const AccountId account_id_; | 99 const AccountId account_id_; |
| 93 }; | 100 }; |
| 94 | 101 |
| 95 } // namespace chromeos | 102 } // namespace chromeos |
| 96 | 103 |
| 97 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_FLOW_H_ | 104 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_FLOW_H_ |
| OLD | NEW |