| 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 10 matching lines...) Expand all Loading... |
| 21 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
| 22 #include "content/public/renderer/browser_plugin_delegate.h" | 22 #include "content/public/renderer/browser_plugin_delegate.h" |
| 23 #include "content/public/renderer/content_renderer_client.h" | 23 #include "content/public/renderer/content_renderer_client.h" |
| 24 #include "content/renderer/accessibility/render_accessibility_impl.h" | 24 #include "content/renderer/accessibility/render_accessibility_impl.h" |
| 25 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 25 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
| 26 #include "content/renderer/child_frame_compositing_helper.h" | 26 #include "content/renderer/child_frame_compositing_helper.h" |
| 27 #include "content/renderer/cursor_utils.h" | 27 #include "content/renderer/cursor_utils.h" |
| 28 #include "content/renderer/drop_data_builder.h" | 28 #include "content/renderer/drop_data_builder.h" |
| 29 #include "content/renderer/render_thread_impl.h" | 29 #include "content/renderer/render_thread_impl.h" |
| 30 #include "content/renderer/sad_plugin.h" | 30 #include "content/renderer/sad_plugin.h" |
| 31 #include "third_party/WebKit/public/platform/CoalescedWebInputEvent.h" |
| 31 #include "third_party/WebKit/public/platform/WebGestureEvent.h" | 32 #include "third_party/WebKit/public/platform/WebGestureEvent.h" |
| 32 #include "third_party/WebKit/public/platform/WebInputEvent.h" | |
| 33 #include "third_party/WebKit/public/platform/WebRect.h" | 33 #include "third_party/WebKit/public/platform/WebRect.h" |
| 34 #include "third_party/WebKit/public/web/WebAXObject.h" | 34 #include "third_party/WebKit/public/web/WebAXObject.h" |
| 35 #include "third_party/WebKit/public/web/WebDocument.h" | 35 #include "third_party/WebKit/public/web/WebDocument.h" |
| 36 #include "third_party/WebKit/public/web/WebElement.h" | 36 #include "third_party/WebKit/public/web/WebElement.h" |
| 37 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 37 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 38 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 38 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
| 39 #include "third_party/WebKit/public/web/WebView.h" | 39 #include "third_party/WebKit/public/web/WebView.h" |
| 40 #include "ui/events/keycodes/keyboard_codes.h" | 40 #include "ui/events/keycodes/keyboard_codes.h" |
| 41 | 41 |
| 42 using blink::WebPluginContainer; | 42 using blink::WebPluginContainer; |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 | 432 |
| 433 if (compositing_helper_.get()) | 433 if (compositing_helper_.get()) |
| 434 compositing_helper_->UpdateVisibility(visible); | 434 compositing_helper_->UpdateVisibility(visible); |
| 435 | 435 |
| 436 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetVisibility( | 436 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetVisibility( |
| 437 browser_plugin_instance_id_, | 437 browser_plugin_instance_id_, |
| 438 visible)); | 438 visible)); |
| 439 } | 439 } |
| 440 | 440 |
| 441 blink::WebInputEventResult BrowserPlugin::handleInputEvent( | 441 blink::WebInputEventResult BrowserPlugin::handleInputEvent( |
| 442 const blink::WebInputEvent& event, | 442 const blink::CoalescedWebInputEvent& coalescedEvent, |
| 443 blink::WebCursorInfo& cursor_info) { | 443 blink::WebCursorInfo& cursor_info) { |
| 444 if (guest_crashed_ || !attached()) | 444 if (guest_crashed_ || !attached()) |
| 445 return blink::WebInputEventResult::NotHandled; | 445 return blink::WebInputEventResult::NotHandled; |
| 446 | 446 |
| 447 const blink::WebInputEvent& event = coalescedEvent.event(); |
| 448 |
| 447 DCHECK(!blink::WebInputEvent::isTouchEventType(event.type)); | 449 DCHECK(!blink::WebInputEvent::isTouchEventType(event.type)); |
| 448 | 450 |
| 449 if (event.type == blink::WebInputEvent::MouseWheel) { | 451 if (event.type == blink::WebInputEvent::MouseWheel) { |
| 450 auto wheel_event = static_cast<const blink::WebMouseWheelEvent&>(event); | 452 auto wheel_event = static_cast<const blink::WebMouseWheelEvent&>(event); |
| 451 if (wheel_event.resendingPluginId == browser_plugin_instance_id_) | 453 if (wheel_event.resendingPluginId == browser_plugin_instance_id_) |
| 452 return blink::WebInputEventResult::NotHandled; | 454 return blink::WebInputEventResult::NotHandled; |
| 453 } | 455 } |
| 454 | 456 |
| 455 if (blink::WebInputEvent::isGestureEventType(event.type)) { | 457 if (blink::WebInputEvent::isGestureEventType(event.type)) { |
| 456 auto gesture_event = static_cast<const blink::WebGestureEvent&>(event); | 458 auto gesture_event = static_cast<const blink::WebGestureEvent&>(event); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 | 611 |
| 610 bool BrowserPlugin::HandleMouseLockedInputEvent( | 612 bool BrowserPlugin::HandleMouseLockedInputEvent( |
| 611 const blink::WebMouseEvent& event) { | 613 const blink::WebMouseEvent& event) { |
| 612 BrowserPluginManager::Get()->Send( | 614 BrowserPluginManager::Get()->Send( |
| 613 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, | 615 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, |
| 614 &event)); | 616 &event)); |
| 615 return true; | 617 return true; |
| 616 } | 618 } |
| 617 | 619 |
| 618 } // namespace content | 620 } // namespace content |
| OLD | NEW |