| 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/remove_user_delegate.h" |
| 14 #include "chrome/browser/chromeos/login/user.h" | 15 #include "chrome/browser/chromeos/login/user.h" |
| 16 #include "chrome/browser/chromeos/login/user_manager.h" |
| 15 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 16 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
| 17 | 19 |
| 18 namespace chromeos { | 20 namespace chromeos { |
| 19 | 21 |
| 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. | 22 // TODO(nkostylev): Extract interface, create a BaseLoginDisplay class. |
| 31 // An abstract class that defines login UI implementation. | 23 // An abstract class that defines login UI implementation. |
| 32 class LoginDisplay : public RemoveUserDelegate { | 24 class LoginDisplay : public RemoveUserDelegate { |
| 33 public: | 25 public: |
| 34 class Delegate { | 26 class Delegate { |
| 35 public: | 27 public: |
| 36 // Create new Google account. | 28 // Create new Google account. |
| 37 virtual void CreateAccount() = 0; | 29 virtual void CreateAccount() = 0; |
| 38 | 30 |
| 39 // Returns name of the currently connected network. | 31 // Returns name of the currently connected network. |
| 40 virtual string16 GetConnectedNetworkName() = 0; | 32 virtual string16 GetConnectedNetworkName() = 0; |
| 41 | 33 |
| 42 // Users decides to sign in into captive portal. | 34 // Users decides to sign in into captive portal. |
| 43 virtual void FixCaptivePortal() = 0; | 35 virtual void FixCaptivePortal() = 0; |
| 44 | 36 |
| 37 // Sets the displayed email for the next login attempt with |CompleteLogin|. |
| 38 // If it succeeds, user's displayed email value will be updated to |email|. |
| 39 virtual void SetDisplayEmail(const std::string& email) = 0; |
| 40 |
| 45 // Complete sign process with specified |username| and |password|. | 41 // Complete sign process with specified |username| and |password|. |
| 46 // Used for new users authenticated through an extension. | 42 // Used for new users authenticated through an extension. |
| 47 virtual void CompleteLogin(const std::string& username, | 43 virtual void CompleteLogin(const std::string& username, |
| 48 const std::string& password) = 0; | 44 const std::string& password) = 0; |
| 49 | 45 |
| 50 // Sign in using |username| and |password| specified. | 46 // Sign in using |username| and |password| specified. |
| 51 // Used for both known and new users. | 47 // Used for both known users only. |
| 52 virtual void Login(const std::string& username, | 48 virtual void Login(const std::string& username, |
| 53 const std::string& password) = 0; | 49 const std::string& password) = 0; |
| 54 | 50 |
| 55 // Sign in into Guest session. | 51 // Sign in into Guest session. |
| 56 virtual void LoginAsGuest() = 0; | 52 virtual void LoginAsGuest() = 0; |
| 57 | 53 |
| 58 // Called when existing user pod is selected in the UI. | 54 // Called when existing user pod is selected in the UI. |
| 59 virtual void OnUserSelected(const std::string& username) = 0; | 55 virtual void OnUserSelected(const std::string& username) = 0; |
| 60 | 56 |
| 61 // Called when the user requests enterprise enrollment. | 57 // Called when the user requests enterprise enrollment. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 118 |
| 123 // Bounds of the login UI background. | 119 // Bounds of the login UI background. |
| 124 gfx::Rect background_bounds_; | 120 gfx::Rect background_bounds_; |
| 125 | 121 |
| 126 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); | 122 DISALLOW_COPY_AND_ASSIGN(LoginDisplay); |
| 127 }; | 123 }; |
| 128 | 124 |
| 129 } // namespace chromeos | 125 } // namespace chromeos |
| 130 | 126 |
| 131 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ | 127 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_H_ |
| OLD | NEW |