| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 | 434 |
| 434 if (compositing_helper_.get()) | 435 if (compositing_helper_.get()) |
| 435 compositing_helper_->UpdateVisibility(visible); | 436 compositing_helper_->UpdateVisibility(visible); |
| 436 | 437 |
| 437 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetVisibility( | 438 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_SetVisibility( |
| 438 browser_plugin_instance_id_, | 439 browser_plugin_instance_id_, |
| 439 visible)); | 440 visible)); |
| 440 } | 441 } |
| 441 | 442 |
| 442 blink::WebInputEventResult BrowserPlugin::HandleInputEvent( | 443 blink::WebInputEventResult BrowserPlugin::HandleInputEvent( |
| 443 const blink::WebInputEvent& event, | 444 const blink::WebCoalescedInputEvent& coalesced_event, |
| 444 blink::WebCursorInfo& cursor_info) { | 445 blink::WebCursorInfo& cursor_info) { |
| 446 const blink::WebInputEvent& event = coalesced_event.Event(); |
| 445 if (guest_crashed_ || !attached()) | 447 if (guest_crashed_ || !attached()) |
| 446 return blink::WebInputEventResult::kNotHandled; | 448 return blink::WebInputEventResult::kNotHandled; |
| 447 | 449 |
| 448 DCHECK(!blink::WebInputEvent::IsTouchEventType(event.GetType())); | 450 DCHECK(!blink::WebInputEvent::IsTouchEventType(event.GetType())); |
| 449 | 451 |
| 450 // With direct event routing turned on, BrowserPlugin should almost never | 452 // With direct event routing turned on, BrowserPlugin should almost never |
| 451 // see wheel events any more. The two exceptions are (1) scroll bubbling, and | 453 // see wheel events any more. The two exceptions are (1) scroll bubbling, and |
| 452 // (2) synthetic mouse wheels generated by touchpad GesturePinch events on | 454 // (2) synthetic mouse wheels generated by touchpad GesturePinch events on |
| 453 // Mac, which always go to the mainframe and thus may hit BrowserPlugin if | 455 // Mac, which always go to the mainframe and thus may hit BrowserPlugin if |
| 454 // it's in a top-level embedder. In both cases we should indicate the event | 456 // 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... |
| 632 | 634 |
| 633 bool BrowserPlugin::HandleMouseLockedInputEvent( | 635 bool BrowserPlugin::HandleMouseLockedInputEvent( |
| 634 const blink::WebMouseEvent& event) { | 636 const blink::WebMouseEvent& event) { |
| 635 BrowserPluginManager::Get()->Send( | 637 BrowserPluginManager::Get()->Send( |
| 636 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, | 638 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, |
| 637 &event)); | 639 &event)); |
| 638 return true; | 640 return true; |
| 639 } | 641 } |
| 640 | 642 |
| 641 } // namespace content | 643 } // namespace content |
| OLD | NEW |