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

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: 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/ios/sky_surface.h ('k') | sky/shell/ios/sky_view_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e6629ed8b2099f0e18ee6ae4bfa967dea0d5fced 100644
--- a/sky/shell/ios/sky_surface.mm
+++ b/sky/shell/ios/sky_surface.mm
@@ -8,9 +8,10 @@
#import <OpenGLES/EAGL.h>
#import <OpenGLES/EAGLDrawable.h>
-#include "sky/shell/ui_delegate.h"
-#include "sky/shell/shell.h"
#include "sky/shell/ios/platform_view_ios.h"
+#include "sky/shell/shell.h"
+#include "sky/shell/shell_view.h"
+#include "sky/shell/ui_delegate.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "sky/services/viewport/input_event.mojom.h"
@@ -38,6 +39,14 @@ static inline sky::EventType EventTypeFromUITouchPhase(UITouchPhase phase) {
BOOL _platformViewInitialized;
sky::ViewportObserverPtr _viewport_observer;
+ scoped_ptr<sky::shell::ShellView> _shell_view;
+}
+
+-(instancetype) initWithShellView:(sky::shell::ShellView *) shellView {
+ self = [super init];
+ if (self)
+ _shell_view.reset(shellView);
+ return self;
}
- (gfx::AcceleratedWidget)acceleratedWidget {
@@ -80,8 +89,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*>(_shell_view->view());
DCHECK(view);
return view;
}
@@ -95,7 +103,7 @@ static inline sky::EventType EventTypeFromUITouchPhase(UITouchPhase phase) {
}
- (void)connectToViewportObserverAndLoad {
- auto view = sky::shell::Shell::Shared().view();
+ auto view = static_cast<sky::shell::PlatformViewIOS*>(_shell_view->view());
auto interface_request = mojo::GetProxy(&_viewport_observer);
view->ConnectToViewportObserver(interface_request.Pass());
« no previous file with comments | « sky/shell/ios/sky_surface.h ('k') | sky/shell/ios/sky_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698