| 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 #include <utility> |
| 8 |
| 7 #if defined(USE_X11) | 9 #if defined(USE_X11) |
| 8 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
| 9 #include <X11/keysym.h> | 11 #include <X11/keysym.h> |
| 10 #include <X11/Xlib.h> | 12 #include <X11/Xlib.h> |
| 11 #endif | 13 #endif |
| 12 | 14 |
| 13 #include <cmath> | 15 #include <cmath> |
| 14 #include <cstring> | 16 #include <cstring> |
| 15 | 17 |
| 16 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
| (...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 | 756 |
| 755 if (rhs.extended_key_event_data_) | 757 if (rhs.extended_key_event_data_) |
| 756 extended_key_event_data_.reset(rhs.extended_key_event_data_->Clone()); | 758 extended_key_event_data_.reset(rhs.extended_key_event_data_->Clone()); |
| 757 } | 759 } |
| 758 return *this; | 760 return *this; |
| 759 } | 761 } |
| 760 | 762 |
| 761 KeyEvent::~KeyEvent() {} | 763 KeyEvent::~KeyEvent() {} |
| 762 | 764 |
| 763 void KeyEvent::SetExtendedKeyEventData(scoped_ptr<ExtendedKeyEventData> data) { | 765 void KeyEvent::SetExtendedKeyEventData(scoped_ptr<ExtendedKeyEventData> data) { |
| 764 extended_key_event_data_ = data.Pass(); | 766 extended_key_event_data_ = std::move(data); |
| 765 } | 767 } |
| 766 | 768 |
| 767 void KeyEvent::ApplyLayout() const { | 769 void KeyEvent::ApplyLayout() const { |
| 768 ui::DomCode code = code_; | 770 ui::DomCode code = code_; |
| 769 if (code == DomCode::NONE) { | 771 if (code == DomCode::NONE) { |
| 770 // Catch old code that tries to do layout without a physical key, and try | 772 // Catch old code that tries to do layout without a physical key, and try |
| 771 // to recover using the KeyboardCode. Once key events are fully defined | 773 // to recover using the KeyboardCode. Once key events are fully defined |
| 772 // on construction (see TODO in event.h) this will go away. | 774 // on construction (see TODO in event.h) this will go away. |
| 773 VLOG(2) << "DomCode::NONE keycode=" << key_code_; | 775 VLOG(2) << "DomCode::NONE keycode=" << key_code_; |
| 774 code = UsLayoutKeyboardCodeToDomCode(key_code_); | 776 code = UsLayoutKeyboardCodeToDomCode(key_code_); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 gfx::PointF(x, y), | 981 gfx::PointF(x, y), |
| 980 time_stamp, | 982 time_stamp, |
| 981 flags | EF_FROM_TOUCH), | 983 flags | EF_FROM_TOUCH), |
| 982 details_(details) { | 984 details_(details) { |
| 983 } | 985 } |
| 984 | 986 |
| 985 GestureEvent::~GestureEvent() { | 987 GestureEvent::~GestureEvent() { |
| 986 } | 988 } |
| 987 | 989 |
| 988 } // namespace ui | 990 } // namespace ui |
| OLD | NEW |