Chromium Code Reviews| 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 static views::Widget* GetCurrentLoginWindow(); | |
|
Nikita (slow)
2011/05/18 20:22:12
Are we planning to have multiple windows?
rharrison
2011/05/19 00:31:43
No, this is a convenience method, so that we can g
Nikita (slow)
2011/05/19 03:57:22
Ok, so my point was to rename it to just GetLoginW
rharrison
2011/05/19 16:45:28
Done.
| |
| 53 | |
| 54 views::Widget* LoginWindow() { return webui_login_window_.get(); } | |
|
Nikita (slow)
2011/05/18 20:22:12
Please move implementation to cc file. It's not a
rharrison
2011/05/19 00:31:43
Done.
| |
| 55 | |
| 51 // LoginDisplay implementation: | 56 // LoginDisplay implementation: |
| 52 virtual void Destroy() OVERRIDE; | 57 virtual void Destroy() OVERRIDE; |
| 53 virtual void Init(const std::vector<UserManager::User>& users, | 58 virtual void Init(const std::vector<UserManager::User>& users, |
| 54 bool show_guest, | 59 bool show_guest, |
| 55 bool show_new_user) OVERRIDE; | 60 bool show_new_user) OVERRIDE; |
| 56 virtual void OnBeforeUserRemoved(const std::string& username) OVERRIDE; | 61 virtual void OnBeforeUserRemoved(const std::string& username) OVERRIDE; |
| 57 virtual void OnUserImageChanged(UserManager::User* user) OVERRIDE; | 62 virtual void OnUserImageChanged(UserManager::User* user) OVERRIDE; |
| 58 virtual void OnUserRemoved(const std::string& username) OVERRIDE; | 63 virtual void OnUserRemoved(const std::string& username) OVERRIDE; |
| 59 virtual void OnFadeOut() OVERRIDE; | 64 virtual void OnFadeOut() OVERRIDE; |
| 60 virtual void SetUIEnabled(bool is_enabled) OVERRIDE; | 65 virtual void SetUIEnabled(bool is_enabled) OVERRIDE; |
| 61 virtual void ShowError(int error_msg_id, | 66 virtual void ShowError(int error_msg_id, |
| 62 int login_attempts, | 67 int login_attempts, |
| 63 HelpAppLauncher::HelpTopic help_topic_id) OVERRIDE; | 68 HelpAppLauncher::HelpTopic help_topic_id) OVERRIDE; |
| 64 | 69 |
| 65 // LoginUIHandlerDelegate | 70 // LoginUIHandlerDelegate |
| 66 virtual void Login(const std::string& username, | 71 virtual void Login(const std::string& username, |
| 67 const std::string& password) OVERRIDE; | 72 const std::string& password) OVERRIDE; |
| 68 virtual void LoginAsGuest() OVERRIDE; | 73 virtual void LoginAsGuest() OVERRIDE; |
| 69 | 74 |
| 70 private: | 75 private: |
| 71 // Singleton implementation: | 76 // Singleton implementation: |
| 72 friend struct DefaultSingletonTraits<DOMLoginDisplay>; | 77 friend struct DefaultSingletonTraits<DOMLoginDisplay>; |
| 73 DOMLoginDisplay(); | 78 DOMLoginDisplay(); |
| 74 | 79 |
| 75 // Set of Users in the systemvisible UserControllers. | 80 // Set of Users in the systemvisible UserControllers. |
| 76 std::vector<UserManager::User> users_; | 81 std::vector<UserManager::User> users_; |
| 77 | 82 |
| 78 // Container of the screen we are displaying | 83 // Container of the screen we are displaying |
| 79 DOMBrowser* login_screen_; | 84 WebUILoginView* webui_login_view_; |
| 85 scoped_ptr<views::Widget> webui_login_window_; | |
|
oshima
2011/05/18 18:24:54
widget manages its memory by itself, so you don't
rharrison
2011/05/19 00:31:43
Did not know that, thanks for the catch.
| |
| 80 | 86 |
| 81 DISALLOW_COPY_AND_ASSIGN(DOMLoginDisplay); | 87 DISALLOW_COPY_AND_ASSIGN(DOMLoginDisplay); |
| 82 }; | 88 }; |
| 83 | 89 |
| 84 } // namespace chromeos | 90 } // namespace chromeos |
| 85 | 91 |
| 86 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_DOM_LOGIN_DISPLAY_H_ | 92 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_DOM_LOGIN_DISPLAY_H_ |
| OLD | NEW |