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

Side by Side Diff: ui/events/events_default.cc

Issue 2849083002: Add pointer id to the WebMouseEvent's constructors (Closed)
Patch Set: webmouseid Created 3 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ui/events/event.h" 5 #include "ui/events/event.h"
6 #include "ui/events/event_constants.h" 6 #include "ui/events/event_constants.h"
7 #include "ui/events/event_utils.h" 7 #include "ui/events/event_utils.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 DCHECK(event->IsMouseEvent() || event->IsScrollEvent()); 47 DCHECK(event->IsMouseEvent() || event->IsScrollEvent());
48 return event->changed_button_flags(); 48 return event->changed_button_flags();
49 } 49 }
50 50
51 PointerDetails GetMousePointerDetailsFromNative( 51 PointerDetails GetMousePointerDetailsFromNative(
52 const base::NativeEvent& native_event) { 52 const base::NativeEvent& native_event) {
53 const ui::MouseEvent* event = 53 const ui::MouseEvent* event =
54 static_cast<const ui::MouseEvent*>(native_event); 54 static_cast<const ui::MouseEvent*>(native_event);
55 DCHECK(event->IsMouseEvent() || event->IsScrollEvent()); 55 DCHECK(event->IsMouseEvent() || event->IsScrollEvent());
56 PointerDetails pointer_detail = event->pointer_details(); 56 PointerDetails pointer_detail = event->pointer_details();
57 pointer_detail.id = MouseEvent::kMousePointerId; 57 pointer_detail.id = MouseEvent::kDefaultMousePointerId;
58 return pointer_detail; 58 return pointer_detail;
59 } 59 }
60 60
61 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) { 61 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) {
62 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event); 62 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event);
63 DCHECK(event->IsKeyEvent()); 63 DCHECK(event->IsKeyEvent());
64 return event->key_code(); 64 return event->key_code();
65 } 65 }
66 66
67 DomCode CodeFromNative(const base::NativeEvent& native_event) { 67 DomCode CodeFromNative(const base::NativeEvent& native_event) {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 *vx_ordinal = event->x_offset_ordinal(); 159 *vx_ordinal = event->x_offset_ordinal();
160 if (vy_ordinal) 160 if (vy_ordinal)
161 *vy_ordinal = event->y_offset_ordinal(); 161 *vy_ordinal = event->y_offset_ordinal();
162 if (is_cancel) 162 if (is_cancel)
163 *is_cancel = event->type() == ET_SCROLL_FLING_CANCEL; 163 *is_cancel = event->type() == ET_SCROLL_FLING_CANCEL;
164 164
165 return true; 165 return true;
166 } 166 }
167 167
168 } // namespace ui 168 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698