| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_ | 5 #ifndef UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_ |
| 6 #define UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_ | 6 #define UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/android/jni_weak_ref.h" | 8 #include "base/android/jni_weak_ref.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "ui/events/event_constants.h" | 11 #include "ui/events/event_constants.h" |
| 12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
| 13 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
| 14 #include "ui/gfx/sequential_id_generator.h" | 14 #include "ui/gfx/sequential_id_generator.h" |
| 15 #include "ui/platform_window/android/android_window_export.h" |
| 15 #include "ui/platform_window/android/platform_ime_controller_android.h" | 16 #include "ui/platform_window/android/platform_ime_controller_android.h" |
| 16 #include "ui/platform_window/platform_window.h" | 17 #include "ui/platform_window/platform_window.h" |
| 17 | 18 |
| 18 struct ANativeWindow; | 19 struct ANativeWindow; |
| 19 | 20 |
| 20 namespace ui { | 21 namespace ui { |
| 21 | 22 |
| 22 class PlatformWindowAndroid : public PlatformWindow { | 23 class ANDROID_WINDOW_EXPORT PlatformWindowAndroid : public PlatformWindow { |
| 23 public: | 24 public: |
| 24 static bool Register(JNIEnv* env); | 25 static bool Register(JNIEnv* env); |
| 25 | 26 |
| 26 explicit PlatformWindowAndroid(PlatformWindowDelegate* delegate); | 27 explicit PlatformWindowAndroid(PlatformWindowDelegate* delegate); |
| 27 ~PlatformWindowAndroid() override; | 28 ~PlatformWindowAndroid() override; |
| 28 | 29 |
| 29 void Destroy(JNIEnv* env, jobject obj); | 30 void Destroy(JNIEnv* env, jobject obj); |
| 30 void SurfaceCreated(JNIEnv* env, | 31 void SurfaceCreated(JNIEnv* env, |
| 31 jobject obj, | 32 jobject obj, |
| 32 jobject jsurface, | 33 jobject jsurface, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 48 jfloat touch_major, | 49 jfloat touch_major, |
| 49 jfloat touch_minor, | 50 jfloat touch_minor, |
| 50 jfloat orientation, | 51 jfloat orientation, |
| 51 jfloat h_wheel, | 52 jfloat h_wheel, |
| 52 jfloat v_wheel); | 53 jfloat v_wheel); |
| 53 bool KeyEvent(JNIEnv* env, | 54 bool KeyEvent(JNIEnv* env, |
| 54 jobject obj, | 55 jobject obj, |
| 55 bool pressed, | 56 bool pressed, |
| 56 jint key_code, | 57 jint key_code, |
| 57 jint unicode_character); | 58 jint unicode_character); |
| 59 void FocusChanged(JNIEnv* env, jobject obj, bool gained_focus); |
| 58 | 60 |
| 59 private: | 61 private: |
| 60 void ReleaseWindow(); | 62 void ReleaseWindow(); |
| 61 | 63 |
| 62 // Overridden from PlatformWindow: | 64 // Overridden from PlatformWindow: |
| 63 void Show() override; | 65 void Show() override; |
| 64 void Hide() override; | 66 void Hide() override; |
| 65 void Close() override; | 67 void Close() override; |
| 66 void SetBounds(const gfx::Rect& bounds) override; | 68 void SetBounds(const gfx::Rect& bounds) override; |
| 67 gfx::Rect GetBounds() override; | 69 gfx::Rect GetBounds() override; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 87 PlatformImeControllerAndroid platform_ime_controller_; | 89 PlatformImeControllerAndroid platform_ime_controller_; |
| 88 | 90 |
| 89 base::WeakPtrFactory<PlatformWindowAndroid> weak_factory_; | 91 base::WeakPtrFactory<PlatformWindowAndroid> weak_factory_; |
| 90 | 92 |
| 91 DISALLOW_COPY_AND_ASSIGN(PlatformWindowAndroid); | 93 DISALLOW_COPY_AND_ASSIGN(PlatformWindowAndroid); |
| 92 }; | 94 }; |
| 93 | 95 |
| 94 } // namespace ui | 96 } // namespace ui |
| 95 | 97 |
| 96 #endif // UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_ | 98 #endif // UI_PLATFORM_WINDOW_ANDROID_PLATFORM_WINDOW_ANDROID_H_ |
| OLD | NEW |