OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "content/renderer/browser_plugin/browser_plugin.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
23 #include "content/public/renderer/browser_plugin_delegate.h" | 23 #include "content/public/renderer/browser_plugin_delegate.h" |
24 #include "content/public/renderer/content_renderer_client.h" | 24 #include "content/public/renderer/content_renderer_client.h" |
25 #include "content/renderer/accessibility/render_accessibility_impl.h" | 25 #include "content/renderer/accessibility/render_accessibility_impl.h" |
26 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 26 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
27 #include "content/renderer/child_frame_compositing_helper.h" | 27 #include "content/renderer/child_frame_compositing_helper.h" |
28 #include "content/renderer/cursor_utils.h" | 28 #include "content/renderer/cursor_utils.h" |
29 #include "content/renderer/drop_data_builder.h" | 29 #include "content/renderer/drop_data_builder.h" |
30 #include "content/renderer/render_thread_impl.h" | 30 #include "content/renderer/render_thread_impl.h" |
31 #include "content/renderer/sad_plugin.h" | 31 #include "content/renderer/sad_plugin.h" |
| 32 #include "third_party/WebKit/public/platform/WebCoalescedInputEvent.h" |
32 #include "third_party/WebKit/public/platform/WebGestureEvent.h" | 33 #include "third_party/WebKit/public/platform/WebGestureEvent.h" |
33 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 34 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
34 #include "third_party/WebKit/public/platform/WebMouseWheelEvent.h" | 35 #include "third_party/WebKit/public/platform/WebMouseWheelEvent.h" |
35 #include "third_party/WebKit/public/platform/WebRect.h" | 36 #include "third_party/WebKit/public/platform/WebRect.h" |
36 #include "third_party/WebKit/public/web/WebAXObject.h" | 37 #include "third_party/WebKit/public/web/WebAXObject.h" |
37 #include "third_party/WebKit/public/web/WebDocument.h" | 38 #include "third_party/WebKit/public/web/WebDocument.h" |
38 #include "third_party/WebKit/public/web/WebElement.h" | 39 #include "third_party/WebKit/public/web/WebElement.h" |
39 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 40 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
40 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 41 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
41 #include "third_party/WebKit/public/web/WebView.h" | 42 #include "third_party/WebKit/public/web/WebView.h" |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 | 435 |
435 if (compositing_helper_.get()) | 436 if (compositing_helper_.get()) |
436 compositing_helper_->UpdateVisibility(visible); | 437 compositing_helper_->UpdateVisibility(visible); |
437 | 438 |
438 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetVisibility( | 439 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetVisibility( |
439 browser_plugin_instance_id_, | 440 browser_plugin_instance_id_, |
440 visible)); | 441 visible)); |
441 } | 442 } |
442 | 443 |
443 blink::WebInputEventResult BrowserPlugin::HandleInputEvent( | 444 blink::WebInputEventResult BrowserPlugin::HandleInputEvent( |
444 const blink::WebInputEvent& event, | 445 const blink::WebCoalescedInputEvent& coalesced_event, |
445 blink::WebCursorInfo& cursor_info) { | 446 blink::WebCursorInfo& cursor_info) { |
| 447 const blink::WebInputEvent& event = coalesced_event.Event(); |
446 if (guest_crashed_ || !attached()) | 448 if (guest_crashed_ || !attached()) |
447 return blink::WebInputEventResult::kNotHandled; | 449 return blink::WebInputEventResult::kNotHandled; |
448 | 450 |
449 DCHECK(!blink::WebInputEvent::IsTouchEventType(event.GetType())); | 451 DCHECK(!blink::WebInputEvent::IsTouchEventType(event.GetType())); |
450 | 452 |
451 // With direct event routing turned on, BrowserPlugin should almost never | 453 // With direct event routing turned on, BrowserPlugin should almost never |
452 // see wheel events any more. The two exceptions are (1) scroll bubbling, and | 454 // see wheel events any more. The two exceptions are (1) scroll bubbling, and |
453 // (2) synthetic mouse wheels generated by touchpad GesturePinch events on | 455 // (2) synthetic mouse wheels generated by touchpad GesturePinch events on |
454 // Mac, which always go to the mainframe and thus may hit BrowserPlugin if | 456 // Mac, which always go to the mainframe and thus may hit BrowserPlugin if |
455 // it's in a top-level embedder. In both cases we should indicate the event | 457 // it's in a top-level embedder. In both cases we should indicate the event |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 | 635 |
634 bool BrowserPlugin::HandleMouseLockedInputEvent( | 636 bool BrowserPlugin::HandleMouseLockedInputEvent( |
635 const blink::WebMouseEvent& event) { | 637 const blink::WebMouseEvent& event) { |
636 BrowserPluginManager::Get()->Send( | 638 BrowserPluginManager::Get()->Send( |
637 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, | 639 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, |
638 &event)); | 640 &event)); |
639 return true; | 641 return true; |
640 } | 642 } |
641 | 643 |
642 } // namespace content | 644 } // namespace content |
OLD | NEW |