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

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: 1st cut at unit tests 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 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 InputEventAckState ack_result) { 1555 InputEventAckState ack_result) {
1556 if (overscroll_controller_) 1556 if (overscroll_controller_)
1557 overscroll_controller_->OnGestureEventAck(event, ack_result); 1557 overscroll_controller_->OnGestureEventAck(event, ack_result);
1558 1558
1559 if (content_view_core_) 1559 if (content_view_core_)
1560 content_view_core_->OnGestureEventAck(event, ack_result); 1560 content_view_core_->OnGestureEventAck(event, ack_result);
1561 } 1561 }
1562 1562
1563 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent( 1563 InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent(
1564 const blink::WebInputEvent& input_event) { 1564 const blink::WebInputEvent& input_event) {
1565 if (selection_controller_) { 1565 if (selection_controller_ &&
1566 switch (input_event.type) { 1566 blink::WebInputEvent::isGestureEventType(input_event.type)) {
1567 case blink::WebInputEvent::GestureLongPress: 1567 const blink::WebGestureEvent& gesture_event =
1568 selection_controller_->OnLongPressEvent(); 1568 static_cast<const blink::WebGestureEvent&>(input_event);
1569 break; 1569 gfx::PointF gesture_location(gesture_event.x, gesture_event.y);
1570 case blink::WebInputEvent::GestureTap: 1570 if (input_event.type == blink::WebInputEvent::GestureLongPress) {
1571 selection_controller_->OnTapEvent(); 1571 if (selection_controller_->WillHandleLongPressEvent(gesture_location))
1572 break; 1572 return INPUT_EVENT_ACK_STATE_CONSUMED;
1573 default: 1573 } else if (input_event.type == blink::WebInputEvent::GestureTap) {
1574 break; 1574 if (selection_controller_->WillHandleTapEvent(gesture_location))
1575 return INPUT_EVENT_ACK_STATE_CONSUMED;
1575 } 1576 }
1576 } 1577 }
1577 1578
1578 if (overscroll_controller_ && 1579 if (overscroll_controller_ &&
1579 blink::WebInputEvent::isGestureEventType(input_event.type) && 1580 blink::WebInputEvent::isGestureEventType(input_event.type) &&
1580 overscroll_controller_->WillHandleGestureEvent( 1581 overscroll_controller_->WillHandleGestureEvent(
1581 static_cast<const blink::WebGestureEvent&>(input_event))) { 1582 static_cast<const blink::WebGestureEvent&>(input_event))) {
1582 return INPUT_EVENT_ACK_STATE_CONSUMED; 1583 return INPUT_EVENT_ACK_STATE_CONSUMED;
1583 } 1584 }
1584 1585
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1967 results->orientationAngle = display.RotationAsDegree(); 1968 results->orientationAngle = display.RotationAsDegree();
1968 results->orientationType = 1969 results->orientationType =
1969 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); 1970 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display);
1970 gfx::DeviceDisplayInfo info; 1971 gfx::DeviceDisplayInfo info;
1971 results->depth = info.GetBitsPerPixel(); 1972 results->depth = info.GetBitsPerPixel();
1972 results->depthPerComponent = info.GetBitsPerComponent(); 1973 results->depthPerComponent = info.GetBitsPerComponent();
1973 results->isMonochrome = (results->depthPerComponent == 0); 1974 results->isMonochrome = (results->depthPerComponent == 0);
1974 } 1975 }
1975 1976
1976 } // namespace content 1977 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698