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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 bool BrowserPlugin::handleInputEvent(const blink::WebInputEvent& event, | 572 bool BrowserPlugin::handleInputEvent(const blink::WebInputEvent& event, |
573 blink::WebCursorInfo& cursor_info) { | 573 blink::WebCursorInfo& cursor_info) { |
574 if (guest_crashed_ || !ready()) | 574 if (guest_crashed_ || !ready()) |
575 return false; | 575 return false; |
576 | 576 |
577 if (event.type == blink::WebInputEvent::ContextMenu) | 577 if (event.type == blink::WebInputEvent::ContextMenu) |
578 return true; | 578 return true; |
579 | 579 |
580 const blink::WebInputEvent* modified_event = &event; | 580 const blink::WebInputEvent* modified_event = &event; |
581 scoped_ptr<blink::WebTouchEvent> touch_event; | 581 scoped_ptr<blink::WebTouchEvent> touch_event; |
582 if (blink::WebInputEvent::isTouchEventType(event.type)) { | 582 // TODO(jdduke): Remove this branch when Blink starts forwarding |
| 583 // WebTouchEvents with a fully populated |touches| field. |
| 584 if (blink::WebInputEvent::isTouchEventType(event.type) && |
| 585 static_cast<const blink::WebTouchEvent*>(&event)->changedTouchesLength) { |
583 const blink::WebTouchEvent* orig_touch_event = | 586 const blink::WebTouchEvent* orig_touch_event = |
584 static_cast<const blink::WebTouchEvent*>(&event); | 587 static_cast<const blink::WebTouchEvent*>(&event); |
585 | 588 |
586 touch_event.reset(new blink::WebTouchEvent()); | 589 touch_event.reset(new blink::WebTouchEvent()); |
587 memcpy(touch_event.get(), orig_touch_event, sizeof(blink::WebTouchEvent)); | 590 memcpy(touch_event.get(), orig_touch_event, sizeof(blink::WebTouchEvent)); |
588 | 591 |
589 // TODO(bokan): Blink passes back a WebGestureEvent with a touches, | 592 // TODO(bokan): Blink passes back a WebGestureEvent with a touches, |
590 // changedTouches, and targetTouches lists; however, it doesn't set | 593 // changedTouches, and targetTouches lists; however, it doesn't set |
591 // the state field on the touches which is what the RenderWidget uses | 594 // the state field on the touches which is what the RenderWidget uses |
592 // to create a WebCore::TouchEvent. crbug.com/358132 tracks removing | 595 // to create a WebCore::TouchEvent. crbug.com/358132 tracks removing |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 const blink::WebMouseEvent& event) { | 771 const blink::WebMouseEvent& event) { |
769 browser_plugin_manager()->Send( | 772 browser_plugin_manager()->Send( |
770 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, | 773 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, |
771 browser_plugin_instance_id_, | 774 browser_plugin_instance_id_, |
772 plugin_rect_, | 775 plugin_rect_, |
773 &event)); | 776 &event)); |
774 return true; | 777 return true; |
775 } | 778 } |
776 | 779 |
777 } // namespace content | 780 } // namespace content |
OLD | NEW |