OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer_host/render_widget_host_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1552 InputEventAckState ack_result) { | 1552 InputEventAckState ack_result) { |
1553 if (overscroll_controller_) | 1553 if (overscroll_controller_) |
1554 overscroll_controller_->OnGestureEventAck(event, ack_result); | 1554 overscroll_controller_->OnGestureEventAck(event, ack_result); |
1555 | 1555 |
1556 if (content_view_core_) | 1556 if (content_view_core_) |
1557 content_view_core_->OnGestureEventAck(event, ack_result); | 1557 content_view_core_->OnGestureEventAck(event, ack_result); |
1558 } | 1558 } |
1559 | 1559 |
1560 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( | 1560 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( |
1561 const blink::WebInputEvent& input_event) { | 1561 const blink::WebInputEvent& input_event) { |
1562 if (selection_controller_) { | 1562 if (selection_controller_ && |
1563 switch (input_event.type) { | 1563 blink::WebInputEvent::isGestureEventType(input_event.type)) { |
1564 case blink::WebInputEvent::GestureLongPress: | 1564 const blink::WebGestureEvent& gesture_event = |
1565 selection_controller_->OnLongPressEvent(); | 1565 static_cast<const blink::WebGestureEvent&>(input_event); |
1566 break; | 1566 gfx::PointF gesture_location(gesture_event.x, gesture_event.y); |
1567 case blink::WebInputEvent::GestureTap: | 1567 if (input_event.type == blink::WebInputEvent::GestureLongPress) { |
1568 selection_controller_->OnTapEvent(); | 1568 if (selection_controller_->WillHandleLongPressEvent(gesture_location)) |
1569 break; | 1569 return INPUT_EVENT_ACK_STATE_CONSUMED; |
1570 default: | 1570 } else if (input_event.type == blink::WebInputEvent::GestureTap) { |
1571 break; | 1571 if (selection_controller_->WillHandleTapEvent(gesture_location)) |
| 1572 return INPUT_EVENT_ACK_STATE_CONSUMED; |
1572 } | 1573 } |
1573 } | 1574 } |
1574 | 1575 |
1575 if (overscroll_controller_ && | 1576 if (overscroll_controller_ && |
1576 blink::WebInputEvent::isGestureEventType(input_event.type) && | 1577 blink::WebInputEvent::isGestureEventType(input_event.type) && |
1577 overscroll_controller_->WillHandleGestureEvent( | 1578 overscroll_controller_->WillHandleGestureEvent( |
1578 static_cast<const blink::WebGestureEvent&>(input_event))) { | 1579 static_cast<const blink::WebGestureEvent&>(input_event))) { |
1579 return INPUT_EVENT_ACK_STATE_CONSUMED; | 1580 return INPUT_EVENT_ACK_STATE_CONSUMED; |
1580 } | 1581 } |
1581 | 1582 |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1966 results->orientationAngle = display.RotationAsDegree(); | 1967 results->orientationAngle = display.RotationAsDegree(); |
1967 results->orientationType = | 1968 results->orientationType = |
1968 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1969 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1969 gfx::DeviceDisplayInfo info; | 1970 gfx::DeviceDisplayInfo info; |
1970 results->depth = info.GetBitsPerPixel(); | 1971 results->depth = info.GetBitsPerPixel(); |
1971 results->depthPerComponent = info.GetBitsPerComponent(); | 1972 results->depthPerComponent = info.GetBitsPerComponent(); |
1972 results->isMonochrome = (results->depthPerComponent == 0); | 1973 results->isMonochrome = (results->depthPerComponent == 0); |
1973 } | 1974 } |
1974 | 1975 |
1975 } // namespace content | 1976 } // namespace content |
OLD | NEW |