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

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

Issue 10825254: Remove views::KeyEvent, replacing uses of it with ui::KeyEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/events/event.h ('k') | ui/views/events/event_aura.cc » ('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/views/events/event.h" 5 #include "ui/views/events/event.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/keycodes/keyboard_code_conversion.h" 8 #include "ui/base/keycodes/keyboard_code_conversion.h"
9 #include "ui/views/view.h" 9 #include "ui/views/view.h"
10 #include "ui/views/widget/root_view.h" 10 #include "ui/views/widget/root_view.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 View::ConvertPointToView(source, target, &location_); 58 View::ConvertPointToView(source, target, &location_);
59 } 59 }
60 60
61 LocatedEvent::LocatedEvent(const LocatedEvent& model, View* root) 61 LocatedEvent::LocatedEvent(const LocatedEvent& model, View* root)
62 : Event(model), 62 : Event(model),
63 location_(model.location_) { 63 location_(model.location_) {
64 View::ConvertPointFromWidget(root, &location_); 64 View::ConvertPointFromWidget(root, &location_);
65 } 65 }
66 66
67 //////////////////////////////////////////////////////////////////////////////// 67 ////////////////////////////////////////////////////////////////////////////////
68 // KeyEvent, public:
69
70 #if !defined(USE_AURA)
71 KeyEvent::KeyEvent(const NativeEvent& native_event)
72 : Event(native_event,
73 ui::EventTypeFromNative(native_event),
74 ui::EventFlagsFromNative(native_event)),
75 key_code_(ui::KeyboardCodeFromNative(native_event)),
76 character_(0),
77 unmodified_character_(0) {
78 }
79 #endif
80
81 KeyEvent::KeyEvent(ui::EventType type,
82 ui::KeyboardCode key_code,
83 int event_flags)
84 : Event(type, event_flags),
85 key_code_(key_code),
86 character_(ui::GetCharacterFromKeyCode(key_code, event_flags)),
87 unmodified_character_(0) {
88 }
89
90 ////////////////////////////////////////////////////////////////////////////////
91 // MouseEvent, public: 68 // MouseEvent, public:
92 69
93 MouseEvent::MouseEvent(const NativeEvent& native_event) 70 MouseEvent::MouseEvent(const NativeEvent& native_event)
94 : LocatedEvent(native_event) { 71 : LocatedEvent(native_event) {
95 } 72 }
96 73
97 MouseEvent::MouseEvent(const MouseEvent& model, View* source, View* target) 74 MouseEvent::MouseEvent(const MouseEvent& model, View* source, View* target)
98 : LocatedEvent(model, source, target) { 75 : LocatedEvent(model, source, target) {
99 } 76 }
100 77
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 #endif 216 #endif
240 217
241 GestureEventForTest::GestureEventForTest(ui::EventType type, 218 GestureEventForTest::GestureEventForTest(ui::EventType type,
242 int x, 219 int x,
243 int y, 220 int y,
244 int flags) 221 int flags)
245 : GestureEvent(type, x, y, flags) { 222 : GestureEvent(type, x, y, flags) {
246 } 223 }
247 224
248 } // namespace views 225 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/events/event.h ('k') | ui/views/events/event_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698