| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 weak_factory_(this) { | 62 weak_factory_(this) { |
| 63 } | 63 } |
| 64 | 64 |
| 65 PlatformWindowAndroid::~PlatformWindowAndroid() { | 65 PlatformWindowAndroid::~PlatformWindowAndroid() { |
| 66 if (window_) | 66 if (window_) |
| 67 ReleaseWindow(); | 67 ReleaseWindow(); |
| 68 JNIEnv* env = base::android::AttachCurrentThread(); | 68 JNIEnv* env = base::android::AttachCurrentThread(); |
| 69 ScopedJavaLocalRef<jobject> scoped_obj = | 69 ScopedJavaLocalRef<jobject> scoped_obj = |
| 70 java_platform_window_android_.get(env); | 70 java_platform_window_android_.get(env); |
| 71 if (!scoped_obj.is_null()) { | 71 if (!scoped_obj.is_null()) { |
| 72 Java_PlatformWindowAndroid_detach(env, scoped_obj.obj()); | 72 Java_PlatformWindowAndroid_detach(env, scoped_obj); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 void PlatformWindowAndroid::Destroy(JNIEnv* env, | 76 void PlatformWindowAndroid::Destroy(JNIEnv* env, |
| 77 const JavaParamRef<jobject>& obj) { | 77 const JavaParamRef<jobject>& obj) { |
| 78 delegate_->OnClosed(); | 78 delegate_->OnClosed(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void PlatformWindowAndroid::SurfaceCreated( | 81 void PlatformWindowAndroid::SurfaceCreated( |
| 82 JNIEnv* env, | 82 JNIEnv* env, |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 224 |
| 225 void PlatformWindowAndroid::ConfineCursorToBounds(const gfx::Rect& bounds) { | 225 void PlatformWindowAndroid::ConfineCursorToBounds(const gfx::Rect& bounds) { |
| 226 NOTIMPLEMENTED(); | 226 NOTIMPLEMENTED(); |
| 227 } | 227 } |
| 228 | 228 |
| 229 PlatformImeController* PlatformWindowAndroid::GetPlatformImeController() { | 229 PlatformImeController* PlatformWindowAndroid::GetPlatformImeController() { |
| 230 return &platform_ime_controller_; | 230 return &platform_ime_controller_; |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace ui | 233 } // namespace ui |
| OLD | NEW |