OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_LOGIN_DISPLAY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/string16.h" | 12 #include "base/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/user.h" | 14 #include "chrome/browser/chromeos/login/user.h" |
| 15 #include "chrome/browser/chromeos/login/user_manager.h" |
15 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
16 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
17 | 18 |
18 namespace chromeos { | 19 namespace chromeos { |
19 | 20 |
20 // Delegate to be used while user removing. | |
21 class RemoveUserDelegate { | |
22 public: | |
23 // Called right before actual user removal process is initiated. | |
24 virtual void OnBeforeUserRemoved(const std::string& username) = 0; | |
25 | |
26 // Called right after user removal process has been initiated. | |
27 virtual void OnUserRemoved(const std::string& username) = 0; | |
28 }; | |
29 | |
30 // TODO(nkostylev): Extract interface, create a BaseLoginDisplay class. | 21 // TODO(nkostylev): Extract interface, create a BaseLoginDisplay class. |
31 // An abstract class that defines login UI implementation. | 22 // An abstract class that defines login UI implementation. |
32 class LoginDisplay : public RemoveUserDelegate { | 23 class LoginDisplay : public RemoveUserDelegate { |
33 public: | 24 public: |
34 class Delegate { | 25 class Delegate { |
35 public: | 26 public: |
36 // Create new Google account. | 27 // Create new Google account. |
37 virtual void CreateAccount() = 0; | 28 virtual void CreateAccount() = 0; |
38 | 29 |
39 // Returns name of the currently connected network. | 30 // Returns name of the currently connected network. |
40 virtual string16 GetConnectedNetworkName() = 0; | 31 virtual string16 GetConnectedNetworkName() = 0; |
41 | 32 |
42 // Users decides to sign in into captive portal. | 33 // Users decides to sign in into captive portal. |
43 virtual void FixCaptivePortal() = 0; | 34 virtual void FixCaptivePortal() = 0; |
44 | 35 |
| 36 // Sets the displayed email for the next login attempt. If it succeeds, |
| 37 // user's displayed email value will be updated to |email|. |
| 38 virtual void SetDisplayEmail(const std::string& email) = 0; |
| 39 |
45 // Complete sign process with specified |username| and |password|. | 40 // Complete sign process with specified |username| and |password|. |
46 // Used for new users authenticated through an extension. | 41 // Used for new users authenticated through an extension. |
47 virtual void CompleteLogin(const std::string& username, | 42 virtual void CompleteLogin(const std::string& username, |
48 const std::string& password) = 0; | 43 const std::string& password) = 0; |
49 | 44 |
50 // Sign in using |username| and |password| specified. | 45 // Sign in using |username| and |password| specified. |
51 // Used for both known and new users. | 46 // Used for both known and new users. |
52 virtual void Login(const std::string& username, | 47 virtual void Login(const std::string& username, |
53 const std::string& password) = 0; | 48 const std::string& password) = 0; |
54 | 49 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 117 |
123 // Bounds of the login UI background. | 118 // Bounds of the login UI background. |
124 gfx::Rect background_bounds_; | 119 gfx::Rect background_bounds_; |
125 | 120 |
126 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); | 121 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); |
127 }; | 122 }; |
128 | 123 |
129 } // namespace chromeos | 124 } // namespace chromeos |
130 | 125 |
131 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ | 126 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ |
OLD | NEW |