Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: ui/platform_window/android/platform_window_android.cc

Issue 1406333003: aura: Support SurfaceDestroyed() on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wth2
Patch Set: comment Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/ozone/demo/ozone_demo.cc ('k') | ui/platform_window/platform_window_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/ozone/demo/ozone_demo.cc ('k') | ui/platform_window/platform_window_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698