| 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 "ash/shell_observer.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 14 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" | 15 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" |
| 15 #include "components/web_modal/web_contents_modal_dialog_host.h" | 16 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 16 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
| 18 #include "content/public/browser/web_contents_delegate.h" | 19 #include "content/public/browser/web_contents_delegate.h" |
| 20 #include "ui/keyboard/keyboard_controller_observer.h" |
| 19 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" | 21 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" |
| 20 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.h" |
| 21 #include "ui/views/widget/widget_delegate.h" | 23 #include "ui/views/widget/widget_delegate.h" |
| 22 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 23 | 25 |
| 24 namespace content { | 26 namespace content { |
| 25 class WebUI; | 27 class WebUI; |
| 26 } | 28 } |
| 27 | 29 |
| 28 namespace views { | 30 namespace views { |
| 29 class View; | 31 class View; |
| 30 class WebView; | 32 class WebView; |
| 31 class Widget; | 33 class Widget; |
| 32 } | 34 } |
| 33 | 35 |
| 34 namespace chromeos { | 36 namespace chromeos { |
| 35 | 37 |
| 36 class OobeUI; | 38 class OobeUI; |
| 37 | 39 |
| 38 // View used to render a WebUI supporting Widget. This widget is used for the | 40 // View used to render a WebUI supporting Widget. This widget is used for the |
| 39 // WebUI based start up and lock screens. It contains a WebView. | 41 // WebUI based start up and lock screens. It contains a WebView. |
| 40 class WebUILoginView : public views::View, | 42 class WebUILoginView : public views::View, |
| 43 public ash::ShellObserver, |
| 44 public keyboard::KeyboardControllerObserver, |
| 41 public content::WebContentsDelegate, | 45 public content::WebContentsDelegate, |
| 42 public content::NotificationObserver, | 46 public content::NotificationObserver, |
| 43 public ChromeWebModalDialogManagerDelegate, | 47 public ChromeWebModalDialogManagerDelegate, |
| 44 public web_modal::WebContentsModalDialogHost { | 48 public web_modal::WebContentsModalDialogHost { |
| 45 public: | 49 public: |
| 46 struct WebViewSettings { | 50 struct WebViewSettings { |
| 47 // If true, this will check for and consume a preloaded views::WebView | 51 // If true, this will check for and consume a preloaded views::WebView |
| 48 // instance. | 52 // instance. |
| 49 bool check_for_preload = false; | 53 bool check_for_preload = false; |
| 50 | 54 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 void Observe(int type, | 132 void Observe(int type, |
| 129 const content::NotificationSource& source, | 133 const content::NotificationSource& source, |
| 130 const content::NotificationDetails& details) override; | 134 const content::NotificationDetails& details) override; |
| 131 | 135 |
| 132 views::WebView* web_view(); | 136 views::WebView* web_view(); |
| 133 | 137 |
| 134 private: | 138 private: |
| 135 // Map type for the accelerator-to-identifier map. | 139 // Map type for the accelerator-to-identifier map. |
| 136 typedef std::map<ui::Accelerator, std::string> AccelMap; | 140 typedef std::map<ui::Accelerator, std::string> AccelMap; |
| 137 | 141 |
| 142 // ash::ShellObserver: |
| 143 void OnVirtualKeyboardStateChanged(bool activated, |
| 144 ash::WmWindow* root_window) override; |
| 145 |
| 146 // keyboard::KeyboardControllerObserver: |
| 147 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; |
| 148 void OnKeyboardClosed() override; |
| 149 |
| 138 // Overridden from content::WebContentsDelegate. | 150 // Overridden from content::WebContentsDelegate. |
| 139 bool HandleContextMenu(const content::ContextMenuParams& params) override; | 151 bool HandleContextMenu(const content::ContextMenuParams& params) override; |
| 140 void HandleKeyboardEvent( | 152 void HandleKeyboardEvent( |
| 141 content::WebContents* source, | 153 content::WebContents* source, |
| 142 const content::NativeWebKeyboardEvent& event) override; | 154 const content::NativeWebKeyboardEvent& event) override; |
| 143 bool IsPopupOrPanel(const content::WebContents* source) const override; | 155 bool IsPopupOrPanel(const content::WebContents* source) const override; |
| 144 bool TakeFocus(content::WebContents* source, bool reverse) override; | 156 bool TakeFocus(content::WebContents* source, bool reverse) override; |
| 145 void RequestMediaAccessPermission( | 157 void RequestMediaAccessPermission( |
| 146 content::WebContents* web_contents, | 158 content::WebContents* web_contents, |
| 147 const content::MediaStreamRequest& request, | 159 const content::MediaStreamRequest& request, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 bool forward_keyboard_event_ = true; | 201 bool forward_keyboard_event_ = true; |
| 190 | 202 |
| 191 base::ObserverList<web_modal::ModalDialogHostObserver> observer_list_; | 203 base::ObserverList<web_modal::ModalDialogHostObserver> observer_list_; |
| 192 | 204 |
| 193 DISALLOW_COPY_AND_ASSIGN(WebUILoginView); | 205 DISALLOW_COPY_AND_ASSIGN(WebUILoginView); |
| 194 }; | 206 }; |
| 195 | 207 |
| 196 } // namespace chromeos | 208 } // namespace chromeos |
| 197 | 209 |
| 198 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_ | 210 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_VIEW_H_ |
| OLD | NEW |