OLD | NEW |
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/aura/event.h" | 5 #include "ui/aura/event.h" |
6 | 6 |
7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 } | 306 } |
307 | 307 |
308 base::TimeDelta TouchEvent::GetTimestamp() const { | 308 base::TimeDelta TouchEvent::GetTimestamp() const { |
309 return time_stamp(); | 309 return time_stamp(); |
310 } | 310 } |
311 | 311 |
312 TouchEvent* TouchEvent::Copy() const { | 312 TouchEvent* TouchEvent::Copy() const { |
313 #if defined(OS_WIN) | 313 #if defined(OS_WIN) |
314 if (native_event().message) | 314 if (native_event().message) |
315 return new TouchEvent(::CopyNativeEvent(native_event())); | 315 return new TouchEvent(::CopyNativeEvent(native_event())); |
316 #else | |
317 if (native_event()) | |
318 return new TouchEvent(::CopyNativeEvent(native_event())); | |
319 #endif | 316 #endif |
320 return new TouchEvent(*this, NULL, NULL); | 317 return new TouchEvent(*this, NULL, NULL); |
321 } | 318 } |
322 | 319 |
323 KeyEvent::KeyEvent(const base::NativeEvent& native_event, bool is_char) | 320 KeyEvent::KeyEvent(const base::NativeEvent& native_event, bool is_char) |
324 : Event(native_event, | 321 : Event(native_event, |
325 ui::EventTypeFromNative(native_event), | 322 ui::EventTypeFromNative(native_event), |
326 ui::EventFlagsFromNative(native_event)), | 323 ui::EventFlagsFromNative(native_event)), |
327 key_code_(ui::KeyboardCodeFromNative(native_event)), | 324 key_code_(ui::KeyboardCodeFromNative(native_event)), |
328 is_char_(is_char), | 325 is_char_(is_char), |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 int GestureEvent::GetLowestTouchId() const { | 463 int GestureEvent::GetLowestTouchId() const { |
467 if (touch_ids_bitfield_ == 0) | 464 if (touch_ids_bitfield_ == 0) |
468 return -1; | 465 return -1; |
469 int i = -1; | 466 int i = -1; |
470 // Find the index of the least significant 1 bit | 467 // Find the index of the least significant 1 bit |
471 while (!(1 << ++i & touch_ids_bitfield_)); | 468 while (!(1 << ++i & touch_ids_bitfield_)); |
472 return i; | 469 return i; |
473 } | 470 } |
474 | 471 |
475 } // namespace aura | 472 } // namespace aura |
OLD | NEW |