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/jni_android.h" | 10 #include "base/android/jni_android.h" |
11 #include "jni/PlatformWindowAndroid_jni.h" | 11 #include "jni/PlatformWindowAndroid_jni.h" |
12 #include "ui/events/event.h" | 12 #include "ui/events/event.h" |
13 #include "ui/events/keycodes/keyboard_code_conversion_android.h" | 13 #include "ui/events/keycodes/keyboard_code_conversion_android.h" |
14 #include "ui/gfx/geometry/point.h" | 14 #include "ui/gfx/geometry/point.h" |
15 #include "ui/platform_window/platform_window_delegate.h" | 15 #include "ui/platform_window/platform_window_delegate.h" |
16 | 16 |
17 namespace ui { | 17 namespace ui { |
18 | 18 |
| 19 // static |
| 20 scoped_ptr<PlatformWindow> PlatformWindow::Create( |
| 21 PlatformWindowDelegate* delegate, |
| 22 const gfx::Rect& bounds) { |
| 23 return new PlatformWindowAndroid(delegate); |
| 24 } |
| 25 |
19 namespace { | 26 namespace { |
20 | 27 |
21 ui::EventType MotionEventActionToEventType(jint action) { | 28 ui::EventType MotionEventActionToEventType(jint action) { |
22 switch (action) { | 29 switch (action) { |
23 case AMOTION_EVENT_ACTION_DOWN: | 30 case AMOTION_EVENT_ACTION_DOWN: |
24 case AMOTION_EVENT_ACTION_POINTER_DOWN: | 31 case AMOTION_EVENT_ACTION_POINTER_DOWN: |
25 return ui::ET_TOUCH_PRESSED; | 32 return ui::ET_TOUCH_PRESSED; |
26 case AMOTION_EVENT_ACTION_UP: | 33 case AMOTION_EVENT_ACTION_UP: |
27 case AMOTION_EVENT_ACTION_POINTER_UP: | 34 case AMOTION_EVENT_ACTION_POINTER_UP: |
28 return ui::ET_TOUCH_RELEASED; | 35 return ui::ET_TOUCH_RELEASED; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 221 |
215 void PlatformWindowAndroid::ConfineCursorToBounds(const gfx::Rect& bounds) { | 222 void PlatformWindowAndroid::ConfineCursorToBounds(const gfx::Rect& bounds) { |
216 NOTIMPLEMENTED(); | 223 NOTIMPLEMENTED(); |
217 } | 224 } |
218 | 225 |
219 PlatformImeController* PlatformWindowAndroid::GetPlatformImeController() { | 226 PlatformImeController* PlatformWindowAndroid::GetPlatformImeController() { |
220 return &platform_ime_controller_; | 227 return &platform_ime_controller_; |
221 } | 228 } |
222 | 229 |
223 } // namespace ui | 230 } // namespace ui |
OLD | NEW |