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

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

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 | « ui/events/cocoa/events_mac.mm ('k') | ui/events/event_utils.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 6
7 #if defined(USE_X11) 7 #if defined(USE_X11)
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/keysym.h> 9 #include <X11/keysym.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 location_ = p.AsPointF(); 313 location_ = p.AsPointF();
314 root_location_ = location_; 314 root_location_ = location_;
315 } 315 }
316 316
317 //////////////////////////////////////////////////////////////////////////////// 317 ////////////////////////////////////////////////////////////////////////////////
318 // MouseEvent 318 // MouseEvent
319 319
320 MouseEvent::MouseEvent(const base::NativeEvent& native_event) 320 MouseEvent::MouseEvent(const base::NativeEvent& native_event)
321 : LocatedEvent(native_event), 321 : LocatedEvent(native_event),
322 changed_button_flags_(GetChangedMouseButtonFlagsFromNative(native_event)), 322 changed_button_flags_(GetChangedMouseButtonFlagsFromNative(native_event)),
323 pointer_details_(PointerDetails(EventPointerType::POINTER_TYPE_MOUSE)) { 323 pointer_details_(GetMousePointerDetailsFromNative(native_event)) {
324 if (type() == ET_MOUSE_PRESSED || type() == ET_MOUSE_RELEASED) 324 if (type() == ET_MOUSE_PRESSED || type() == ET_MOUSE_RELEASED)
325 SetClickCount(GetRepeatCount(*this)); 325 SetClickCount(GetRepeatCount(*this));
326 } 326 }
327 327
328 MouseEvent::MouseEvent(EventType type, 328 MouseEvent::MouseEvent(EventType type,
329 const gfx::Point& location, 329 const gfx::Point& location,
330 const gfx::Point& root_location, 330 const gfx::Point& root_location,
331 base::TimeDelta time_stamp, 331 base::TimeDelta time_stamp,
332 int flags, 332 int flags,
333 int changed_button_flags) 333 int changed_button_flags)
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 gfx::PointF(x, y), 974 gfx::PointF(x, y),
975 time_stamp, 975 time_stamp,
976 flags | EF_FROM_TOUCH), 976 flags | EF_FROM_TOUCH),
977 details_(details) { 977 details_(details) {
978 } 978 }
979 979
980 GestureEvent::~GestureEvent() { 980 GestureEvent::~GestureEvent() {
981 } 981 }
982 982
983 } // namespace ui 983 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/cocoa/events_mac.mm ('k') | ui/events/event_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698