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

Side by Side Diff: sky/shell/ios/sky_app_delegate.mm

Issue 1171573002: Basic Sky shell for iOS targets (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Service provider platform task runner refactor to be platform agnostic 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 unified diff | Download patch
« no previous file with comments | « sky/shell/ios/sky_app_delegate.h ('k') | sky/shell/ios/sky_surface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "sky_app_delegate.h"
6 #import "sky_view_controller.h"
7
8 #include "sky/shell/shell.h"
9 #include "sky/shell/service_provider.h"
10 #include "sky/shell/ui_delegate.h"
11 #include "base/lazy_instance.h"
12 #include "base/message_loop/message_loop.h"
13
14 @implementation SkyAppDelegate {
15 base::LazyInstance<scoped_ptr<base::MessageLoop>> _main_message_loop;
16 }
17
18 - (BOOL)application:(UIApplication*)application
19 didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
20 [self setupSkyShell];
21 [self setupViewport];
22
23 return YES;
24 }
25
26 - (void)setupSkyShell {
27 [self adoptPlatformRunLoop];
28
29 auto service_provider_context =
30 make_scoped_ptr(new sky::shell::ServiceProviderContext(
31 _main_message_loop.Get()->task_runner()));
32 sky::shell::Shell::Init(service_provider_context.Pass());
33 }
34
35 - (void)adoptPlatformRunLoop {
36 _main_message_loop.Get().reset(new base::MessageLoopForUI);
37 // One cannot start the message loop on the platform main thread. Instead,
38 // we attach to the CFRunLoop
39 base::MessageLoopForUI::current()->Attach();
40 }
41
42 - (void)setupViewport {
43 CGRect frame = [UIScreen mainScreen].bounds;
44 UIWindow* window = [[UIWindow alloc] initWithFrame:frame];
45 SkyViewController* viewController = [[SkyViewController alloc] init];
46 window.rootViewController = viewController;
47 [viewController release];
48 self.window = window;
49 [window release];
50 [self.window makeKeyAndVisible];
51 }
52
53 @end
OLDNEW
« no previous file with comments | « sky/shell/ios/sky_app_delegate.h ('k') | sky/shell/ios/sky_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698