| Index: services/native_viewport/platform_viewport_android.cc
|
| diff --git a/services/native_viewport/platform_viewport_android.cc b/services/native_viewport/platform_viewport_android.cc
|
| index a19d5c0dea643194bc5df660e9c88d2776b0c9c7..4a6d2b173b682f8bb04c4ade828151c6c12b4a30 100644
|
| --- a/services/native_viewport/platform_viewport_android.cc
|
| +++ b/services/native_viewport/platform_viewport_android.cc
|
| @@ -148,10 +148,7 @@ bool PlatformViewportAndroid::TouchEvent(JNIEnv* env,
|
|
|
| void PlatformViewportAndroid::Init(const gfx::Rect& bounds) {
|
| JNIEnv* env = base::android::AttachCurrentThread();
|
| - java_platform_viewport_android_ = JavaObjectWeakGlobalRef(
|
| - env,
|
| - Java_PlatformViewportAndroid_create(env, reinterpret_cast<jlong>(this))
|
| - .obj());
|
| + Java_PlatformViewportAndroid_createNativeWindow(env);
|
| }
|
|
|
| void PlatformViewportAndroid::Show() {
|
| @@ -177,6 +174,14 @@ void PlatformViewportAndroid::SetBounds(const gfx::Rect& bounds) {
|
| NOTIMPLEMENTED();
|
| }
|
|
|
| +bool PlatformViewportAndroid::NewNativeSurfaceAvailable() {
|
| + JNIEnv* env = base::android::AttachCurrentThread();
|
| + java_platform_viewport_android_ = JavaObjectWeakGlobalRef(
|
| + env, Java_PlatformViewportAndroid_create(
|
| + env, reinterpret_cast<jlong>(this)).obj());
|
| + return true;
|
| +}
|
| +
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // PlatformViewportAndroid, private:
|
|
|
| @@ -190,8 +195,8 @@ void PlatformViewportAndroid::ReleaseWindow() {
|
|
|
| // static
|
| scoped_ptr<PlatformViewport> PlatformViewport::Create(Delegate* delegate) {
|
| - return scoped_ptr<PlatformViewport>(
|
| - new PlatformViewportAndroid(delegate)).Pass();
|
| + return scoped_ptr<PlatformViewport>(new PlatformViewportAndroid(delegate))
|
| + .Pass();
|
| }
|
|
|
| } // namespace native_viewport
|
|
|