| 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/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 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 } | 911 } |
| 912 | 912 |
| 913 std::string KeyEvent::GetCodeString() const { | 913 std::string KeyEvent::GetCodeString() const { |
| 914 return KeycodeConverter::DomCodeToCodeString(code_); | 914 return KeycodeConverter::DomCodeToCodeString(code_); |
| 915 } | 915 } |
| 916 | 916 |
| 917 //////////////////////////////////////////////////////////////////////////////// | 917 //////////////////////////////////////////////////////////////////////////////// |
| 918 // ScrollEvent | 918 // ScrollEvent |
| 919 | 919 |
| 920 ScrollEvent::ScrollEvent(const base::NativeEvent& native_event) | 920 ScrollEvent::ScrollEvent(const base::NativeEvent& native_event) |
| 921 : MouseEvent(native_event) { | 921 : MouseEvent(native_event), |
| 922 x_offset_(0.0f), |
| 923 y_offset_(0.0f), |
| 924 x_offset_ordinal_(0.0f), |
| 925 y_offset_ordinal_(0.0f), |
| 926 finger_count_(0) { |
| 922 if (type() == ET_SCROLL) { | 927 if (type() == ET_SCROLL) { |
| 923 GetScrollOffsets(native_event, | 928 GetScrollOffsets(native_event, |
| 924 &x_offset_, &y_offset_, | 929 &x_offset_, &y_offset_, |
| 925 &x_offset_ordinal_, &y_offset_ordinal_, | 930 &x_offset_ordinal_, &y_offset_ordinal_, |
| 926 &finger_count_); | 931 &finger_count_); |
| 927 } else if (type() == ET_SCROLL_FLING_START || | 932 } else if (type() == ET_SCROLL_FLING_START || |
| 928 type() == ET_SCROLL_FLING_CANCEL) { | 933 type() == ET_SCROLL_FLING_CANCEL) { |
| 929 GetFlingData(native_event, | 934 GetFlingData(native_event, |
| 930 &x_offset_, &y_offset_, | 935 &x_offset_, &y_offset_, |
| 931 &x_offset_ordinal_, &y_offset_ordinal_, | 936 &x_offset_ordinal_, &y_offset_ordinal_, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 gfx::PointF(x, y), | 979 gfx::PointF(x, y), |
| 975 time_stamp, | 980 time_stamp, |
| 976 flags | EF_FROM_TOUCH), | 981 flags | EF_FROM_TOUCH), |
| 977 details_(details) { | 982 details_(details) { |
| 978 } | 983 } |
| 979 | 984 |
| 980 GestureEvent::~GestureEvent() { | 985 GestureEvent::~GestureEvent() { |
| 981 } | 986 } |
| 982 | 987 |
| 983 } // namespace ui | 988 } // namespace ui |
| OLD | NEW |