| 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_DOM_LOGIN_DISPLAY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_DOM_LOGIN_DISPLAY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_DOM_LOGIN_DISPLAY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_DOM_LOGIN_DISPLAY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "chrome/browser/chromeos/login/login_display.h" | 13 #include "chrome/browser/chromeos/login/login_display.h" |
| 14 #include "chrome/browser/chromeos/login/user_manager.h" | 14 #include "chrome/browser/chromeos/login/user_manager.h" |
| 15 #include "chrome/browser/chromeos/login/webui_login_view.h" |
| 15 #include "chrome/browser/ui/webui/chromeos/login/login_ui.h" | 16 #include "chrome/browser/ui/webui/chromeos/login/login_ui.h" |
| 16 | 17 |
| 17 namespace gfx { | 18 namespace gfx { |
| 18 class Rect; | 19 class Rect; |
| 19 } // namespace gfx | 20 } // namespace gfx |
| 20 | 21 |
| 21 namespace chromeos { | 22 namespace chromeos { |
| 22 | 23 |
| 23 class DOMBrowser; | 24 class DOMBrowser; |
| 24 | 25 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 41 // set_login_handler(this); | 42 // set_login_handler(this); |
| 42 | 43 |
| 43 class DOMLoginDisplay : public LoginDisplay, | 44 class DOMLoginDisplay : public LoginDisplay, |
| 44 public LoginUIHandlerDelegate { | 45 public LoginUIHandlerDelegate { |
| 45 public: | 46 public: |
| 46 virtual ~DOMLoginDisplay(); | 47 virtual ~DOMLoginDisplay(); |
| 47 | 48 |
| 48 // Singleton implementation: | 49 // Singleton implementation: |
| 49 static DOMLoginDisplay* GetInstance(); | 50 static DOMLoginDisplay* GetInstance(); |
| 50 | 51 |
| 52 // Wrapper used to help in routing keyboard key presses into the login |
| 53 // screen. This gets the Login Window widget from the Singleton, so that other |
| 54 // classes don't need to know we are a Singleton |
| 55 static views::Widget* GetLoginWindow(); |
| 56 views::Widget* LoginWindow(); |
| 57 |
| 51 // LoginDisplay implementation: | 58 // LoginDisplay implementation: |
| 52 virtual void Destroy() OVERRIDE; | 59 virtual void Destroy() OVERRIDE; |
| 53 virtual void Init(const std::vector<UserManager::User>& users, | 60 virtual void Init(const std::vector<UserManager::User>& users, |
| 54 bool show_guest, | 61 bool show_guest, |
| 55 bool show_new_user) OVERRIDE; | 62 bool show_new_user) OVERRIDE; |
| 56 virtual void OnBeforeUserRemoved(const std::string& username) OVERRIDE; | 63 virtual void OnBeforeUserRemoved(const std::string& username) OVERRIDE; |
| 57 virtual void OnUserImageChanged(UserManager::User* user) OVERRIDE; | 64 virtual void OnUserImageChanged(UserManager::User* user) OVERRIDE; |
| 58 virtual void OnUserRemoved(const std::string& username) OVERRIDE; | 65 virtual void OnUserRemoved(const std::string& username) OVERRIDE; |
| 59 virtual void OnFadeOut() OVERRIDE; | 66 virtual void OnFadeOut() OVERRIDE; |
| 60 virtual void SetUIEnabled(bool is_enabled) OVERRIDE; | 67 virtual void SetUIEnabled(bool is_enabled) OVERRIDE; |
| 61 virtual void ShowError(int error_msg_id, | 68 virtual void ShowError(int error_msg_id, |
| 62 int login_attempts, | 69 int login_attempts, |
| 63 HelpAppLauncher::HelpTopic help_topic_id) OVERRIDE; | 70 HelpAppLauncher::HelpTopic help_topic_id) OVERRIDE; |
| 64 | 71 |
| 65 // LoginUIHandlerDelegate | 72 // LoginUIHandlerDelegate |
| 66 virtual void Login(const std::string& username, | 73 virtual void Login(const std::string& username, |
| 67 const std::string& password) OVERRIDE; | 74 const std::string& password) OVERRIDE; |
| 68 virtual void LoginAsGuest() OVERRIDE; | 75 virtual void LoginAsGuest() OVERRIDE; |
| 69 | 76 |
| 70 private: | 77 private: |
| 71 // Singleton implementation: | 78 // Singleton implementation: |
| 72 friend struct DefaultSingletonTraits<DOMLoginDisplay>; | 79 friend struct DefaultSingletonTraits<DOMLoginDisplay>; |
| 73 DOMLoginDisplay(); | 80 DOMLoginDisplay(); |
| 74 | 81 |
| 75 // Set of Users in the systemvisible UserControllers. | 82 // Set of Users in the systemvisible UserControllers. |
| 76 std::vector<UserManager::User> users_; | 83 std::vector<UserManager::User> users_; |
| 77 | 84 |
| 78 // Container of the screen we are displaying | 85 // Container of the screen we are displaying |
| 79 DOMBrowser* login_screen_; | 86 WebUILoginView* webui_login_view_; // Owned by webui_login_window_ |
| 87 views::Widget* webui_login_window_; |
| 80 | 88 |
| 81 DISALLOW_COPY_AND_ASSIGN(DOMLoginDisplay); | 89 DISALLOW_COPY_AND_ASSIGN(DOMLoginDisplay); |
| 82 }; | 90 }; |
| 83 | 91 |
| 84 } // namespace chromeos | 92 } // namespace chromeos |
| 85 | 93 |
| 86 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_DOM_LOGIN_DISPLAY_H_ | 94 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_DOM_LOGIN_DISPLAY_H_ |
| OLD | NEW |