Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "ui/views/controls/webview/webview.h" | 5 #include "ui/views/controls/webview/webview.h" |
| 6 | 6 |
| 7 #include "content/public/browser/browser_accessibility_state.h" | 7 #include "content/public/browser/browser_accessibility_state.h" |
| 8 #include "content/public/browser/browser_context.h" | 8 #include "content/public/browser/browser_context.h" |
| 9 #include "content/public/browser/navigation_controller.h" | 9 #include "content/public/browser/navigation_controller.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| 11 #include "content/public/browser/render_view_host.h" | 11 #include "content/public/browser/render_view_host.h" |
| 12 #include "content/public/browser/render_widget_host_view.h" | 12 #include "content/public/browser/render_widget_host_view.h" |
| 13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
| 14 #include "ipc/ipc_message.h" | 14 #include "ipc/ipc_message.h" |
| 15 #include "ui/accessibility/ax_enums.h" | 15 #include "ui/accessibility/ax_enums.h" |
| 16 #include "ui/accessibility/ax_view_state.h" | 16 #include "ui/accessibility/ax_view_state.h" |
| 17 #include "ui/events/event.h" | 17 #include "ui/events/event.h" |
| 18 #include "ui/views/controls/native/native_view_host.h" | 18 #include "ui/views/controls/native/native_view_host.h" |
| 19 #include "ui/views/focus/focus_manager.h" | 19 #include "ui/views/focus/focus_manager.h" |
| 20 #include "ui/views/views_delegate.h" | 20 #include "ui/views/views_delegate.h" |
| 21 #include "ui/views/widget/native_widget_private.h" | |
| 21 | 22 |
| 22 namespace views { | 23 namespace views { |
| 23 | 24 |
| 24 // static | 25 // static |
| 25 const char WebView::kViewClassName[] = "WebView"; | 26 const char WebView::kViewClassName[] = "WebView"; |
| 26 | 27 |
| 27 //////////////////////////////////////////////////////////////////////////////// | 28 //////////////////////////////////////////////////////////////////////////////// |
| 28 // WebView, public: | 29 // WebView, public: |
| 29 | 30 |
| 30 WebView::WebView(content::BrowserContext* browser_context) | 31 WebView::WebView(content::BrowserContext* browser_context) |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 242 | 243 |
| 243 void WebView::RenderProcessHostDestroyed(content::RenderProcessHost* host) { | 244 void WebView::RenderProcessHostDestroyed(content::RenderProcessHost* host) { |
| 244 DCHECK_EQ(host, observing_render_process_host_); | 245 DCHECK_EQ(host, observing_render_process_host_); |
| 245 observing_render_process_host_->RemoveObserver(this); | 246 observing_render_process_host_->RemoveObserver(this); |
| 246 observing_render_process_host_ = nullptr; | 247 observing_render_process_host_ = nullptr; |
| 247 } | 248 } |
| 248 | 249 |
| 249 //////////////////////////////////////////////////////////////////////////////// | 250 //////////////////////////////////////////////////////////////////////////////// |
| 250 // WebView, content::WebContentsDelegate implementation: | 251 // WebView, content::WebContentsDelegate implementation: |
| 251 | 252 |
| 253 void WebView::HandleKeyboardEvent( | |
|
tapted
2015/08/18 07:22:13
is this override only to support views_examples? (
jackhou1
2015/08/25 06:31:12
Done.
Left it in this CL because it's a fairly sm
| |
| 254 content::WebContents* source, | |
| 255 const content::NativeWebKeyboardEvent& event) { | |
| 256 if (!event.os_event) | |
| 257 return; | |
| 258 | |
| 259 GetWidget()->native_widget_private()->RepostNativeEvent(event.os_event); | |
| 260 } | |
| 261 | |
| 252 bool WebView::EmbedsFullscreenWidget() const { | 262 bool WebView::EmbedsFullscreenWidget() const { |
| 253 DCHECK(wc_owner_.get()); | 263 DCHECK(wc_owner_.get()); |
| 254 return embed_fullscreen_widget_mode_enabled_; | 264 return embed_fullscreen_widget_mode_enabled_; |
| 255 } | 265 } |
| 256 | 266 |
| 257 //////////////////////////////////////////////////////////////////////////////// | 267 //////////////////////////////////////////////////////////////////////////////// |
| 258 // WebView, content::WebContentsObserver implementation: | 268 // WebView, content::WebContentsObserver implementation: |
| 259 | 269 |
| 260 void WebView::RenderViewReady() { | 270 void WebView::RenderViewReady() { |
| 261 NotifyMaybeTextInputClientAndAccessibilityChanged(); | 271 NotifyMaybeTextInputClientAndAccessibilityChanged(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 392 if (!contents) { | 402 if (!contents) { |
| 393 content::WebContents::CreateParams create_params( | 403 content::WebContents::CreateParams create_params( |
| 394 browser_context, NULL); | 404 browser_context, NULL); |
| 395 return content::WebContents::Create(create_params); | 405 return content::WebContents::Create(create_params); |
| 396 } | 406 } |
| 397 | 407 |
| 398 return contents; | 408 return contents; |
| 399 } | 409 } |
| 400 | 410 |
| 401 } // namespace views | 411 } // namespace views |
| OLD | NEW |