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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 return; | 656 return; |
657 } | 657 } |
658 | 658 |
659 if (blink::WebInputEvent::isGestureEventType(event->type)) { | 659 if (blink::WebInputEvent::isGestureEventType(event->type)) { |
660 host_->ForwardGestureEvent( | 660 host_->ForwardGestureEvent( |
661 *static_cast<const blink::WebGestureEvent*>(event)); | 661 *static_cast<const blink::WebGestureEvent*>(event)); |
662 return; | 662 return; |
663 } | 663 } |
664 } | 664 } |
665 | 665 |
| 666 namespace { |
| 667 |
| 668 bool IsScrollEvent(const blink::WebInputEvent& event) { |
| 669 return event.type == blink::WebInputEvent::GestureScrollBegin || |
| 670 event.type == blink::WebInputEvent::GestureScrollUpdate || |
| 671 event.type == blink::WebInputEvent::GestureScrollEnd || |
| 672 event.type == blink::WebInputEvent::MouseWheel; |
| 673 } |
| 674 |
| 675 } // namespace |
| 676 |
| 677 void RenderWidgetHostViewGuest::GestureEventAck( |
| 678 const blink::WebGestureEvent& event, |
| 679 InputEventAckState ack_result) { |
| 680 if (IsScrollEvent(event)) |
| 681 guest_->SendScrollCompletion(ack_result == INPUT_EVENT_ACK_STATE_CONSUMED); |
| 682 } |
| 683 |
| 684 void RenderWidgetHostViewGuest::WheelEventAck( |
| 685 const blink::WebMouseWheelEvent& event, |
| 686 InputEventAckState ack_result) { |
| 687 if (IsScrollEvent(event)) |
| 688 guest_->SendScrollCompletion(ack_result == INPUT_EVENT_ACK_STATE_CONSUMED); |
| 689 } |
| 690 |
666 } // namespace content | 691 } // namespace content |
OLD | NEW |