| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 void PlatformWindowAndroid::ReleaseWindow() { | 154 void PlatformWindowAndroid::ReleaseWindow() { |
| 155 ANativeWindow_release(window_); | 155 ANativeWindow_release(window_); |
| 156 window_ = NULL; | 156 window_ = NULL; |
| 157 } | 157 } |
| 158 | 158 |
| 159 //////////////////////////////////////////////////////////////////////////////// | 159 //////////////////////////////////////////////////////////////////////////////// |
| 160 // PlatformWindowAndroid, PlatformWindow implementation: | 160 // PlatformWindowAndroid, PlatformWindow implementation: |
| 161 | 161 |
| 162 void PlatformWindowAndroid::Show() { | 162 void PlatformWindowAndroid::Show() { |
| 163 if (!java_platform_window_android_.is_empty()) | 163 if (!java_platform_window_android_.is_uninitialized()) |
| 164 return; | 164 return; |
| 165 JNIEnv* env = base::android::AttachCurrentThread(); | 165 JNIEnv* env = base::android::AttachCurrentThread(); |
| 166 java_platform_window_android_ = JavaObjectWeakGlobalRef( | 166 java_platform_window_android_ = JavaObjectWeakGlobalRef( |
| 167 env, Java_PlatformWindowAndroid_createForActivity( | 167 env, Java_PlatformWindowAndroid_createForActivity( |
| 168 env, base::android::GetApplicationContext(), | 168 env, base::android::GetApplicationContext(), |
| 169 reinterpret_cast<jlong>(this), | 169 reinterpret_cast<jlong>(this), |
| 170 reinterpret_cast<jlong>(&platform_ime_controller_)).obj()); | 170 reinterpret_cast<jlong>(&platform_ime_controller_)).obj()); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void PlatformWindowAndroid::Hide() { | 173 void PlatformWindowAndroid::Hide() { |
| (...skipping 50 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 |