From 1f1946c798359499a2789ce7d5c5efe746f1460f Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 15 Jun 2015 15:10:48 -0700 Subject: [PATCH] Fix iOS builds after ShellView refactor on Android BUG= R=abarth@chromium.org Review URL: https://codereview.chromium.org/1188633002. --- engine/src/flutter/shell/BUILD.gn | 2 ++ engine/src/flutter/shell/ios/platform_view_ios.h | 2 ++ engine/src/flutter/shell/ios/platform_view_ios.mm | 7 +++++++ engine/src/flutter/shell/ios/sky_surface.h | 1 + engine/src/flutter/shell/ios/sky_surface.mm | 3 +-- engine/src/flutter/shell/ios/sky_view_controller.mm | 4 ++-- 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/shell/BUILD.gn b/engine/src/flutter/shell/BUILD.gn index 85fc2dd02e..64b88ddd26 100644 --- a/engine/src/flutter/shell/BUILD.gn +++ b/engine/src/flutter/shell/BUILD.gn @@ -157,6 +157,8 @@ if (is_android) { "platform_view.h", "shell.cc", "shell.h", + "shell_view.cc", + "shell_view.h", "ui/animator.cc", "ui/animator.h", "ui/engine.cc", diff --git a/engine/src/flutter/shell/ios/platform_view_ios.h b/engine/src/flutter/shell/ios/platform_view_ios.h index 19e0e1822c..a9e1ef6ffc 100644 --- a/engine/src/flutter/shell/ios/platform_view_ios.h +++ b/engine/src/flutter/shell/ios/platform_view_ios.h @@ -12,6 +12,8 @@ namespace shell { class PlatformViewIOS : public PlatformView { public: + explicit PlatformViewIOS(const Config& config); + ~PlatformViewIOS() override; void SurfaceCreated(gfx::AcceleratedWidget widget); void SurfaceDestroyed(void); diff --git a/engine/src/flutter/shell/ios/platform_view_ios.mm b/engine/src/flutter/shell/ios/platform_view_ios.mm index 492527733c..3c5f90d160 100644 --- a/engine/src/flutter/shell/ios/platform_view_ios.mm +++ b/engine/src/flutter/shell/ios/platform_view_ios.mm @@ -11,6 +11,13 @@ PlatformView* PlatformView::Create(const Config& config) { return new PlatformViewIOS(config); } +PlatformViewIOS::PlatformViewIOS(const Config& config) + : PlatformView(config) { +} + +PlatformViewIOS::~PlatformViewIOS() { +} + void PlatformViewIOS::SurfaceCreated(gfx::AcceleratedWidget widget) { DCHECK(window_ == 0); window_ = widget; diff --git a/engine/src/flutter/shell/ios/sky_surface.h b/engine/src/flutter/shell/ios/sky_surface.h index e0eb4bb369..fea4f12fca 100644 --- a/engine/src/flutter/shell/ios/sky_surface.h +++ b/engine/src/flutter/shell/ios/sky_surface.h @@ -3,6 +3,7 @@ // found in the LICENSE file. #import +#import "sky/shell/shell_view.h" @interface SkySurface : UIView diff --git a/engine/src/flutter/shell/ios/sky_surface.mm b/engine/src/flutter/shell/ios/sky_surface.mm index e6629ed8b2..c04a30351c 100644 --- a/engine/src/flutter/shell/ios/sky_surface.mm +++ b/engine/src/flutter/shell/ios/sky_surface.mm @@ -103,9 +103,8 @@ static inline sky::EventType EventTypeFromUITouchPhase(UITouchPhase phase) { } - (void)connectToViewportObserverAndLoad { - auto view = static_cast(_shell_view->view()); auto interface_request = mojo::GetProxy(&_viewport_observer); - view->ConnectToViewportObserver(interface_request.Pass()); + self.platformView->ConnectToViewportObserver(interface_request.Pass()); mojo::String string(self.skyInitialLoadURL.UTF8String); _viewport_observer->LoadURL(string); diff --git a/engine/src/flutter/shell/ios/sky_view_controller.mm b/engine/src/flutter/shell/ios/sky_view_controller.mm index 24bfef1c06..0cabeed32b 100644 --- a/engine/src/flutter/shell/ios/sky_view_controller.mm +++ b/engine/src/flutter/shell/ios/sky_view_controller.mm @@ -8,13 +8,13 @@ #import #import +#include "sky/shell/shell.h" #include "sky/shell/shell_view.h" @implementation SkyViewController - (void)loadView { - - ShellView* shell_view = new sky::shell::ShellView(sky::shell::Shell::Shared()); + auto shell_view = new sky::shell::ShellView(sky::shell::Shell::Shared()); SkySurface* surface = [[SkySurface alloc] initWithShellView: shell_view]; surface.autoresizingMask =