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

Side by Side Diff: content/common/input/synthetic_web_input_event_builders.cc

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse constructor Created 3 years, 8 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 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/common/input/synthetic_web_input_event_builders.h" 5 #include "content/common/input/synthetic_web_input_event_builders.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.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/base_event_utils.h" 9 #include "ui/events/base_event_utils.h"
10 #include "ui/events/event.h" 10 #include "ui/events/event.h"
(...skipping 21 matching lines...) Expand all
32 int window_y, 32 int window_y,
33 int modifiers, 33 int modifiers,
34 blink::WebPointerProperties::PointerType pointer_type) { 34 blink::WebPointerProperties::PointerType pointer_type) {
35 DCHECK(WebInputEvent::isMouseEventType(type)); 35 DCHECK(WebInputEvent::isMouseEventType(type));
36 WebMouseEvent result(type, modifiers, 36 WebMouseEvent result(type, modifiers,
37 ui::EventTimeStampToSeconds(ui::EventTimeForNow())); 37 ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
38 result.x = window_x; 38 result.x = window_x;
39 result.y = window_y; 39 result.y = window_y;
40 result.setModifiers(modifiers); 40 result.setModifiers(modifiers);
41 result.pointerType = pointer_type; 41 result.pointerType = pointer_type;
42 result.id = ui::PointerEvent::kMousePointerId; 42 result.id = ui::MouseEvent::kMousePointerId;
43 return result; 43 return result;
44 } 44 }
45 45
46 WebMouseWheelEvent SyntheticWebMouseWheelEventBuilder::Build( 46 WebMouseWheelEvent SyntheticWebMouseWheelEventBuilder::Build(
47 WebMouseWheelEvent::Phase phase) { 47 WebMouseWheelEvent::Phase phase) {
48 WebMouseWheelEvent result(WebInputEvent::MouseWheel, 48 WebMouseWheelEvent result(WebInputEvent::MouseWheel,
49 WebInputEvent::NoModifiers, 49 WebInputEvent::NoModifiers,
50 ui::EventTimeStampToSeconds(ui::EventTimeForNow())); 50 ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
51 result.phase = phase; 51 result.phase = phase;
52 return result; 52 return result;
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 249
250 int SyntheticWebTouchEvent::FirstFreeIndex() { 250 int SyntheticWebTouchEvent::FirstFreeIndex() {
251 for (size_t i = 0; i < kTouchesLengthCap; ++i) { 251 for (size_t i = 0; i < kTouchesLengthCap; ++i) {
252 if (touches[i].state == WebTouchPoint::StateUndefined) 252 if (touches[i].state == WebTouchPoint::StateUndefined)
253 return i; 253 return i;
254 } 254 }
255 return -1; 255 return -1;
256 } 256 }
257 257
258 } // namespace content 258 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698