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

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

Issue 10832282: Replace views::MouseEvent with ui::MouseEvent (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/touchui/touch_selection_controller_impl.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/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 MouseEvent::MouseEvent(const ui::NativeEvent& native_event)
14 : LocatedEvent(static_cast<const ui::LocatedEvent&>(*native_event)) {
15 }
16
17 //////////////////////////////////////////////////////////////////////////////// 13 ////////////////////////////////////////////////////////////////////////////////
18 // TouchEvent, public: 14 // TouchEvent, public:
19 15
20 TouchEvent::TouchEvent(const ui::NativeEvent& event) 16 TouchEvent::TouchEvent(const ui::NativeEvent& event)
21 : LocatedEvent(static_cast<const ui::LocatedEvent&>(*event)), 17 : LocatedEvent(static_cast<const ui::LocatedEvent&>(*event)),
22 touch_id_(static_cast<ui::TouchEvent*>(event)->touch_id()), 18 touch_id_(static_cast<ui::TouchEvent*>(event)->touch_id()),
23 radius_x_(static_cast<ui::TouchEvent*>(event)->radius_x()), 19 radius_x_(static_cast<ui::TouchEvent*>(event)->radius_x()),
24 radius_y_(static_cast<ui::TouchEvent*>(event)->radius_y()), 20 radius_y_(static_cast<ui::TouchEvent*>(event)->radius_y()),
25 rotation_angle_( 21 rotation_angle_(
26 static_cast<ui::TouchEvent*>(event)->rotation_angle()), 22 static_cast<ui::TouchEvent*>(event)->rotation_angle()),
27 force_(static_cast<ui::TouchEvent*>(event)->force()) { 23 force_(static_cast<ui::TouchEvent*>(event)->force()) {
28 } 24 }
29 25
30 //////////////////////////////////////////////////////////////////////////////// 26 ////////////////////////////////////////////////////////////////////////////////
31 // MouseWheelEvent, public: 27 // MouseWheelEvent, public:
32 28
33 MouseWheelEvent::MouseWheelEvent(const ui::NativeEvent& native_event) 29 MouseWheelEvent::MouseWheelEvent(const ui::NativeEvent& native_event)
34 : MouseEvent(native_event), 30 : MouseEvent(static_cast<const ui::MouseEvent&>(*native_event)),
35 offset_(ui::GetMouseWheelOffset(native_event->native_event())) { 31 offset_(ui::GetMouseWheelOffset(native_event->native_event())) {
36 } 32 }
37 33
38 //////////////////////////////////////////////////////////////////////////////// 34 ////////////////////////////////////////////////////////////////////////////////
39 // ScrollEvent, public: 35 // ScrollEvent, public:
40 36
41 ScrollEvent::ScrollEvent(const ui::NativeEvent& native_event) 37 ScrollEvent::ScrollEvent(const ui::NativeEvent& native_event)
42 : MouseEvent(native_event) { 38 : MouseEvent(static_cast<const ui::MouseEvent&>(*native_event)) {
43 CHECK(ui::GetScrollOffsets( 39 CHECK(ui::GetScrollOffsets(
44 native_event->native_event(), &x_offset_, &y_offset_)); 40 native_event->native_event(), &x_offset_, &y_offset_));
45 } 41 }
46 42
47 //////////////////////////////////////////////////////////////////////////////// 43 ////////////////////////////////////////////////////////////////////////////////
48 // GestureEvent, public: 44 // GestureEvent, public:
49 45
50 GestureEvent::GestureEvent(const ui::NativeEvent& event) 46 GestureEvent::GestureEvent(const ui::NativeEvent& event)
51 : LocatedEvent(static_cast<const ui::LocatedEvent&>(*event)), 47 : LocatedEvent(static_cast<const ui::LocatedEvent&>(*event)),
52 details_(static_cast<ui::GestureEvent*>(event)->details()) { 48 details_(static_cast<ui::GestureEvent*>(event)->details()) {
53 } 49 }
54 50
55 } // namespace views 51 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/events/event.cc ('k') | ui/views/touchui/touch_selection_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698