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

Unified Diff: sky/shell/android/platform_view_android.h

Issue 1187503003: Refactor SkyShell to allow multiple SkyViews (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: s/instance/sky_shell/ Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/shell/BUILD.gn ('k') | sky/shell/android/platform_view_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/android/platform_view_android.h
diff --git a/sky/shell/android/platform_view_android.h b/sky/shell/android/platform_view_android.h
index 72c8bba079a76cc04a642537a3a1b5b16466f0bc..4f3f908e6119c1cb91b41d47c650778306aefe2b 100644
--- a/sky/shell/android/platform_view_android.h
+++ b/sky/shell/android/platform_view_android.h
@@ -11,10 +11,13 @@ struct ANativeWindow;
namespace sky {
namespace shell {
+class ShellView;
class PlatformViewAndroid : public PlatformView {
public:
static bool Register(JNIEnv* env);
+
+ PlatformViewAndroid(const Config& config);
~PlatformViewAndroid() override;
// Called from Java
@@ -22,9 +25,17 @@ class PlatformViewAndroid : public PlatformView {
void SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface);
void SurfaceDestroyed(JNIEnv* env, jobject obj);
+ void SetShellView(scoped_ptr<ShellView> shell_view);
+
private:
void ReleaseWindow();
+ // In principle, the ShellView should own the PlatformView, but because our
+ // lifetime is controlled by the Android view hierarchy, we flip around the
+ // ownership and have the shell_view owned by Java. We reset this pointer in
+ // |Detach|, which will eventually cause |~PlatformViewAndroid|.
+ scoped_ptr<ShellView> shell_view_;
+
DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroid);
};
« no previous file with comments | « sky/shell/BUILD.gn ('k') | sky/shell/android/platform_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698