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 "base/bind_helpers.h" | 5 #include "base/bind_helpers.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "cc/surfaces/surface.h" | 9 #include "cc/surfaces/surface.h" |
10 #include "cc/surfaces/surface_factory.h" | 10 #include "cc/surfaces/surface_factory.h" |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 | 625 |
626 RenderWidgetHostViewBase* | 626 RenderWidgetHostViewBase* |
627 RenderWidgetHostViewGuest::GetOwnerRenderWidgetHostView() const { | 627 RenderWidgetHostViewGuest::GetOwnerRenderWidgetHostView() const { |
628 return static_cast<RenderWidgetHostViewBase*>( | 628 return static_cast<RenderWidgetHostViewBase*>( |
629 guest_->GetOwnerRenderWidgetHostView()); | 629 guest_->GetOwnerRenderWidgetHostView()); |
630 } | 630 } |
631 | 631 |
632 void RenderWidgetHostViewGuest::WheelEventAck( | 632 void RenderWidgetHostViewGuest::WheelEventAck( |
633 const blink::WebMouseWheelEvent& event, | 633 const blink::WebMouseWheelEvent& event, |
634 InputEventAckState ack_result) { | 634 InputEventAckState ack_result) { |
635 if (ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED) | 635 if (ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED || |
| 636 ack_result == INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS) { |
636 guest_->ResendEventToEmbedder(event); | 637 guest_->ResendEventToEmbedder(event); |
| 638 } |
637 } | 639 } |
638 | 640 |
639 void RenderWidgetHostViewGuest::GestureEventAck( | 641 void RenderWidgetHostViewGuest::GestureEventAck( |
640 const blink::WebGestureEvent& event, | 642 const blink::WebGestureEvent& event, |
641 InputEventAckState ack_result) { | 643 InputEventAckState ack_result) { |
642 bool not_consumed = INPUT_EVENT_ACK_STATE_NOT_CONSUMED == ack_result; | 644 bool not_consumed = ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED || |
| 645 ack_result == INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
643 // GestureScrollBegin/End are always consumed by the guest, so we only | 646 // GestureScrollBegin/End are always consumed by the guest, so we only |
644 // forward GestureScrollUpdate. | 647 // forward GestureScrollUpdate. |
645 if (event.type == blink::WebInputEvent::GestureScrollUpdate && not_consumed) | 648 if (event.type == blink::WebInputEvent::GestureScrollUpdate && not_consumed) |
646 guest_->ResendEventToEmbedder(event); | 649 guest_->ResendEventToEmbedder(event); |
647 } | 650 } |
648 | 651 |
649 void RenderWidgetHostViewGuest::OnHandleInputEvent( | 652 void RenderWidgetHostViewGuest::OnHandleInputEvent( |
650 RenderWidgetHostImpl* embedder, | 653 RenderWidgetHostImpl* embedder, |
651 int browser_plugin_instance_id, | 654 int browser_plugin_instance_id, |
652 const gfx::Rect& guest_window_rect, | 655 const gfx::Rect& guest_window_rect, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate && | 717 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate && |
715 gesture_event.data.scrollUpdate.inertial) { | 718 gesture_event.data.scrollUpdate.inertial) { |
716 return; | 719 return; |
717 } | 720 } |
718 host_->ForwardGestureEvent(gesture_event); | 721 host_->ForwardGestureEvent(gesture_event); |
719 return; | 722 return; |
720 } | 723 } |
721 } | 724 } |
722 | 725 |
723 } // namespace content | 726 } // namespace content |
OLD | NEW |