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

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

Issue 2429033003: cros: Cleanup lock screen and OOBE C++ backing code. (Closed)
Patch Set: Address comments Created 4 years, 2 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
OLDNEW
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_VIEW_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 27
28 namespace views { 28 namespace views {
29 class View; 29 class View;
30 class WebView; 30 class WebView;
31 class Widget; 31 class Widget;
32 } 32 }
33 33
34 namespace chromeos { 34 namespace chromeos {
35 35
36 class OobeUI;
37
36 // View used to render a WebUI supporting Widget. This widget is used for the 38 // View used to render a WebUI supporting Widget. This widget is used for the
37 // WebUI based start up and lock screens. It contains a WebView. 39 // WebUI based start up and lock screens. It contains a WebView.
38 class WebUILoginView : public views::View, 40 class WebUILoginView : public views::View,
39 public content::WebContentsDelegate, 41 public content::WebContentsDelegate,
40 public content::NotificationObserver, 42 public content::NotificationObserver,
41 public ChromeWebModalDialogManagerDelegate, 43 public ChromeWebModalDialogManagerDelegate,
42 public web_modal::WebContentsModalDialogHost { 44 public web_modal::WebContentsModalDialogHost {
43 public: 45 public:
44 // Internal class name. 46 // Internal class name.
45 static const char kViewClassName[]; 47 static const char kViewClassName[];
(...skipping 25 matching lines...) Expand all
71 73
72 // Loads given page. Should be called after Init() has been called. 74 // Loads given page. Should be called after Init() has been called.
73 void LoadURL(const GURL& url); 75 void LoadURL(const GURL& url);
74 76
75 // Returns current WebUI. 77 // Returns current WebUI.
76 content::WebUI* GetWebUI(); 78 content::WebUI* GetWebUI();
77 79
78 // Returns current WebContents. 80 // Returns current WebContents.
79 content::WebContents* GetWebContents(); 81 content::WebContents* GetWebContents();
80 82
83 // Returns instance of the OOBE WebUI.
84 OobeUI* GetOobeUI();
85
81 // Opens proxy settings dialog. 86 // Opens proxy settings dialog.
82 void OpenProxySettings(); 87 void OpenProxySettings();
83 88
84 // Called when WebUI is being shown after being initilized hidden. 89 // Called when WebUI is being shown after being initilized hidden.
85 void OnPostponedShow(); 90 void OnPostponedShow();
86 91
87 // Toggles status area visibility. 92 // Toggles status area visibility.
88 void SetStatusAreaVisible(bool visible); 93 void SetStatusAreaVisible(bool visible);
89 94
90 // Sets whether UI should be enabled. 95 // Sets whether UI should be enabled.
(...skipping 14 matching lines...) Expand all
105 void OnLocaleChanged() override; 110 void OnLocaleChanged() override;
106 void ChildPreferredSizeChanged(View* child) override; 111 void ChildPreferredSizeChanged(View* child) override;
107 void AboutToRequestFocusFromTabTraversal(bool reverse) override; 112 void AboutToRequestFocusFromTabTraversal(bool reverse) override;
108 113
109 // Overridden from content::NotificationObserver. 114 // Overridden from content::NotificationObserver.
110 void Observe(int type, 115 void Observe(int type,
111 const content::NotificationSource& source, 116 const content::NotificationSource& source,
112 const content::NotificationDetails& details) override; 117 const content::NotificationDetails& details) override;
113 118
114 // WebView for rendering a webpage as a webui login. 119 // WebView for rendering a webpage as a webui login.
115 views::WebView* webui_login_; 120 views::WebView* webui_login_ = nullptr;
116 121
117 private: 122 private:
118 // Map type for the accelerator-to-identifier map. 123 // Map type for the accelerator-to-identifier map.
119 typedef std::map<ui::Accelerator, std::string> AccelMap; 124 typedef std::map<ui::Accelerator, std::string> AccelMap;
120 125
121 // Overridden from content::WebContentsDelegate. 126 // Overridden from content::WebContentsDelegate.
122 bool HandleContextMenu(const content::ContextMenuParams& params) override; 127 bool HandleContextMenu(const content::ContextMenuParams& params) override;
123 void HandleKeyboardEvent( 128 void HandleKeyboardEvent(
124 content::WebContents* source, 129 content::WebContents* source,
125 const content::NativeWebKeyboardEvent& event) override; 130 const content::NativeWebKeyboardEvent& event) override;
(...skipping 17 matching lines...) Expand all
143 148
144 content::NotificationRegistrar registrar_; 149 content::NotificationRegistrar registrar_;
145 150
146 // Converts keyboard events on the WebContents to accelerators. 151 // Converts keyboard events on the WebContents to accelerators.
147 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; 152 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_;
148 153
149 // Maps installed accelerators to OOBE webui accelerator identifiers. 154 // Maps installed accelerators to OOBE webui accelerator identifiers.
150 AccelMap accel_map_; 155 AccelMap accel_map_;
151 156
152 // True when WebUI is being initialized hidden. 157 // True when WebUI is being initialized hidden.
153 bool is_hidden_; 158 bool is_hidden_ = false;
154 159
155 // True when the WebUI has finished initializing and is visible. 160 // True when the WebUI has finished initializing and is visible.
156 bool webui_visible_; 161 bool webui_visible_ = false;
157 162
158 // Should we emit the login-prompt-visible signal when the login page is 163 // Should we emit the login-prompt-visible signal when the login page is
159 // displayed? 164 // displayed?
160 bool should_emit_login_prompt_visible_; 165 bool should_emit_login_prompt_visible_ = true;
161 166
162 // True to forward keyboard event. 167 // True to forward keyboard event.
163 bool forward_keyboard_event_; 168 bool forward_keyboard_event_ = true;
164 169
165 // A FocusTraversable for StatusAreaWidget that uses 170 // A FocusTraversable for StatusAreaWidget that uses
166 // |status_area_widget_host_| as placeholder in WebUiLoginView's focus chain. 171 // |status_area_widget_host_| as placeholder in WebUiLoginView's focus chain.
167 class StatusAreaFocusTraversable; 172 class StatusAreaFocusTraversable;
168 std::unique_ptr<StatusAreaFocusTraversable> status_area_focus_traversable_; 173 std::unique_ptr<StatusAreaFocusTraversable> status_area_focus_traversable_;
169 views::View* status_area_widget_host_ = nullptr; 174 views::View* status_area_widget_host_ = nullptr;
170 175
171 // A FocusTraversable for WebUILoginView that loops back at the end of its 176 // A FocusTraversable for WebUILoginView that loops back at the end of its
172 // focus chain. 177 // focus chain.
173 class CycleFocusTraversable; 178 class CycleFocusTraversable;
174 std::unique_ptr<CycleFocusTraversable> cycle_focus_traversable_; 179 std::unique_ptr<CycleFocusTraversable> cycle_focus_traversable_;
175 180
176 base::ObserverList<web_modal::ModalDialogHostObserver> observer_list_; 181 base::ObserverList<web_modal::ModalDialogHostObserver> observer_list_;
177 182
178 DISALLOW_COPY_AND_ASSIGN(WebUILoginView); 183 DISALLOW_COPY_AND_ASSIGN(WebUILoginView);
179 }; 184 };
180 185
181 } // namespace chromeos 186 } // namespace chromeos
182 187
183 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_ 188 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/ui/login_display_host_impl.cc ('k') | chrome/browser/chromeos/login/ui/webui_login_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698