OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/frame_host/render_widget_host_view_guest.h" | 5 #include "content/browser/frame_host/render_widget_host_view_guest.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 // incorrect to determine the position of the context menu(they are not the | 610 // incorrect to determine the position of the context menu(they are not the |
611 // actual X, Y of the window). As a hack, we report the last location of a | 611 // actual X, Y of the window). As a hack, we report the last location of a |
612 // right mouse up to the BrowserPluginGuest to inform it of the next | 612 // right mouse up to the BrowserPluginGuest to inform it of the next |
613 // potential location for context menu (BUG=470087). | 613 // potential location for context menu (BUG=470087). |
614 // TODO(ekaramad): Find a better and more fundamental solution. Could the | 614 // TODO(ekaramad): Find a better and more fundamental solution. Could the |
615 // ContextMenuParams be based on global X, Y? | 615 // ContextMenuParams be based on global X, Y? |
616 const blink::WebMouseEvent& mouse_event = | 616 const blink::WebMouseEvent& mouse_event = |
617 static_cast<const blink::WebMouseEvent&>(*event); | 617 static_cast<const blink::WebMouseEvent&>(*event); |
618 // A MouseDown on the ButtonRight could suggest a ContextMenu. | 618 // A MouseDown on the ButtonRight could suggest a ContextMenu. |
619 if (guest_ && mouse_event.type == blink::WebInputEvent::MouseDown && | 619 if (guest_ && mouse_event.type == blink::WebInputEvent::MouseDown && |
620 mouse_event.button == blink::WebPointerProperties::ButtonRight) | 620 mouse_event.button == blink::WebPointerProperties::Button::Right) |
621 guest_->SetContextMenuPosition( | 621 guest_->SetContextMenuPosition( |
622 gfx::Point(mouse_event.globalX - GetViewBounds().x(), | 622 gfx::Point(mouse_event.globalX - GetViewBounds().x(), |
623 mouse_event.globalY - GetViewBounds().y())); | 623 mouse_event.globalY - GetViewBounds().y())); |
624 host_->ForwardMouseEvent(mouse_event); | 624 host_->ForwardMouseEvent(mouse_event); |
625 return; | 625 return; |
626 } | 626 } |
627 | 627 |
628 if (event->type == blink::WebInputEvent::MouseWheel) { | 628 if (event->type == blink::WebInputEvent::MouseWheel) { |
629 host_->ForwardWheelEvent( | 629 host_->ForwardWheelEvent( |
630 *static_cast<const blink::WebMouseWheelEvent*>(event)); | 630 *static_cast<const blink::WebMouseWheelEvent*>(event)); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 gesture_event.data.scrollUpdate.inertialPhase == | 667 gesture_event.data.scrollUpdate.inertialPhase == |
668 blink::WebGestureEvent::MomentumPhase) { | 668 blink::WebGestureEvent::MomentumPhase) { |
669 return; | 669 return; |
670 } | 670 } |
671 host_->ForwardGestureEvent(gesture_event); | 671 host_->ForwardGestureEvent(gesture_event); |
672 return; | 672 return; |
673 } | 673 } |
674 } | 674 } |
675 | 675 |
676 } // namespace content | 676 } // namespace content |
OLD | NEW |