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

Side by Side Diff: content/browser/renderer_host/input/web_input_event_util.cc

Issue 321563002: Support minimum gesture bounds in GestureProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 6 years, 6 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
« no previous file with comments | « no previous file | ui/events/gesture_detection/gesture_config_helper_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/input/web_input_event_util.h" 5 #include "content/browser/renderer_host/input/web_input_event_util.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "content/common/input/web_touch_event_traits.h" 8 #include "content/common/input/web_touch_event_traits.h"
9 #include "ui/events/gesture_detection/gesture_event_data.h" 9 #include "ui/events/gesture_detection/gesture_event_data.h"
10 #include "ui/events/gesture_detection/motion_event.h" 10 #include "ui/events/gesture_detection/motion_event.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 234 }
235 235
236 WebGestureEvent CreateWebGestureEventFromGestureEventData( 236 WebGestureEvent CreateWebGestureEventFromGestureEventData(
237 const ui::GestureEventData& data) { 237 const ui::GestureEventData& data) {
238 WebGestureEvent gesture; 238 WebGestureEvent gesture;
239 gesture.x = data.x; 239 gesture.x = data.x;
240 gesture.y = data.y; 240 gesture.y = data.y;
241 gesture.timeStampSeconds = (data.time - base::TimeTicks()).InSecondsF(); 241 gesture.timeStampSeconds = (data.time - base::TimeTicks()).InSecondsF();
242 gesture.sourceDevice = blink::WebGestureDeviceTouchscreen; 242 gesture.sourceDevice = blink::WebGestureDeviceTouchscreen;
243 243
244 switch (data.type) { 244 switch (data.type()) {
245 case ui::ET_GESTURE_SHOW_PRESS: 245 case ui::ET_GESTURE_SHOW_PRESS:
246 gesture.type = WebInputEvent::GestureShowPress; 246 gesture.type = WebInputEvent::GestureShowPress;
247 gesture.data.showPress.width = data.details.bounding_box_f().width(); 247 gesture.data.showPress.width = data.details.bounding_box_f().width();
248 gesture.data.showPress.height = data.details.bounding_box_f().height(); 248 gesture.data.showPress.height = data.details.bounding_box_f().height();
249 break; 249 break;
250 case ui::ET_GESTURE_DOUBLE_TAP: 250 case ui::ET_GESTURE_DOUBLE_TAP:
251 gesture.type = WebInputEvent::GestureDoubleTap; 251 gesture.type = WebInputEvent::GestureDoubleTap;
252 DCHECK_EQ(1, data.details.tap_count()); 252 DCHECK_EQ(1, data.details.tap_count());
253 gesture.data.tap.tapCount = data.details.tap_count(); 253 gesture.data.tap.tapCount = data.details.tap_count();
254 gesture.data.tap.width = data.details.bounding_box_f().width(); 254 gesture.data.tap.width = data.details.bounding_box_f().width();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 break; 324 break;
325 default: 325 default:
326 NOTREACHED() << "ui::EventType provided wasn't a valid gesture event."; 326 NOTREACHED() << "ui::EventType provided wasn't a valid gesture event.";
327 break; 327 break;
328 } 328 }
329 329
330 return gesture; 330 return gesture;
331 } 331 }
332 332
333 } // namespace content 333 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ui/events/gesture_detection/gesture_config_helper_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698