Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_view/shell/shell_app_delegate.h" | |
| 6 | |
| 7 #import "base/mac/scoped_nsobject.h" | |
| 8 #import "ios/web_view/public/criwv.h" | |
| 9 #import "ios/web_view/shell/shell_delegate.h" | |
| 10 #import "ios/web_view/shell/shell_view_controller.h" | |
| 11 | |
| 12 @interface ShellAppDelegate () { | |
| 13 base::scoped_nsobject<ShellDelegate> _delegate; | |
| 14 } | |
| 15 @end | |
| 16 | |
| 17 @implementation ShellAppDelegate | |
| 18 | |
| 19 @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
| |
| 20 | |
| 21 - (BOOL)application:(UIApplication*)application | |
| 22 didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { | |
| 23 _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
| 24 self.window.backgroundColor = [UIColor whiteColor]; | |
| 25 | |
| 26 _delegate.reset([[ShellDelegate alloc] init]); | |
| 27 [CRIWV configureWithDelegate:_delegate]; | |
| 28 [CRIWV installNetworkStack]; | |
| 29 | |
| 30 base::scoped_nsobject<ShellViewController> controller( | |
| 31 [[ShellViewController alloc] init]); | |
| 32 self.window.rootViewController = controller; | |
| 33 [self.window makeKeyAndVisible]; | |
| 34 return YES; | |
| 35 } | |
| 36 | |
| 37 - (void)applicationWillResignActive:(UIApplication*)application { | |
| 38 } | |
| 39 | |
| 40 - (void)applicationDidEnterBackground:(UIApplication*)application { | |
| 41 } | |
| 42 | |
| 43 - (void)applicationWillEnterForeground:(UIApplication*)application { | |
| 44 } | |
| 45 | |
| 46 - (void)applicationDidBecomeActive:(UIApplication*)application { | |
| 47 } | |
| 48 | |
| 49 - (void)applicationWillTerminate:(UIApplication*)application { | |
| 50 [CRIWV shutDown]; | |
| 51 } | |
| 52 | |
| 53 @end | |
| OLD | NEW |