| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ozone/events_ozone.h" | 5 #include "ui/events/ozone/events_ozone.h" |
| 6 | 6 |
| 7 #include "ui/events/event.h" | 7 #include "ui/events/event.h" |
| 8 #include "ui/events/event_constants.h" | 8 #include "ui/events/event_constants.h" |
| 9 #include "ui/events/event_utils.h" | 9 #include "ui/events/event_utils.h" |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 | 38 |
| 39 gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) { | 39 gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) { |
| 40 return EventSystemLocationFromNative(native_event); | 40 return EventSystemLocationFromNative(native_event); |
| 41 } | 41 } |
| 42 | 42 |
| 43 int GetChangedMouseButtonFlagsFromNative( | 43 int GetChangedMouseButtonFlagsFromNative( |
| 44 const base::NativeEvent& native_event) { | 44 const base::NativeEvent& native_event) { |
| 45 const ui::MouseEvent* event = | 45 const ui::MouseEvent* event = |
| 46 static_cast<const ui::MouseEvent*>(native_event); | 46 static_cast<const ui::MouseEvent*>(native_event); |
| 47 DCHECK(event->IsMouseEvent()); | 47 DCHECK(event->IsMouseEvent() || event->IsScrollEvent()); |
| 48 return event->changed_button_flags(); | 48 return event->changed_button_flags(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) { | 51 KeyboardCode KeyboardCodeFromNative(const base::NativeEvent& native_event) { |
| 52 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event); | 52 const ui::KeyEvent* event = static_cast<const ui::KeyEvent*>(native_event); |
| 53 DCHECK(event->IsKeyEvent()); | 53 DCHECK(event->IsKeyEvent()); |
| 54 return event->key_code(); | 54 return event->key_code(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 const char* CodeFromNative(const base::NativeEvent& native_event) { | 57 const char* CodeFromNative(const base::NativeEvent& native_event) { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 callback.Run(&touch_event); | 207 callback.Run(&touch_event); |
| 208 } else if (native_ui_event->IsScrollEvent()) { | 208 } else if (native_ui_event->IsScrollEvent()) { |
| 209 ui::ScrollEvent scroll_event(native_event); | 209 ui::ScrollEvent scroll_event(native_event); |
| 210 callback.Run(&scroll_event); | 210 callback.Run(&scroll_event); |
| 211 } else { | 211 } else { |
| 212 NOTREACHED(); | 212 NOTREACHED(); |
| 213 } | 213 } |
| 214 } | 214 } |
| 215 | 215 |
| 216 } // namespace ui | 216 } // namespace ui |
| OLD | NEW |