Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 2354283003: Disable direct routing of mouse events for RenderWidgetHostViewGuest (Closed)
Patch Set: Tweak Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 const blink::WebGestureEvent& event, 577 const blink::WebGestureEvent& event,
578 InputEventAckState ack_result) { 578 InputEventAckState ack_result) {
579 bool not_consumed = ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED || 579 bool not_consumed = ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED ||
580 ack_result == INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; 580 ack_result == INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS;
581 // GestureScrollBegin/End are always consumed by the guest, so we only 581 // GestureScrollBegin/End are always consumed by the guest, so we only
582 // forward GestureScrollUpdate. 582 // forward GestureScrollUpdate.
583 if (event.type == blink::WebInputEvent::GestureScrollUpdate && not_consumed) 583 if (event.type == blink::WebInputEvent::GestureScrollUpdate && not_consumed)
584 guest_->ResendEventToEmbedder(event); 584 guest_->ResendEventToEmbedder(event);
585 } 585 }
586 586
587 bool RenderWidgetHostViewGuest::IsRenderWidgetHostViewGuest() {
588 return true;
589 }
590
587 void RenderWidgetHostViewGuest::OnHandleInputEvent( 591 void RenderWidgetHostViewGuest::OnHandleInputEvent(
588 RenderWidgetHostImpl* embedder, 592 RenderWidgetHostImpl* embedder,
589 int browser_plugin_instance_id, 593 int browser_plugin_instance_id,
590 const blink::WebInputEvent* event) { 594 const blink::WebInputEvent* event) {
591 // WebMouseWheelEvents go into a queue, and may not be forwarded to the 595 // WebMouseWheelEvents go into a queue, and may not be forwarded to the
592 // renderer until after this method goes out of scope. Therefore we need to 596 // renderer until after this method goes out of scope. Therefore we need to
593 // explicitly remove the additional device scale factor from the coordinates 597 // explicitly remove the additional device scale factor from the coordinates
594 // before allowing the event to be queued. 598 // before allowing the event to be queued.
595 if (IsUseZoomForDSFEnabled() && 599 if (IsUseZoomForDSFEnabled() &&
596 event->type == blink::WebInputEvent::MouseWheel) { 600 event->type == blink::WebInputEvent::MouseWheel) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 gesture_event.data.scrollUpdate.inertialPhase == 676 gesture_event.data.scrollUpdate.inertialPhase ==
673 blink::WebGestureEvent::MomentumPhase) { 677 blink::WebGestureEvent::MomentumPhase) {
674 return; 678 return;
675 } 679 }
676 host_->ForwardGestureEvent(gesture_event); 680 host_->ForwardGestureEvent(gesture_event);
677 return; 681 return;
678 } 682 }
679 } 683 }
680 684
681 } // namespace content 685 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698