Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(999)

Side by Side Diff: chrome/browser/chromeos/login/webui_login_display.h

Issue 7015024: Converted from DOM to WebUI for new login method (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updating the patch after confirming with the most recent version of the code Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_WEBUI_LOGIN_DISPLAY_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_DOM_LOGIN_DISPLAY_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WEBUI_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/chromeos/login/webui_login_view.h"
16 #include "chrome/browser/ui/webui/chromeos/login/login_ui.h" 16 #include "chrome/browser/ui/webui/chromeos/login/login_ui.h"
17 17
18 namespace gfx { 18 namespace gfx {
19 class Rect; 19 class Rect;
20 } // namespace gfx 20 } // namespace gfx
21 21
22 namespace chromeos { 22 namespace chromeos {
23 23
24 class DOMBrowser; 24 class WebUIBrowser;
25 25
26 // DOM-based login UI implementation. 26 // WebUI-based login UI implementation.
27 // This class is a Singleton. It allows the LoginDisplayHost and LoginUIHandler 27 // This class is a Singleton. It allows the LoginDisplayHost and LoginUIHandler
28 // to access it without having to be coupled with each other. It is created with 28 // to access it without having to be coupled with each other. It is created with
29 // NULL for the delegate and a 0-size rectangle for the background 29 // NULL for the delegate and a 0-size rectangle for the background
30 // bounds. Before use these values should be set to a sane value. When done with 30 // bounds. Before use these values should be set to a sane value. When done with
31 // the object, the ExistingUserController should call Destroy and not free the 31 // the object, the ExistingUserController should call Destroy and not free the
32 // pointer, where as accessing classes should do nothing with the pointer. 32 // pointer, where as accessing classes should do nothing with the pointer.
33 // 33 //
34 // Expected order of commands to setup for LoginDisplayHost: 34 // Expected order of commands to setup for LoginDisplayHost:
35 // DOMLoginDisplay::GetInstance(); 35 // WebUILoginDisplay::GetInstance();
36 // set_delegate(delegate); 36 // set_delegate(delegate);
37 // set_background_bounds(background_bounds()); 37 // set_background_bounds(background_bounds());
38 // Init(); 38 // Init();
39 // 39 //
40 // Expected order of commands to setup for LoginUIHandler: 40 // Expected order of commands to setup for LoginUIHandler:
41 // DOMLoginDisplay::GetInstance(); 41 // WebUILoginDisplay::GetInstance();
42 // set_login_handler(this); 42 // set_login_handler(this);
43 43
44 class DOMLoginDisplay : public LoginDisplay, 44 class WebUILoginDisplay : public LoginDisplay,
45 public LoginUIHandlerDelegate { 45 public LoginUIHandlerDelegate {
46 public: 46 public:
47 virtual ~DOMLoginDisplay(); 47 virtual ~WebUILoginDisplay();
48 48
49 // Singleton implementation: 49 // Singleton implementation:
50 static DOMLoginDisplay* GetInstance(); 50 static WebUILoginDisplay* GetInstance();
51 51
52 // Wrapper used to help in routing keyboard key presses into the login 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 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 54 // classes don't need to know we are a Singleton
55 static views::Widget* GetLoginWindow(); 55 static views::Widget* GetLoginWindow();
56 views::Widget* LoginWindow(); 56 views::Widget* LoginWindow();
57 57
58 // LoginDisplay implementation: 58 // LoginDisplay implementation:
59 virtual void Destroy() OVERRIDE; 59 virtual void Destroy() OVERRIDE;
60 virtual void Init(const std::vector<UserManager::User>& users, 60 virtual void Init(const std::vector<UserManager::User>& users,
61 bool show_guest, 61 bool show_guest,
62 bool show_new_user) OVERRIDE; 62 bool show_new_user) OVERRIDE;
63 virtual void OnBeforeUserRemoved(const std::string& username) OVERRIDE; 63 virtual void OnBeforeUserRemoved(const std::string& username) OVERRIDE;
64 virtual void OnUserImageChanged(UserManager::User* user) OVERRIDE; 64 virtual void OnUserImageChanged(UserManager::User* user) OVERRIDE;
65 virtual void OnUserRemoved(const std::string& username) OVERRIDE; 65 virtual void OnUserRemoved(const std::string& username) OVERRIDE;
66 virtual void OnFadeOut() OVERRIDE; 66 virtual void OnFadeOut() OVERRIDE;
67 virtual void SetUIEnabled(bool is_enabled) OVERRIDE; 67 virtual void SetUIEnabled(bool is_enabled) OVERRIDE;
68 virtual void ShowError(int error_msg_id, 68 virtual void ShowError(int error_msg_id,
69 int login_attempts, 69 int login_attempts,
70 HelpAppLauncher::HelpTopic help_topic_id) OVERRIDE; 70 HelpAppLauncher::HelpTopic help_topic_id) OVERRIDE;
71 71
72 // LoginUIHandlerDelegate 72 // LoginUIHandlerDelegate
73 virtual void Login(const std::string& username, 73 virtual void Login(const std::string& username,
74 const std::string& password) OVERRIDE; 74 const std::string& password) OVERRIDE;
75 virtual void LoginAsGuest() OVERRIDE; 75 virtual void LoginAsGuest() OVERRIDE;
76 76
77 private: 77 private:
78 // Singleton implementation: 78 // Singleton implementation:
79 friend struct DefaultSingletonTraits<DOMLoginDisplay>; 79 friend struct DefaultSingletonTraits<WebUILoginDisplay>;
80 DOMLoginDisplay(); 80 WebUILoginDisplay();
81 81
82 // Set of Users in the systemvisible UserControllers. 82 // Set of Users in the systemvisible UserControllers.
83 std::vector<UserManager::User> users_; 83 std::vector<UserManager::User> users_;
84 84
85 // Container of the screen we are displaying 85 // Container of the screen we are displaying
86 WebUILoginView* webui_login_view_; // Owned by webui_login_window_ 86 WebUILoginView* webui_login_view_; // Owned by webui_login_window_
87 views::Widget* webui_login_window_; 87 views::Widget* webui_login_window_;
88 88
89 DISALLOW_COPY_AND_ASSIGN(DOMLoginDisplay); 89 DISALLOW_COPY_AND_ASSIGN(WebUILoginDisplay);
90 }; 90 };
91 91
92 } // namespace chromeos 92 } // namespace chromeos
93 93
94 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_DOM_LOGIN_DISPLAY_H_ 94 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WEBUI_LOGIN_DISPLAY_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/dom_login_display_host.cc ('k') | chrome/browser/chromeos/login/webui_login_display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698