| 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/event.h" | 5 #include "ui/events/event.h" |
| 6 #include "ui/events/event_constants.h" | 6 #include "ui/events/event_constants.h" |
| 7 #include "ui/events/event_utils.h" | 7 #include "ui/events/event_utils.h" |
| 8 | 8 |
| 9 namespace ui { | 9 namespace ui { |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 const ui::Event* event = static_cast<const ui::Event*>(native_event); | 24 const ui::Event* event = static_cast<const ui::Event*>(native_event); |
| 25 return event->type(); | 25 return event->type(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 gfx::Point EventSystemLocationFromNative( | 28 gfx::Point EventSystemLocationFromNative( |
| 29 const base::NativeEvent& native_event) { | 29 const base::NativeEvent& native_event) { |
| 30 const ui::LocatedEvent* e = | 30 const ui::LocatedEvent* e = |
| 31 static_cast<const ui::LocatedEvent*>(native_event); | 31 static_cast<const ui::LocatedEvent*>(native_event); |
| 32 DCHECK(e->IsMouseEvent() || e->IsTouchEvent() || e->IsGestureEvent() || | 32 DCHECK(e->IsMouseEvent() || e->IsTouchEvent() || e->IsGestureEvent() || |
| 33 e->IsScrollEvent()); | 33 e->IsScrollEvent()); |
| 34 return e->location(); | 34 return gfx::ToFlooredPoint(e->location()); |
| 35 } | 35 } |
| 36 | 36 |
| 37 gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) { | 37 gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) { |
| 38 return EventSystemLocationFromNative(native_event); | 38 return EventSystemLocationFromNative(native_event); |
| 39 } | 39 } |
| 40 | 40 |
| 41 int GetChangedMouseButtonFlagsFromNative( | 41 int GetChangedMouseButtonFlagsFromNative( |
| 42 const base::NativeEvent& native_event) { | 42 const base::NativeEvent& native_event) { |
| 43 const ui::MouseEvent* event = | 43 const ui::MouseEvent* event = |
| 44 static_cast<const ui::MouseEvent*>(native_event); | 44 static_cast<const ui::MouseEvent*>(native_event); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 NOTIMPLEMENTED(); | 146 NOTIMPLEMENTED(); |
| 147 return false; | 147 return false; |
| 148 } | 148 } |
| 149 | 149 |
| 150 int GetModifiersFromKeyState() { | 150 int GetModifiersFromKeyState() { |
| 151 NOTIMPLEMENTED(); | 151 NOTIMPLEMENTED(); |
| 152 return 0; | 152 return 0; |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace ui | 155 } // namespace ui |
| OLD | NEW |