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 1625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1636 if (overscroll_controller_) | 1636 if (overscroll_controller_) |
1637 overscroll_controller_->OnGestureEventAck(event, ack_result); | 1637 overscroll_controller_->OnGestureEventAck(event, ack_result); |
1638 | 1638 |
1639 if (content_view_core_) | 1639 if (content_view_core_) |
1640 content_view_core_->OnGestureEventAck(event, ack_result); | 1640 content_view_core_->OnGestureEventAck(event, ack_result); |
1641 } | 1641 } |
1642 | 1642 |
1643 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( | 1643 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( |
1644 const blink::WebInputEvent& input_event) { | 1644 const blink::WebInputEvent& input_event) { |
1645 if (selection_controller_) { | 1645 if (selection_controller_) { |
1646 switch (input_event.type) { | 1646 const blink::WebGestureEvent& gesture_event = |
jdduke (slow)
2015/05/01 20:52:06
Hmm, this cast isn't safe for non-gesture events.
Donn Denman
2015/05/01 22:46:03
Done.
| |
1647 case blink::WebInputEvent::GestureLongPress: | 1647 static_cast<const blink::WebGestureEvent&>(input_event); |
1648 selection_controller_->OnLongPressEvent(); | 1648 gfx::PointF gesture_location(gesture_event.x, gesture_event.y); |
1649 break; | 1649 if (input_event.type == blink::WebInputEvent::GestureLongPress) { |
1650 case blink::WebInputEvent::GestureTap: | 1650 if (selection_controller_->WillHandleLongPressEvent(gesture_location)) { |
jdduke (slow)
2015/05/01 20:52:06
Nit: No need for braces for this if conditional.
Donn Denman
2015/05/01 22:46:03
Done.
| |
1651 selection_controller_->OnTapEvent(); | 1651 return INPUT_EVENT_ACK_STATE_CONSUMED; |
1652 break; | 1652 } |
1653 default: | 1653 } else if (input_event.type == blink::WebInputEvent::GestureTap) { |
1654 break; | 1654 if (selection_controller_->WillHandleTapEvent(gesture_location)) |
1655 return INPUT_EVENT_ACK_STATE_CONSUMED; | |
1655 } | 1656 } |
1656 } | 1657 } |
1657 | 1658 |
1658 if (overscroll_controller_ && | 1659 if (overscroll_controller_ && |
1659 blink::WebInputEvent::isGestureEventType(input_event.type) && | 1660 blink::WebInputEvent::isGestureEventType(input_event.type) && |
1660 overscroll_controller_->WillHandleGestureEvent( | 1661 overscroll_controller_->WillHandleGestureEvent( |
1661 static_cast<const blink::WebGestureEvent&>(input_event))) { | 1662 static_cast<const blink::WebGestureEvent&>(input_event))) { |
1662 return INPUT_EVENT_ACK_STATE_CONSUMED; | 1663 return INPUT_EVENT_ACK_STATE_CONSUMED; |
1663 } | 1664 } |
1664 | 1665 |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2076 results->orientationAngle = display.RotationAsDegree(); | 2077 results->orientationAngle = display.RotationAsDegree(); |
2077 results->orientationType = | 2078 results->orientationType = |
2078 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 2079 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
2079 gfx::DeviceDisplayInfo info; | 2080 gfx::DeviceDisplayInfo info; |
2080 results->depth = info.GetBitsPerPixel(); | 2081 results->depth = info.GetBitsPerPixel(); |
2081 results->depthPerComponent = info.GetBitsPerComponent(); | 2082 results->depthPerComponent = info.GetBitsPerComponent(); |
2082 results->isMonochrome = (results->depthPerComponent == 0); | 2083 results->isMonochrome = (results->depthPerComponent == 0); |
2083 } | 2084 } |
2084 | 2085 |
2085 } // namespace content | 2086 } // namespace content |
OLD | NEW |