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

Side by Side Diff: ios/web/shell/app_delegate.mm

Issue 1149323004: Upstream the iOS web_shell and supporting code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web-thread-impl
Patch Set: Address review comments 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 | « ios/web/shell/app_delegate.h ('k') | ios/web/shell/shell_browser_state.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 2014 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 "ios/web/shell/app_delegate.h"
6
7 #import "base/mac/scoped_nsobject.h"
8 #include "base/memory/scoped_ptr.h"
9 #include "ios/web/public/app/web_main.h"
10 #include "ios/web/public/web_client.h"
11 #include "ios/web/public/web_state/web_state.h"
12 #include "ios/web/shell/shell_browser_state.h"
13 #include "ios/web/shell/shell_main_delegate.h"
14 #include "ios/web/shell/shell_web_client.h"
15 #import "ios/web/shell/view_controller.h"
16
17 @interface AppDelegate () {
18 scoped_ptr<web::ShellMainDelegate> _delegate;
19 scoped_ptr<web::WebMain> _webMain;
20 }
21 @end
22
23 @implementation AppDelegate
24
25 @synthesize window = _window;
26
27 - (BOOL)application:(UIApplication*)application
28 didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
29 _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
30 self.window.backgroundColor = [UIColor whiteColor];
31
32 _delegate.reset(new web::ShellMainDelegate());
33 web::WebMainParams params(_delegate.get());
34 _webMain.reset(new web::WebMain(params));
35
36 web::ShellWebClient* client =
37 static_cast<web::ShellWebClient*>(web::GetWebClient());
38 web::BrowserState* browserState = client->browser_state();
39
40 base::scoped_nsobject<ViewController> controller(
41 [[ViewController alloc] initWithBrowserState:browserState]);
42 self.window.rootViewController = controller;
43 [self.window makeKeyAndVisible];
44 return YES;
45 }
46
47 - (void)applicationWillResignActive:(UIApplication*)application {
48 }
49
50 - (void)applicationDidEnterBackground:(UIApplication*)application {
51 }
52
53 - (void)applicationWillEnterForeground:(UIApplication*)application {
54 }
55
56 - (void)applicationDidBecomeActive:(UIApplication*)application {
57 }
58
59 - (void)applicationWillTerminate:(UIApplication*)application {
60 _webMain.reset();
61 _delegate.reset();
62 }
63
64 @end
OLDNEW
« no previous file with comments | « ios/web/shell/app_delegate.h ('k') | ios/web/shell/shell_browser_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698