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

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

Issue 10827271: Replace views::Event with ui::Event. (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.cc ('k') | ui/views/examples/bubble_example.h » ('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/event.h" 8 #include "ui/base/event.h"
9 #include "ui/base/keycodes/keyboard_code_conversion.h" 9 #include "ui/base/keycodes/keyboard_code_conversion.h"
10 10
11 namespace views { 11 namespace views {
12 12
13 //////////////////////////////////////////////////////////////////////////////// 13 ////////////////////////////////////////////////////////////////////////////////
14 // LocatedEvent, protected: 14 // LocatedEvent, protected:
15 15
16 LocatedEvent::LocatedEvent(const NativeEvent& native_event) 16 LocatedEvent::LocatedEvent(const ui::NativeEvent& native_event)
17 : Event(native_event, native_event->type(), native_event->flags()), 17 : Event(native_event->native_event(),
18 native_event->type(),
19 native_event->flags()),
18 location_(static_cast<ui::LocatedEvent*>(native_event)->location()) { 20 location_(static_cast<ui::LocatedEvent*>(native_event)->location()) {
19 } 21 }
20 22
21 //////////////////////////////////////////////////////////////////////////////// 23 ////////////////////////////////////////////////////////////////////////////////
22 // TouchEvent, public: 24 // TouchEvent, public:
23 25
24 TouchEvent::TouchEvent(const NativeEvent& event) 26 TouchEvent::TouchEvent(const ui::NativeEvent& event)
25 : LocatedEvent(event), 27 : LocatedEvent(event),
26 touch_id_(static_cast<ui::TouchEvent*>(event)->touch_id()), 28 touch_id_(static_cast<ui::TouchEvent*>(event)->touch_id()),
27 radius_x_(static_cast<ui::TouchEvent*>(event)->radius_x()), 29 radius_x_(static_cast<ui::TouchEvent*>(event)->radius_x()),
28 radius_y_(static_cast<ui::TouchEvent*>(event)->radius_y()), 30 radius_y_(static_cast<ui::TouchEvent*>(event)->radius_y()),
29 rotation_angle_( 31 rotation_angle_(
30 static_cast<ui::TouchEvent*>(event)->rotation_angle()), 32 static_cast<ui::TouchEvent*>(event)->rotation_angle()),
31 force_(static_cast<ui::TouchEvent*>(event)->force()) { 33 force_(static_cast<ui::TouchEvent*>(event)->force()) {
32 } 34 }
33 35
34 //////////////////////////////////////////////////////////////////////////////// 36 ////////////////////////////////////////////////////////////////////////////////
35 // MouseWheelEvent, public: 37 // MouseWheelEvent, public:
36 38
37 MouseWheelEvent::MouseWheelEvent(const NativeEvent& native_event) 39 MouseWheelEvent::MouseWheelEvent(const ui::NativeEvent& native_event)
38 : MouseEvent(native_event), 40 : MouseEvent(native_event),
39 offset_(ui::GetMouseWheelOffset(native_event->native_event())) { 41 offset_(ui::GetMouseWheelOffset(native_event->native_event())) {
40 } 42 }
41 43
42 //////////////////////////////////////////////////////////////////////////////// 44 ////////////////////////////////////////////////////////////////////////////////
43 // ScrollEvent, public: 45 // ScrollEvent, public:
44 46
45 ScrollEvent::ScrollEvent(const NativeEvent& native_event) 47 ScrollEvent::ScrollEvent(const ui::NativeEvent& native_event)
46 : MouseEvent(native_event) { 48 : MouseEvent(native_event) {
47 CHECK(ui::GetScrollOffsets( 49 CHECK(ui::GetScrollOffsets(
48 native_event->native_event(), &x_offset_, &y_offset_)); 50 native_event->native_event(), &x_offset_, &y_offset_));
49 } 51 }
50 52
51 //////////////////////////////////////////////////////////////////////////////// 53 ////////////////////////////////////////////////////////////////////////////////
52 // GestureEvent, public: 54 // GestureEvent, public:
53 55
54 GestureEvent::GestureEvent(const NativeEvent& event) 56 GestureEvent::GestureEvent(const ui::NativeEvent& event)
55 : LocatedEvent(event), 57 : LocatedEvent(event),
56 details_(static_cast<ui::GestureEvent*>(event)->details()) { 58 details_(static_cast<ui::GestureEvent*>(event)->details()) {
57 } 59 }
58 60
59 } // namespace views 61 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/events/event.cc ('k') | ui/views/examples/bubble_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698