OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_UI_LOGIN_DISPLAY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "chrome/browser/chromeos/login/help_app_launcher.h" | 13 #include "chrome/browser/chromeos/login/help_app_launcher.h" |
14 #include "chrome/browser/chromeos/login/signin_specifics.h" | 14 #include "chrome/browser/chromeos/login/signin_specifics.h" |
15 #include "components/user_manager/user.h" | 15 #include "components/user_manager/user.h" |
16 #include "components/user_manager/user_manager.h" | 16 #include "components/user_manager/user_manager.h" |
17 #include "ui/gfx/geometry/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
18 #include "ui/gfx/image/image.h" | 18 #include "ui/gfx/image/image.h" |
19 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" |
20 | 20 |
| 21 namespace user_manager { |
| 22 class UserID; |
| 23 } // namespace user_manager |
| 24 |
21 namespace chromeos { | 25 namespace chromeos { |
22 | 26 |
23 class UserContext; | 27 class UserContext; |
24 | 28 |
25 // TODO(nkostylev): Extract interface, create a BaseLoginDisplay class. | 29 // TODO(nkostylev): Extract interface, create a BaseLoginDisplay class. |
26 // An abstract class that defines login UI implementation. | 30 // An abstract class that defines login UI implementation. |
27 class LoginDisplay { | 31 class LoginDisplay { |
28 public: | 32 public: |
29 // Sign in error IDs that require detailed error screen and not just | 33 // Sign in error IDs that require detailed error screen and not just |
30 // a simple error bubble. | 34 // a simple error bubble. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // |login_attempts| shows number of login attempts made by current user. | 126 // |login_attempts| shows number of login attempts made by current user. |
123 // |help_topic_id| is additional help topic that is presented as link. | 127 // |help_topic_id| is additional help topic that is presented as link. |
124 virtual void ShowError(int error_msg_id, | 128 virtual void ShowError(int error_msg_id, |
125 int login_attempts, | 129 int login_attempts, |
126 HelpAppLauncher::HelpTopic help_topic_id) = 0; | 130 HelpAppLauncher::HelpTopic help_topic_id) = 0; |
127 | 131 |
128 // Displays detailed error screen for error with ID |error_id|. | 132 // Displays detailed error screen for error with ID |error_id|. |
129 virtual void ShowErrorScreen(LoginDisplay::SigninError error_id) = 0; | 133 virtual void ShowErrorScreen(LoginDisplay::SigninError error_id) = 0; |
130 | 134 |
131 // Proceed with Gaia flow because password has changed. | 135 // Proceed with Gaia flow because password has changed. |
132 virtual void ShowGaiaPasswordChanged(const std::string& username) = 0; | 136 virtual void ShowGaiaPasswordChanged(const user_manager::UserID& user_id) = 0; |
133 | 137 |
134 // Show password changed dialog. If |show_password_error| is not null | 138 // Show password changed dialog. If |show_password_error| is not null |
135 // user already tried to enter old password but it turned out to be incorrect. | 139 // user already tried to enter old password but it turned out to be incorrect. |
136 virtual void ShowPasswordChangedDialog(bool show_password_error, | 140 virtual void ShowPasswordChangedDialog(bool show_password_error, |
137 const std::string& email) = 0; | 141 const user_manager::UserID& user_id) =
0; |
138 | 142 |
139 // Shows signin UI with specified email. | 143 // Shows signin UI with specified UserID. |
140 virtual void ShowSigninUI(const std::string& email) = 0; | 144 virtual void ShowSigninUI(const user_manager::UserID& user_id) = 0; |
141 | 145 |
142 // Show whitelist check failed error. Happens after user completes online | 146 // Show whitelist check failed error. Happens after user completes online |
143 // signin but whitelist check fails. | 147 // signin but whitelist check fails. |
144 virtual void ShowWhitelistCheckFailedError() = 0; | 148 virtual void ShowWhitelistCheckFailedError() = 0; |
145 | 149 |
146 gfx::Rect background_bounds() const { return background_bounds_; } | 150 gfx::Rect background_bounds() const { return background_bounds_; } |
147 void set_background_bounds(const gfx::Rect& background_bounds) { | 151 void set_background_bounds(const gfx::Rect& background_bounds) { |
148 background_bounds_ = background_bounds; | 152 background_bounds_ = background_bounds; |
149 } | 153 } |
150 | 154 |
(...skipping 23 matching lines...) Expand all Loading... |
174 // in redesigned login stack. | 178 // in redesigned login stack. |
175 // Login stack (and this object) will be recreated for next user sign in. | 179 // Login stack (and this object) will be recreated for next user sign in. |
176 bool is_signin_completed_; | 180 bool is_signin_completed_; |
177 | 181 |
178 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); | 182 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); |
179 }; | 183 }; |
180 | 184 |
181 } // namespace chromeos | 185 } // namespace chromeos |
182 | 186 |
183 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ | 187 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_ |
OLD | NEW |