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

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

Issue 1765693002: Revert of IPC::ParamTraits for ui::Event (towards ui::Events over mojo IPC) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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/event.h ('k') | ui/events/events.gyp » ('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 #include <utility> 7 #include <utility>
8 8
9 #if defined(USE_X11) 9 #if defined(USE_X11)
10 #include <X11/extensions/XInput2.h> 10 #include <X11/extensions/XInput2.h>
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 kMaxAutoRepeatTimeMs) { 837 kMaxAutoRepeatTimeMs) {
838 last_key_event_->set_time_stamp(event.time_stamp()); 838 last_key_event_->set_time_stamp(event.time_stamp());
839 last_key_event_->set_flags(last_key_event_->flags() | ui::EF_IS_REPEAT); 839 last_key_event_->set_flags(last_key_event_->flags() | ui::EF_IS_REPEAT);
840 return true; 840 return true;
841 } 841 }
842 delete last_key_event_; 842 delete last_key_event_;
843 last_key_event_ = new KeyEvent(event); 843 last_key_event_ = new KeyEvent(event);
844 return false; 844 return false;
845 } 845 }
846 846
847 KeyEvent::KeyEvent(EventType type, base::TimeDelta time_stamp, int flags)
848 : Event(type, time_stamp, flags) {}
849
850 KeyEvent::KeyEvent(const base::NativeEvent& native_event) 847 KeyEvent::KeyEvent(const base::NativeEvent& native_event)
851 : Event(native_event, 848 : Event(native_event,
852 EventTypeFromNative(native_event), 849 EventTypeFromNative(native_event),
853 EventFlagsFromNative(native_event)), 850 EventFlagsFromNative(native_event)),
854 key_code_(KeyboardCodeFromNative(native_event)), 851 key_code_(KeyboardCodeFromNative(native_event)),
855 code_(CodeFromNative(native_event)), 852 code_(CodeFromNative(native_event)),
856 is_char_(IsCharFromNative(native_event)) { 853 is_char_(IsCharFromNative(native_event)) {
857 if (IsRepeated(*this)) 854 if (IsRepeated(*this))
858 set_flags(flags() | ui::EF_IS_REPEAT); 855 set_flags(flags() | ui::EF_IS_REPEAT);
859 856
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 gfx::PointF(x, y), 1144 gfx::PointF(x, y),
1148 time_stamp, 1145 time_stamp,
1149 flags | EF_FROM_TOUCH), 1146 flags | EF_FROM_TOUCH),
1150 details_(details) { 1147 details_(details) {
1151 } 1148 }
1152 1149
1153 GestureEvent::~GestureEvent() { 1150 GestureEvent::~GestureEvent() {
1154 } 1151 }
1155 1152
1156 } // namespace ui 1153 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/event.h ('k') | ui/events/events.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698