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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h

Issue 8395042: [cros,de-hack] Get rid of singleton for the WebUILoginScreen. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: comment nit Created 9 years, 1 month 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
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_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "base/task.h" 13 #include "base/task.h"
14 #include "chrome/browser/browsing_data_remover.h" 14 #include "chrome/browser/browsing_data_remover.h"
15 #include "chrome/browser/chromeos/login/help_app_launcher.h" 15 #include "chrome/browser/chromeos/login/help_app_launcher.h"
16 #include "chrome/browser/chromeos/login/user_manager.h"
16 #include "chrome/browser/chromeos/system_key_event_listener.h" 17 #include "chrome/browser/chromeos/system_key_event_listener.h"
17 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" 18 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
18 #include "content/browser/webui/web_ui.h" 19 #include "content/browser/webui/web_ui.h"
19 20
20 class BrowsingDataRemover; 21 class BrowsingDataRemover;
21 22
22 namespace base { 23 namespace base {
23 class DictionaryValue; 24 class DictionaryValue;
24 class ListValue; 25 class ListValue;
25 } 26 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 70
70 // Attempts to remove given user. 71 // Attempts to remove given user.
71 virtual void RemoveUser(const std::string& username) = 0; 72 virtual void RemoveUser(const std::string& username) = 0;
72 73
73 // Shows Enterprise Enrollment screen. 74 // Shows Enterprise Enrollment screen.
74 virtual void ShowEnterpriseEnrollmentScreen() = 0; 75 virtual void ShowEnterpriseEnrollmentScreen() = 0;
75 76
76 // Let the delegate know about the handler it is supposed to be using. 77 // Let the delegate know about the handler it is supposed to be using.
77 virtual void SetWebUIHandler(LoginDisplayWebUIHandler* webui_handler) = 0; 78 virtual void SetWebUIHandler(LoginDisplayWebUIHandler* webui_handler) = 0;
78 79
80 // Returns users list to be shown.
81 virtual const std::vector<UserManager::User>& GetUsers() const = 0;
82
83 // Whether login as guest is available.
84 virtual bool IsShowGuest() const = 0;
85
86 // Whether new user pod is available.
87 virtual bool IsShowNewUser() const = 0;
88
79 protected: 89 protected:
80 virtual ~SigninScreenHandlerDelegate() {} 90 virtual ~SigninScreenHandlerDelegate() {}
81 }; 91 };
82 92
83 // A class that handles the WebUI hooks in sign-in screen in OobeDisplay 93 // A class that handles the WebUI hooks in sign-in screen in OobeDisplay
84 // and LoginDisplay. 94 // and LoginDisplay.
85 class SigninScreenHandler : public BaseScreenHandler, 95 class SigninScreenHandler : public BaseScreenHandler,
86 public LoginDisplayWebUIHandler, 96 public LoginDisplayWebUIHandler,
87 public BrowsingDataRemover::Observer, 97 public BrowsingDataRemover::Observer,
88 public SystemKeyEventListener::CapsLockObserver { 98 public SystemKeyEventListener::CapsLockObserver {
89 public: 99 public:
90 SigninScreenHandler(); 100 SigninScreenHandler();
91 virtual ~SigninScreenHandler(); 101 virtual ~SigninScreenHandler();
92 102
93 // Shows the sign in screen. |oobe_ui| indicates whether the signin 103 // Shows the sign in screen. |oobe_ui| indicates whether the signin
94 // screen is for OOBE or usual sign-in flow. 104 // screen is for OOBE or usual sign-in flow.
95 void Show(bool oobe_ui); 105 void Show(bool oobe_ui);
96 106
107 // Sets delegate to be used by the handler. It is guaranteed that valid
108 // delegate is set before Show() method will be called.
109 void SetDelegate(SigninScreenHandlerDelegate* delegate);
110
97 private: 111 private:
98 friend class ReportDnsCacheClearedOnUIThread; 112 friend class ReportDnsCacheClearedOnUIThread;
99 113
100 // BaseScreenHandler implementation: 114 // BaseScreenHandler implementation:
101 virtual void GetLocalizedStrings( 115 virtual void GetLocalizedStrings(
102 base::DictionaryValue* localized_strings) OVERRIDE; 116 base::DictionaryValue* localized_strings) OVERRIDE;
103 virtual void Initialize() OVERRIDE; 117 virtual void Initialize() OVERRIDE;
104 118
105 // WebUIMessageHandler implementation: 119 // WebUIMessageHandler implementation:
106 virtual void RegisterMessages() OVERRIDE; 120 virtual void RegisterMessages() OVERRIDE;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 236
223 // CapsLock state change notifier instance; 237 // CapsLock state change notifier instance;
224 SystemKeyEventListener* key_event_listener_; 238 SystemKeyEventListener* key_event_listener_;
225 239
226 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); 240 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler);
227 }; 241 };
228 242
229 } // namespace chromeos 243 } // namespace chromeos
230 244
231 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ 245 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/oobe_ui.cc ('k') | chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698