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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 // incorrect to determine the position of the context menu(they are not the | 602 // incorrect to determine the position of the context menu(they are not the |
603 // actual X, Y of the window). As a hack, we report the last location of a | 603 // actual X, Y of the window). As a hack, we report the last location of a |
604 // right mouse up to the BrowserPluginGuest to inform it of the next | 604 // right mouse up to the BrowserPluginGuest to inform it of the next |
605 // potential location for context menu (BUG=470087). | 605 // potential location for context menu (BUG=470087). |
606 // TODO(ekaramad): Find a better and more fundamental solution. Could the | 606 // TODO(ekaramad): Find a better and more fundamental solution. Could the |
607 // ContextMenuParams be based on global X, Y? | 607 // ContextMenuParams be based on global X, Y? |
608 const blink::WebMouseEvent& mouse_event = | 608 const blink::WebMouseEvent& mouse_event = |
609 static_cast<const blink::WebMouseEvent&>(*event); | 609 static_cast<const blink::WebMouseEvent&>(*event); |
610 // A MouseDown on the ButtonRight could suggest a ContextMenu. | 610 // A MouseDown on the ButtonRight could suggest a ContextMenu. |
611 if (guest_ && mouse_event.type == blink::WebInputEvent::MouseDown && | 611 if (guest_ && mouse_event.type == blink::WebInputEvent::MouseDown && |
612 mouse_event.button == blink::WebPointerProperties::ButtonRight) | 612 mouse_event.button == blink::WebPointerProperties::Button::Right) |
613 guest_->SetContextMenuPosition( | 613 guest_->SetContextMenuPosition( |
614 gfx::Point(mouse_event.globalX - GetViewBounds().x(), | 614 gfx::Point(mouse_event.globalX - GetViewBounds().x(), |
615 mouse_event.globalY - GetViewBounds().y())); | 615 mouse_event.globalY - GetViewBounds().y())); |
616 host_->ForwardMouseEvent(mouse_event); | 616 host_->ForwardMouseEvent(mouse_event); |
617 return; | 617 return; |
618 } | 618 } |
619 | 619 |
620 if (event->type == blink::WebInputEvent::MouseWheel) { | 620 if (event->type == blink::WebInputEvent::MouseWheel) { |
621 host_->ForwardWheelEvent( | 621 host_->ForwardWheelEvent( |
622 *static_cast<const blink::WebMouseWheelEvent*>(event)); | 622 *static_cast<const blink::WebMouseWheelEvent*>(event)); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 gesture_event.data.scrollUpdate.inertialPhase == | 659 gesture_event.data.scrollUpdate.inertialPhase == |
660 blink::WebGestureEvent::MomentumPhase) { | 660 blink::WebGestureEvent::MomentumPhase) { |
661 return; | 661 return; |
662 } | 662 } |
663 host_->ForwardGestureEvent(gesture_event); | 663 host_->ForwardGestureEvent(gesture_event); |
664 return; | 664 return; |
665 } | 665 } |
666 } | 666 } |
667 | 667 |
668 } // namespace content | 668 } // namespace content |
OLD | NEW |