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

Unified Diff: sky/shell/ios/sky_surface.mm

Issue 1187503003: Refactor SkyShell to allow multiple SkyViews (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
Index: sky/shell/ios/sky_surface.mm
diff --git a/sky/shell/ios/sky_surface.mm b/sky/shell/ios/sky_surface.mm
index d8056de84be340b5ef24f8ff7d26072376583706..2eea5a89cb747112c48285b37c105c865b45027e 100644
--- a/sky/shell/ios/sky_surface.mm
+++ b/sky/shell/ios/sky_surface.mm
@@ -38,6 +38,14 @@ static inline sky::EventType EventTypeFromUITouchPhase(UITouchPhase phase) {
BOOL _platformViewInitialized;
sky::ViewportObserverPtr _viewport_observer;
+ scoped_ptr<sky::shell::Instance> _instance;
+}
+
+-(instancetype) initWithSkyInstance:(sky::shell::Instance *) instance {
+ self = [super init];
+ if (self)
+ _instance.reset(instance);
+ return self;
}
- (gfx::AcceleratedWidget)acceleratedWidget {
@@ -80,8 +88,7 @@ static inline sky::EventType EventTypeFromUITouchPhase(UITouchPhase phase) {
}
- (sky::shell::PlatformViewIOS*)platformView {
- auto view = static_cast<sky::shell::PlatformViewIOS*>(
- sky::shell::Shell::Shared().view());
+ auto view = static_cast<sky::shell::PlatformViewIOS*>(_instance->view());
DCHECK(view);
return view;
}
@@ -95,7 +102,7 @@ static inline sky::EventType EventTypeFromUITouchPhase(UITouchPhase phase) {
}
- (void)connectToViewportObserverAndLoad {
- auto view = sky::shell::Shell::Shared().view();
+ auto view = static_cast<sky::shell::PlatformViewIOS*>(_instance->view());
auto interface_request = mojo::GetProxy(&_viewport_observer);
view->ConnectToViewportObserver(interface_request.Pass());

Powered by Google App Engine
This is Rietveld 408576698