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" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // workaround for https://code.google.com/p/android/issues/detail?id=68174 | 82 // workaround for https://code.google.com/p/android/issues/detail?id=68174 |
83 { | 83 { |
84 base::android::ScopedJavaLocalFrame scoped_local_reference_frame(env); | 84 base::android::ScopedJavaLocalFrame scoped_local_reference_frame(env); |
85 window_ = ANativeWindow_fromSurface(env, jsurface); | 85 window_ = ANativeWindow_fromSurface(env, jsurface); |
86 } | 86 } |
87 delegate_->OnAcceleratedWidgetAvailable(window_, device_pixel_ratio); | 87 delegate_->OnAcceleratedWidgetAvailable(window_, device_pixel_ratio); |
88 } | 88 } |
89 | 89 |
90 void PlatformWindowAndroid::SurfaceDestroyed(JNIEnv* env, jobject obj) { | 90 void PlatformWindowAndroid::SurfaceDestroyed(JNIEnv* env, jobject obj) { |
91 DCHECK(window_); | 91 DCHECK(window_); |
| 92 delegate_->OnAcceleratedWidgetDestroyed(); |
92 ReleaseWindow(); | 93 ReleaseWindow(); |
93 delegate_->OnAcceleratedWidgetAvailable(gfx::kNullAcceleratedWidget, 0.f); | |
94 } | 94 } |
95 | 95 |
96 void PlatformWindowAndroid::SurfaceSetSize(JNIEnv* env, | 96 void PlatformWindowAndroid::SurfaceSetSize(JNIEnv* env, |
97 jobject obj, | 97 jobject obj, |
98 jint width, | 98 jint width, |
99 jint height, | 99 jint height, |
100 jfloat density) { | 100 jfloat density) { |
101 size_ = gfx::Size(static_cast<int>(width), static_cast<int>(height)); | 101 size_ = gfx::Size(static_cast<int>(width), static_cast<int>(height)); |
102 delegate_->OnBoundsChanged(gfx::Rect(size_)); | 102 delegate_->OnBoundsChanged(gfx::Rect(size_)); |
103 } | 103 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 214 |
215 void PlatformWindowAndroid::ConfineCursorToBounds(const gfx::Rect& bounds) { | 215 void PlatformWindowAndroid::ConfineCursorToBounds(const gfx::Rect& bounds) { |
216 NOTIMPLEMENTED(); | 216 NOTIMPLEMENTED(); |
217 } | 217 } |
218 | 218 |
219 PlatformImeController* PlatformWindowAndroid::GetPlatformImeController() { | 219 PlatformImeController* PlatformWindowAndroid::GetPlatformImeController() { |
220 return &platform_ime_controller_; | 220 return &platform_ime_controller_; |
221 } | 221 } |
222 | 222 |
223 } // namespace ui | 223 } // namespace ui |
OLD | NEW |