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

Side by Side Diff: ui/events/cocoa/events_mac.mm

Issue 2655303004: Add id properties to PointerEvent (Closed)
Patch Set: pointer id Created 3 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_utils.h" 5 #include "ui/events/event_utils.h"
6 6
7 #include <Cocoa/Cocoa.h> 7 #include <Cocoa/Cocoa.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 case NSOtherMouseDragged: 128 case NSOtherMouseDragged:
129 return EF_MIDDLE_MOUSE_BUTTON; 129 return EF_MIDDLE_MOUSE_BUTTON;
130 default: 130 default:
131 break; 131 break;
132 } 132 }
133 return 0; 133 return 0;
134 } 134 }
135 135
136 PointerDetails GetMousePointerDetailsFromNative( 136 PointerDetails GetMousePointerDetailsFromNative(
137 const base::NativeEvent& native_event) { 137 const base::NativeEvent& native_event) {
138 return PointerDetails(EventPointerType::POINTER_TYPE_MOUSE); 138 return PointerDetails(EventPointerType::POINTER_TYPE_MOUSE,
139 PointerEvent::kMousePointerId);
139 } 140 }
140 141
141 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& event) { 142 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& event) {
142 if ([event hasPreciseScrollingDeltas]) { 143 if ([event hasPreciseScrollingDeltas]) {
143 // Handle continuous scrolling devices such as a Magic Mouse or a trackpad. 144 // Handle continuous scrolling devices such as a Magic Mouse or a trackpad.
144 // -scrollingDelta{X|Y} have float return types but they return values that 145 // -scrollingDelta{X|Y} have float return types but they return values that
145 // are already rounded to integers. 146 // are already rounded to integers.
146 // The values are the same as the values returned from calling 147 // The values are the same as the values returned from calling
147 // CGEventGetIntegerValueField(kCGScrollWheelEventPointDeltaAxis{1|2}). 148 // CGEventGetIntegerValueField(kCGScrollWheelEventPointDeltaAxis{1|2}).
148 return gfx::Vector2d([event scrollingDeltaX], [event scrollingDeltaY]); 149 return gfx::Vector2d([event scrollingDeltaX], [event scrollingDeltaY]);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 uint16_t return_value; 300 uint16_t return_value;
300 [text getCharacters:&return_value]; 301 [text getCharacters:&return_value];
301 return return_value; 302 return return_value;
302 } 303 }
303 304
304 bool IsCharFromNative(const base::NativeEvent& native_event) { 305 bool IsCharFromNative(const base::NativeEvent& native_event) {
305 return false; 306 return false;
306 } 307 }
307 308
308 } // namespace ui 309 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698