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

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

Issue 304793003: use enum to specify deviceSource for fling animation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed desired #include 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 | Annotate | Revision Log
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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 return result; 233 return result;
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 = WebGestureEvent::Touchscreen; 242 gesture.sourceDevice = blink::WebGestureDeviceTouchpad;
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());
(...skipping 71 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

Powered by Google App Engine
This is Rietveld 408576698