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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 1102933003: [Contextual Search] Add support for tap on the selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated unit tests as suggested by Jared. Created 5 years, 7 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 (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 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1551 InputEventAckState ack_result) { 1551 InputEventAckState ack_result) {
1552 if (overscroll_controller_) 1552 if (overscroll_controller_)
1553 overscroll_controller_->OnGestureEventAck(event, ack_result); 1553 overscroll_controller_->OnGestureEventAck(event, ack_result);
1554 1554
1555 if (content_view_core_) 1555 if (content_view_core_)
1556 content_view_core_->OnGestureEventAck(event, ack_result); 1556 content_view_core_->OnGestureEventAck(event, ack_result);
1557 } 1557 }
1558 1558
1559 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( 1559 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent(
1560 const blink::WebInputEvent& input_event) { 1560 const blink::WebInputEvent& input_event) {
1561 if (selection_controller_) { 1561 if (selection_controller_ &&
1562 switch (input_event.type) { 1562 blink::WebInputEvent::isGestureEventType(input_event.type)) {
1563 case blink::WebInputEvent::GestureLongPress: 1563 const blink::WebGestureEvent& gesture_event =
1564 selection_controller_->OnLongPressEvent(); 1564 static_cast<const blink::WebGestureEvent&>(input_event);
1565 break; 1565 gfx::PointF gesture_location(gesture_event.x, gesture_event.y);
1566 case blink::WebInputEvent::GestureTap: 1566 if (input_event.type == blink::WebInputEvent::GestureLongPress) {
1567 selection_controller_->OnTapEvent(); 1567 if (selection_controller_->WillHandleLongPressEvent(gesture_location))
1568 break; 1568 return INPUT_EVENT_ACK_STATE_CONSUMED;
1569 default: 1569 } else if (input_event.type == blink::WebInputEvent::GestureTap) {
1570 break; 1570 if (selection_controller_->WillHandleTapEvent(gesture_location))
1571 return INPUT_EVENT_ACK_STATE_CONSUMED;
1571 } 1572 }
1572 } 1573 }
1573 1574
1574 if (overscroll_controller_ && 1575 if (overscroll_controller_ &&
1575 blink::WebInputEvent::isGestureEventType(input_event.type) && 1576 blink::WebInputEvent::isGestureEventType(input_event.type) &&
1576 overscroll_controller_->WillHandleGestureEvent( 1577 overscroll_controller_->WillHandleGestureEvent(
1577 static_cast<const blink::WebGestureEvent&>(input_event))) { 1578 static_cast<const blink::WebGestureEvent&>(input_event))) {
1578 return INPUT_EVENT_ACK_STATE_CONSUMED; 1579 return INPUT_EVENT_ACK_STATE_CONSUMED;
1579 } 1580 }
1580 1581
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
1965 results->orientationAngle = display.RotationAsDegree(); 1966 results->orientationAngle = display.RotationAsDegree();
1966 results->orientationType = 1967 results->orientationType =
1967 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 1968 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
1968 gfx::DeviceDisplayInfo info; 1969 gfx::DeviceDisplayInfo info;
1969 results->depth = info.GetBitsPerPixel(); 1970 results->depth = info.GetBitsPerPixel();
1970 results->depthPerComponent = info.GetBitsPerComponent(); 1971 results->depthPerComponent = info.GetBitsPerComponent();
1971 results->isMonochrome = (results->depthPerComponent == 0); 1972 results->isMonochrome = (results->depthPerComponent == 0);
1972 } 1973 }
1973 1974
1974 } // namespace content 1975 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698