| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/platform_window/android/platform_window_android.h" | 5 #include "ui/platform_window/android/platform_window_android.h" |
| 6 | 6 |
| 7 #include <android/input.h> | 7 #include <android/input.h> |
| 8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
| 9 | 9 |
| 10 #include "base/android/context_utils.h" | 10 #include "base/android/context_utils.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 jfloat y, | 115 jfloat y, |
| 116 jfloat pressure, | 116 jfloat pressure, |
| 117 jfloat touch_major, | 117 jfloat touch_major, |
| 118 jfloat touch_minor, | 118 jfloat touch_minor, |
| 119 jfloat orientation, | 119 jfloat orientation, |
| 120 jfloat h_wheel, | 120 jfloat h_wheel, |
| 121 jfloat v_wheel) { | 121 jfloat v_wheel) { |
| 122 ui::EventType event_type = MotionEventActionToEventType(masked_action); | 122 ui::EventType event_type = MotionEventActionToEventType(masked_action); |
| 123 if (event_type == ui::ET_UNKNOWN) | 123 if (event_type == ui::ET_UNKNOWN) |
| 124 return false; | 124 return false; |
| 125 ui::TouchEvent touch(event_type, gfx::Point(), ui::EF_NONE, pointer_id, | 125 ui::TouchEvent touch( |
| 126 base::TimeDelta::FromMilliseconds(time_ms), touch_major, | 126 event_type, gfx::Point(), ui::EF_NONE, pointer_id, |
| 127 touch_minor, orientation, pressure); | 127 base::TimeTicks() + base::TimeDelta::FromMilliseconds(time_ms), |
| 128 touch_major, touch_minor, orientation, pressure); |
| 128 touch.set_location_f(gfx::PointF(x, y)); | 129 touch.set_location_f(gfx::PointF(x, y)); |
| 129 touch.set_root_location_f(gfx::PointF(x, y)); | 130 touch.set_root_location_f(gfx::PointF(x, y)); |
| 130 delegate_->DispatchEvent(&touch); | 131 delegate_->DispatchEvent(&touch); |
| 131 return true; | 132 return true; |
| 132 } | 133 } |
| 133 | 134 |
| 134 bool PlatformWindowAndroid::KeyEvent(JNIEnv* env, | 135 bool PlatformWindowAndroid::KeyEvent(JNIEnv* env, |
| 135 const JavaParamRef<jobject>& obj, | 136 const JavaParamRef<jobject>& obj, |
| 136 bool pressed, | 137 bool pressed, |
| 137 jint key_code, | 138 jint key_code, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 221 |
| 221 void PlatformWindowAndroid::ConfineCursorToBounds(const gfx::Rect& bounds) { | 222 void PlatformWindowAndroid::ConfineCursorToBounds(const gfx::Rect& bounds) { |
| 222 NOTIMPLEMENTED(); | 223 NOTIMPLEMENTED(); |
| 223 } | 224 } |
| 224 | 225 |
| 225 PlatformImeController* PlatformWindowAndroid::GetPlatformImeController() { | 226 PlatformImeController* PlatformWindowAndroid::GetPlatformImeController() { |
| 226 return &platform_ime_controller_; | 227 return &platform_ime_controller_; |
| 227 } | 228 } |
| 228 | 229 |
| 229 } // namespace ui | 230 } // namespace ui |
| OLD | NEW |