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" |
| 11 #include "components/signin/core/account_id/account_id.h" |
11 #include "components/user_manager/user.h" | 12 #include "components/user_manager/user.h" |
12 | 13 |
13 namespace chromeos { | 14 namespace chromeos { |
14 | 15 |
15 class UserContext; | 16 class UserContext; |
16 | 17 |
17 class LoginDisplayHost; | 18 class LoginDisplayHost; |
18 // Defines possible variants of user flow upon logging in. | 19 // Defines possible variants of user flow upon logging in. |
19 // See UserManager::SetUserFlow for usage contract. | 20 // See UserManager::SetUserFlow for usage contract. |
20 class UserFlow { | 21 class UserFlow { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 void HandleLoginSuccess(const UserContext& context) override; | 63 void HandleLoginSuccess(const UserContext& context) override; |
63 bool HandlePasswordChangeDetected() override; | 64 bool HandlePasswordChangeDetected() override; |
64 void HandleOAuthTokenStatusChange( | 65 void HandleOAuthTokenStatusChange( |
65 user_manager::User::OAuthTokenStatus status) override; | 66 user_manager::User::OAuthTokenStatus status) override; |
66 void LaunchExtraSteps(Profile* profile) override; | 67 void LaunchExtraSteps(Profile* profile) override; |
67 }; | 68 }; |
68 | 69 |
69 // UserFlow stub for non-regular flows. | 70 // UserFlow stub for non-regular flows. |
70 class ExtendedUserFlow : public UserFlow { | 71 class ExtendedUserFlow : public UserFlow { |
71 public: | 72 public: |
72 explicit ExtendedUserFlow(const std::string& user_id); | 73 explicit ExtendedUserFlow(const AccountId& account_id); |
73 ~ExtendedUserFlow() override; | 74 ~ExtendedUserFlow() override; |
74 | 75 |
75 void AppendAdditionalCommandLineSwitches() override; | 76 void AppendAdditionalCommandLineSwitches() override; |
76 bool ShouldShowSettings() override; | 77 bool ShouldShowSettings() override; |
77 void HandleOAuthTokenStatusChange( | 78 void HandleOAuthTokenStatusChange( |
78 user_manager::User::OAuthTokenStatus status) override; | 79 user_manager::User::OAuthTokenStatus status) override; |
79 | 80 |
80 protected: | 81 protected: |
81 // Subclasses can call this method to unregister flow in the next event. | 82 // Subclasses can call this method to unregister flow in the next event. |
82 virtual void UnregisterFlowSoon(); | 83 virtual void UnregisterFlowSoon(); |
83 std::string user_id() { | 84 const AccountId& account_id() { return account_id_; } |
84 return user_id_; | |
85 } | |
86 | 85 |
87 private: | 86 private: |
88 std::string user_id_; | 87 const AccountId account_id_; |
89 }; | 88 }; |
90 | 89 |
91 } // namespace chromeos | 90 } // namespace chromeos |
92 | 91 |
93 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_FLOW_H_ | 92 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_FLOW_H_ |
OLD | NEW |