| 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_WEBUI_LOGIN_DISPLAY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "chrome/browser/chromeos/login/signin_specifics.h" | 12 #include "chrome/browser/chromeos/login/signin_specifics.h" |
| 13 #include "chrome/browser/chromeos/login/ui/login_display.h" | 13 #include "chrome/browser/chromeos/login/ui/login_display.h" |
| 14 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" | 14 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" |
| 15 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 15 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| 16 #include "components/user_manager/user.h" | 16 #include "components/user_manager/user.h" |
| 17 #include "ui/base/user_activity/user_activity_observer.h" | 17 #include "ui/base/user_activity/user_activity_observer.h" |
| 18 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" |
| 19 | 19 |
| 20 namespace chromeos { | 20 namespace chromeos { |
| 21 | 21 |
| 22 // WebUI-based login UI implementation. | 22 // WebUI-based login UI implementation. |
| 23 class WebUILoginDisplay : public LoginDisplay, | 23 class WebUILoginDisplay : public LoginDisplay, |
| 24 public NativeWindowDelegate, | 24 public NativeWindowDelegate, |
| 25 public SigninScreenHandlerDelegate, | 25 public SigninScreenHandlerDelegate, |
| 26 public ui::UserActivityObserver { | 26 public ui::UserActivityObserver { |
| 27 public: | 27 public: |
| 28 explicit WebUILoginDisplay(LoginDisplay::Delegate* delegate); | 28 explicit WebUILoginDisplay(LoginDisplay::Delegate* delegate); |
| 29 virtual ~WebUILoginDisplay(); | 29 ~WebUILoginDisplay() override; |
| 30 | 30 |
| 31 // LoginDisplay implementation: | 31 // LoginDisplay implementation: |
| 32 virtual void ClearAndEnablePassword() override; | 32 void ClearAndEnablePassword() override; |
| 33 virtual void Init(const user_manager::UserList& users, | 33 void Init(const user_manager::UserList& users, |
| 34 bool show_guest, | 34 bool show_guest, |
| 35 bool show_users, | 35 bool show_users, |
| 36 bool show_new_user) override; | 36 bool show_new_user) override; |
| 37 virtual void OnPreferencesChanged() override; | 37 void OnPreferencesChanged() override; |
| 38 virtual void RemoveUser(const std::string& user_id) override; | 38 void RemoveUser(const std::string& user_id) override; |
| 39 virtual void SetUIEnabled(bool is_enabled) override; | 39 void SetUIEnabled(bool is_enabled) override; |
| 40 virtual void ShowError(int error_msg_id, | 40 void ShowError(int error_msg_id, |
| 41 int login_attempts, | 41 int login_attempts, |
| 42 HelpAppLauncher::HelpTopic help_topic_id) override; | 42 HelpAppLauncher::HelpTopic help_topic_id) override; |
| 43 virtual void ShowErrorScreen(LoginDisplay::SigninError error_id) override; | 43 void ShowErrorScreen(LoginDisplay::SigninError error_id) override; |
| 44 virtual void ShowGaiaPasswordChanged(const std::string& username) override; | 44 void ShowGaiaPasswordChanged(const std::string& username) override; |
| 45 virtual void ShowPasswordChangedDialog(bool show_password_error) override; | 45 void ShowPasswordChangedDialog(bool show_password_error) override; |
| 46 virtual void ShowSigninUI(const std::string& email) override; | 46 void ShowSigninUI(const std::string& email) override; |
| 47 | 47 |
| 48 // NativeWindowDelegate implementation: | 48 // NativeWindowDelegate implementation: |
| 49 virtual gfx::NativeWindow GetNativeWindow() const override; | 49 gfx::NativeWindow GetNativeWindow() const override; |
| 50 | 50 |
| 51 // SigninScreenHandlerDelegate implementation: | 51 // SigninScreenHandlerDelegate implementation: |
| 52 virtual void CancelPasswordChangedFlow() override; | 52 void CancelPasswordChangedFlow() override; |
| 53 virtual void ResyncUserData() override; | 53 void ResyncUserData() override; |
| 54 virtual void MigrateUserData(const std::string& old_password) override; | 54 void MigrateUserData(const std::string& old_password) override; |
| 55 | 55 |
| 56 virtual void Login(const UserContext& user_context, | 56 void Login(const UserContext& user_context, |
| 57 const SigninSpecifics& specifics) override; | 57 const SigninSpecifics& specifics) override; |
| 58 virtual bool IsSigninInProgress() const override; | 58 bool IsSigninInProgress() const override; |
| 59 virtual void Signout() override; | 59 void Signout() override; |
| 60 virtual void CreateAccount() override; | 60 void CreateAccount() override; |
| 61 virtual void CompleteLogin(const UserContext& user_context) override; | 61 void CompleteLogin(const UserContext& user_context) override; |
| 62 | 62 |
| 63 virtual void OnSigninScreenReady() override; | 63 void OnSigninScreenReady() override; |
| 64 virtual void CancelUserAdding() override; | 64 void CancelUserAdding() override; |
| 65 virtual void LoadWallpaper(const std::string& username) override; | 65 void LoadWallpaper(const std::string& username) override; |
| 66 virtual void LoadSigninWallpaper() override; | 66 void LoadSigninWallpaper() override; |
| 67 virtual void ShowEnterpriseEnrollmentScreen() override; | 67 void ShowEnterpriseEnrollmentScreen() override; |
| 68 virtual void ShowEnableDebuggingScreen() override; | 68 void ShowEnableDebuggingScreen() override; |
| 69 virtual void ShowKioskEnableScreen() override; | 69 void ShowKioskEnableScreen() override; |
| 70 virtual void ShowKioskAutolaunchScreen() override; | 70 void ShowKioskAutolaunchScreen() override; |
| 71 virtual void ShowWrongHWIDScreen() override; | 71 void ShowWrongHWIDScreen() override; |
| 72 virtual void SetWebUIHandler( | 72 void SetWebUIHandler(LoginDisplayWebUIHandler* webui_handler) override; |
| 73 LoginDisplayWebUIHandler* webui_handler) override; | |
| 74 virtual void ShowSigninScreenForCreds(const std::string& username, | 73 virtual void ShowSigninScreenForCreds(const std::string& username, |
| 75 const std::string& password); | 74 const std::string& password); |
| 76 virtual bool IsShowGuest() const override; | 75 bool IsShowGuest() const override; |
| 77 virtual bool IsShowUsers() const override; | 76 bool IsShowUsers() const override; |
| 78 virtual bool IsUserSigninCompleted() const override; | 77 bool IsUserSigninCompleted() const override; |
| 79 virtual void SetDisplayEmail(const std::string& email) override; | 78 void SetDisplayEmail(const std::string& email) override; |
| 80 | 79 |
| 81 virtual void HandleGetUsers() override; | 80 void HandleGetUsers() override; |
| 82 virtual const user_manager::UserList& GetUsers() const override; | 81 const user_manager::UserList& GetUsers() const override; |
| 83 | 82 |
| 84 // ui::UserActivityDetector implementation: | 83 // ui::UserActivityDetector implementation: |
| 85 virtual void OnUserActivity(const ui::Event* event) override; | 84 void OnUserActivity(const ui::Event* event) override; |
| 86 | 85 |
| 87 private: | 86 private: |
| 88 | 87 |
| 89 // Whether to show guest login. | 88 // Whether to show guest login. |
| 90 bool show_guest_; | 89 bool show_guest_; |
| 91 | 90 |
| 92 // Weather to show the user pods or a GAIA sign in. | 91 // Weather to show the user pods or a GAIA sign in. |
| 93 // Public sessions are always shown. | 92 // Public sessions are always shown. |
| 94 bool show_users_; | 93 bool show_users_; |
| 95 | 94 |
| 96 // Whether to show add new user. | 95 // Whether to show add new user. |
| 97 bool show_new_user_; | 96 bool show_new_user_; |
| 98 | 97 |
| 99 // Reference to the WebUI handling layer for the login screen | 98 // Reference to the WebUI handling layer for the login screen |
| 100 LoginDisplayWebUIHandler* webui_handler_; | 99 LoginDisplayWebUIHandler* webui_handler_; |
| 101 | 100 |
| 102 DISALLOW_COPY_AND_ASSIGN(WebUILoginDisplay); | 101 DISALLOW_COPY_AND_ASSIGN(WebUILoginDisplay); |
| 103 }; | 102 }; |
| 104 | 103 |
| 105 } // namespace chromeos | 104 } // namespace chromeos |
| 106 | 105 |
| 107 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_ | 106 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_ |
| OLD | NEW |