Chromium Code Reviews| Index: ios/web_view/shell/shell_app_delegate.mm |
| diff --git a/ios/web_view/shell/shell_app_delegate.mm b/ios/web_view/shell/shell_app_delegate.mm |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a367d13e623fd96e6ff6200c23a46b2a7c4339b5 |
| --- /dev/null |
| +++ b/ios/web_view/shell/shell_app_delegate.mm |
| @@ -0,0 +1,53 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#import "ios/web_view/shell/shell_app_delegate.h" |
| + |
| +#import "base/mac/scoped_nsobject.h" |
| +#import "ios/web_view/public/criwv.h" |
| +#import "ios/web_view/shell/shell_delegate.h" |
| +#import "ios/web_view/shell/shell_view_controller.h" |
| + |
| +@interface ShellAppDelegate () { |
| + base::scoped_nsobject<ShellDelegate> _delegate; |
| +} |
| +@end |
| + |
| +@implementation ShellAppDelegate |
| + |
| +@synthesize window = _window; |
|
sdefresne
2017/01/20 10:28:13
_window is never deallocated and thus is leaked. C
michaeldo
2017/01/24 22:35:26
In dep CL, I added dealloc. Conversion to arc will
|
| + |
| +- (BOOL)application:(UIApplication*)application |
| + didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { |
| + _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
| + self.window.backgroundColor = [UIColor whiteColor]; |
| + |
| + _delegate.reset([[ShellDelegate alloc] init]); |
| + [CRIWV configureWithDelegate:_delegate]; |
| + [CRIWV installNetworkStack]; |
| + |
| + base::scoped_nsobject<ShellViewController> controller( |
| + [[ShellViewController alloc] init]); |
| + self.window.rootViewController = controller; |
| + [self.window makeKeyAndVisible]; |
| + return YES; |
| +} |
| + |
| +- (void)applicationWillResignActive:(UIApplication*)application { |
| +} |
| + |
| +- (void)applicationDidEnterBackground:(UIApplication*)application { |
| +} |
| + |
| +- (void)applicationWillEnterForeground:(UIApplication*)application { |
| +} |
| + |
| +- (void)applicationDidBecomeActive:(UIApplication*)application { |
| +} |
| + |
| +- (void)applicationWillTerminate:(UIApplication*)application { |
| + [CRIWV shutDown]; |
| +} |
| + |
| +@end |