Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" | 13 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" |
| 14 #include "components/web_modal/web_contents_modal_dialog_host.h" | 14 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
| 17 #include "content/public/browser/web_contents_delegate.h" | 17 #include "content/public/browser/web_contents_delegate.h" |
| 18 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" | 18 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" |
| 19 #include "ui/views/widget/widget.h" | 19 #include "ui/views/widget/widget.h" |
| 20 #include "ui/views/widget/widget_delegate.h" | 20 #include "ui/views/widget/widget_delegate.h" |
| 21 | 21 |
| 22 class GURL; | 22 class GURL; |
| 23 | 23 |
| 24 namespace ash { | |
| 25 class StatusAreaWidgetDelegate; | |
| 26 } | |
| 27 | |
| 24 namespace content { | 28 namespace content { |
| 25 class WebUI; | 29 class WebUI; |
| 26 } | 30 } |
| 27 | 31 |
| 28 namespace views { | 32 namespace views { |
| 29 class View; | 33 class View; |
| 30 class WebView; | 34 class WebView; |
| 31 class Widget; | 35 class Widget; |
| 32 } | 36 } |
| 33 | 37 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 content::MediaStreamType type) override; | 138 content::MediaStreamType type) override; |
| 135 bool PreHandleGestureEvent(content::WebContents* source, | 139 bool PreHandleGestureEvent(content::WebContents* source, |
| 136 const blink::WebGestureEvent& event) override; | 140 const blink::WebGestureEvent& event) override; |
| 137 | 141 |
| 138 // Performs series of actions when login prompt is considered | 142 // Performs series of actions when login prompt is considered |
| 139 // to be ready and visible. | 143 // to be ready and visible. |
| 140 // 1. Emits LoginPromptVisible signal if needed | 144 // 1. Emits LoginPromptVisible signal if needed |
| 141 // 2. Notifies OOBE/sign classes. | 145 // 2. Notifies OOBE/sign classes. |
| 142 void OnLoginPromptVisible(); | 146 void OnLoginPromptVisible(); |
| 143 | 147 |
| 148 // Return if status area widget delegate exists, otherwise nullptr. | |
| 149 ash::StatusAreaWidgetDelegate* GetStatusAreaWidgetDelegate(); | |
|
xiyuan
2016/09/13 21:48:08
Move this to cc file in anonymous namespace since
Qiang(Joe) Xu
2016/09/13 21:54:57
done
| |
| 150 | |
| 144 content::NotificationRegistrar registrar_; | 151 content::NotificationRegistrar registrar_; |
| 145 | 152 |
| 146 // Converts keyboard events on the WebContents to accelerators. | 153 // Converts keyboard events on the WebContents to accelerators. |
| 147 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 154 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
| 148 | 155 |
| 149 // Maps installed accelerators to OOBE webui accelerator identifiers. | 156 // Maps installed accelerators to OOBE webui accelerator identifiers. |
| 150 AccelMap accel_map_; | 157 AccelMap accel_map_; |
| 151 | 158 |
| 152 // True when WebUI is being initialized hidden. | 159 // True when WebUI is being initialized hidden. |
| 153 bool is_hidden_; | 160 bool is_hidden_; |
| 154 | 161 |
| 155 // True when the WebUI has finished initializing and is visible. | 162 // True when the WebUI has finished initializing and is visible. |
| 156 bool webui_visible_; | 163 bool webui_visible_; |
| 157 | 164 |
| 158 // Should we emit the login-prompt-visible signal when the login page is | 165 // Should we emit the login-prompt-visible signal when the login page is |
| 159 // displayed? | 166 // displayed? |
| 160 bool should_emit_login_prompt_visible_; | 167 bool should_emit_login_prompt_visible_; |
| 161 | 168 |
| 162 // True to forward keyboard event. | 169 // True to forward keyboard event. |
| 163 bool forward_keyboard_event_; | 170 bool forward_keyboard_event_; |
| 164 | 171 |
| 172 // A FocusTraversable for StatusAreaWidget that uses | |
| 173 // |status_area_widget_host_| as placeholder in WebUiLoginView's focus chain. | |
| 174 class StatusAreaFocusTraversable; | |
| 175 std::unique_ptr<StatusAreaFocusTraversable> status_area_focus_traversable_; | |
| 176 views::View* status_area_widget_host_ = nullptr; | |
| 177 | |
| 178 // A FocusTraversable for WebUILoginView that loops back at the end of its | |
| 179 // focus chain. | |
| 180 class CycleFocusTraversable; | |
| 181 std::unique_ptr<CycleFocusTraversable> cycle_focus_traversable_; | |
| 182 | |
| 165 base::ObserverList<web_modal::ModalDialogHostObserver> observer_list_; | 183 base::ObserverList<web_modal::ModalDialogHostObserver> observer_list_; |
| 166 | 184 |
| 167 DISALLOW_COPY_AND_ASSIGN(WebUILoginView); | 185 DISALLOW_COPY_AND_ASSIGN(WebUILoginView); |
| 168 }; | 186 }; |
| 169 | 187 |
| 170 } // namespace chromeos | 188 } // namespace chromeos |
| 171 | 189 |
| 172 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_ | 190 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_ |
| OLD | NEW |