Allow native_viewport to create new native windows on demand on Android.
With this change, each time a new native viewport is initialized, an
intent is sent to create a new task for the shell. Then, once the new
task is ready, the requesting native viewport is notified of the
availability of the new native surface so it can attach to it.
There is still no specific support for the keyboard.
R=qsr@chromium.org
Review URL: https://codereview.chromium.org/1280613003 .
diff --git a/services/native_viewport/platform_viewport_android.h b/services/native_viewport/platform_viewport_android.h
index f9fd7ad..7905a6d 100644
--- a/services/native_viewport/platform_viewport_android.h
+++ b/services/native_viewport/platform_viewport_android.h
@@ -18,6 +18,10 @@
class GLInProcessContext;
}
+namespace mojo {
+class ApplicationImpl;
+}
+
struct ANativeWindow;
namespace native_viewport {
@@ -26,10 +30,12 @@
public:
static bool Register(JNIEnv* env);
- explicit PlatformViewportAndroid(Delegate* delegate);
+ explicit PlatformViewportAndroid(mojo::ApplicationImpl* application,
+ Delegate* delegate);
virtual ~PlatformViewportAndroid();
void Destroy(JNIEnv* env, jobject obj);
+ void SurfaceAttached(JNIEnv* env, jobject obj, jobject platform_viewport);
void SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface);
void SurfaceDestroyed(JNIEnv* env, jobject obj);
void SurfaceSetSize(JNIEnv* env,
@@ -62,6 +68,7 @@
void ReleaseWindow();
+ mojo::ApplicationImpl* application_;
Delegate* const delegate_;
JavaObjectWeakGlobalRef java_platform_viewport_android_;
ANativeWindow* window_;