Chromium Code Reviews| Index: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h |
| diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h |
| index 819396d463140e2a65849e9889a326a216f58650..0563bfaab7b853e82d467ecd128a040e4b85d35d 100644 |
| --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h |
| +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h |
| @@ -7,7 +7,7 @@ |
| #pragma once |
| #include "chrome/browser/ui/webui/chromeos/login/login_ui.h" |
| -#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| +#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
| #include "content/browser/webui/web_ui.h" |
| namespace base { |
| @@ -17,9 +17,34 @@ class ListValue; |
| namespace chromeos { |
| -// Signin screen handler. |
| -class SigninScreenHandler : public OobeMessageHandler, |
| - public BaseLoginUIHandler { |
| +// An interface for WebUILoginDisplay to call SigninScreenHandler. |
| +class LoginDisplayWebUIHandler { |
| + public: |
| + virtual void ClearAndEnablePassword() = 0; |
| + virtual void ShowError(const std::string& error_text, |
| + const std::string& help_link_text, |
| + HelpAppLauncher::HelpTopic help_topic_id) = 0; |
| +}; |
| + |
| +// An interface for SigninScreenHandler to call WebUILoginDisplay. |
| +class SigninScreenHandlerDelegate { |
| + public: |
| + // Let the delegate know about the handler it is supposed to be using. |
| + virtual void SetWebUIHandler(LoginDisplayWebUIHandler* webui_handler) = 0; |
|
Nikita (slow)
2011/07/15 18:52:07
nit: move after LoginAsGuest() so that methods are
xiyuan
2011/07/15 20:38:29
Done.
|
| + |
| + // Sign in using |username| and |password| specified. |
| + // Used for both known and new users. |
| + virtual void Login(const std::string& username, |
| + const std::string& password) = 0; |
| + |
| + // Sign in into Guest session. |
| + virtual void LoginAsGuest() = 0; |
| +}; |
| + |
| +// A class that handles the WebUI hooks in sign-in screen in OobeDisplay |
| +// and LoginDisplay. |
| +class SigninScreenHandler : public BaseScreenHandler, |
| + public LoginDisplayWebUIHandler { |
| public: |
| SigninScreenHandler(); |
| @@ -27,7 +52,7 @@ class SigninScreenHandler : public OobeMessageHandler, |
| void Show(); |
| private: |
| - // OobeMessageHandler implementation: |
| + // BaseScreenHandler implementation: |
| virtual void GetLocalizedStrings( |
| base::DictionaryValue* localized_strings) OVERRIDE; |
| virtual void Initialize() OVERRIDE; |
| @@ -41,13 +66,17 @@ class SigninScreenHandler : public OobeMessageHandler, |
| const std::string& help_link_text, |
| HelpAppLauncher::HelpTopic help_topic_id) OVERRIDE; |
| - // Handles authenticate user request from javascript. |
| + // Callbacks from javascript. |
| + void HandleGetUsers(const base::ListValue* args); |
| void HandleAuthenticateUser(const base::ListValue* args); |
| + void HandleLaunchIncognito(const base::ListValue* args); |
| + void HandleShutdownSystem(const base::ListValue* args); |
| + void HandleRemoveUser(const base::ListValue* args); |
| // A delegate that glues this handler with backend LoginDisplay. |
| - LoginUIHandlerDelegate* delegate_; |
| + SigninScreenHandlerDelegate* delegate_; |
| - // Keeps whether screen should be shown right after initialization. |
| + // Whether screen should be shown right after initialization. |
| bool show_on_init_; |
| DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); |