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

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

Issue 1410873012: events: Preserve pointer details in native MouseEvent constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix mac Created 5 years, 1 month 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/event.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 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 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #import "base/mac/mac_util.h" 10 #import "base/mac/mac_util.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 case NSOtherMouseDown: 127 case NSOtherMouseDown:
128 case NSOtherMouseUp: 128 case NSOtherMouseUp:
129 case NSOtherMouseDragged: 129 case NSOtherMouseDragged:
130 return EF_MIDDLE_MOUSE_BUTTON; 130 return EF_MIDDLE_MOUSE_BUTTON;
131 default: 131 default:
132 break; 132 break;
133 } 133 }
134 return 0; 134 return 0;
135 } 135 }
136 136
137 PointerDetails GetMousePointerDetailsFromNative(
138 const base::NativeEvent& native_event) {
139 return PointerDetails(EventPointerType::POINTER_TYPE_MOUSE);
140 }
141
137 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& event) { 142 gfx::Vector2d GetMouseWheelOffset(const base::NativeEvent& event) {
138 if ([event respondsToSelector:@selector(hasPreciseScrollingDeltas)] && 143 if ([event respondsToSelector:@selector(hasPreciseScrollingDeltas)] &&
139 [event hasPreciseScrollingDeltas]) { 144 [event hasPreciseScrollingDeltas]) {
140 // Handle continuous scrolling devices such as a Magic Mouse or a trackpad. 145 // Handle continuous scrolling devices such as a Magic Mouse or a trackpad.
141 // -scrollingDelta{X|Y} have float return types but they return values that 146 // -scrollingDelta{X|Y} have float return types but they return values that
142 // are already rounded to integers. 147 // are already rounded to integers.
143 // The values are the same as the values returned from calling 148 // The values are the same as the values returned from calling
144 // CGEventGetIntegerValueField(kCGScrollWheelEventPointDeltaAxis{1|2}). 149 // CGEventGetIntegerValueField(kCGScrollWheelEventPointDeltaAxis{1|2}).
145 return gfx::Vector2d([event scrollingDeltaX], [event scrollingDeltaY]); 150 return gfx::Vector2d([event scrollingDeltaX], [event scrollingDeltaY]);
146 } else { 151 } else {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 uint16 return_value; 265 uint16 return_value;
261 [text getCharacters:&return_value]; 266 [text getCharacters:&return_value];
262 return return_value; 267 return return_value;
263 } 268 }
264 269
265 bool IsCharFromNative(const base::NativeEvent& native_event) { 270 bool IsCharFromNative(const base::NativeEvent& native_event) {
266 return false; 271 return false;
267 } 272 }
268 273
269 } // namespace ui 274 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698