Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/web_view/shell/shell_app_delegate.h" | 5 #import "ios/web_view/shell/shell_app_delegate.h" |
| 6 | 6 |
| 7 #import "base/mac/scoped_nsobject.h" | |
| 8 #import "ios/web_view/public/criwv.h" | 7 #import "ios/web_view/public/criwv.h" |
| 9 #import "ios/web_view/shell/shell_delegate.h" | 8 #import "ios/web_view/shell/shell_delegate.h" |
| 10 #import "ios/web_view/shell/shell_view_controller.h" | 9 #import "ios/web_view/shell/shell_view_controller.h" |
| 11 | 10 |
| 12 @interface ShellAppDelegate () { | 11 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 13 base::scoped_nsobject<ShellDelegate> _delegate; | 12 #error "This file requires ARC support." |
| 14 } | 13 #endif |
| 14 | |
| 15 @interface ShellAppDelegate () | |
| 16 @property (nonatomic, strong) ShellDelegate* delegate; | |
| 15 @end | 17 @end |
| 16 | 18 |
| 17 @implementation ShellAppDelegate | 19 @implementation ShellAppDelegate |
| 18 | 20 |
| 21 @synthesize delegate = _delegate; | |
| 19 @synthesize window = _window; | 22 @synthesize window = _window; |
| 20 | 23 |
| 21 - (BOOL)application:(UIApplication*)application | 24 - (BOOL)application:(UIApplication*)application |
| 22 didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { | 25 didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { |
| 23 _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | 26 self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
| 24 self.window.backgroundColor = [UIColor whiteColor]; | 27 self.window.backgroundColor = [UIColor whiteColor]; |
| 25 | 28 |
| 26 _delegate.reset([[ShellDelegate alloc] init]); | 29 self.delegate = [[ShellDelegate alloc] init]; |
| 27 [CRIWV configureWithDelegate:_delegate]; | 30 [CRIWV configureWithDelegate:_delegate]; |
| 28 | 31 |
| 29 [self.window makeKeyAndVisible]; | 32 [self.window makeKeyAndVisible]; |
| 30 | 33 |
| 31 base::scoped_nsobject<ShellViewController> controller( | 34 ShellViewController* controller = |
| 32 [[ShellViewController alloc] init]); | 35 [[ShellViewController alloc] init]; |
|
Eugene But (OOO till 7-30)
2017/01/30 17:53:38
Do we still need this linebreak?
michaeldo
2017/01/30 19:30:35
Nope, fixed.
| |
| 33 self.window.rootViewController = controller; | 36 self.window.rootViewController = controller; |
| 34 | 37 |
| 35 return YES; | 38 return YES; |
| 36 } | 39 } |
| 37 | 40 |
| 38 - (void)applicationWillResignActive:(UIApplication*)application { | 41 - (void)applicationWillResignActive:(UIApplication*)application { |
| 39 } | 42 } |
| 40 | 43 |
| 41 - (void)applicationDidEnterBackground:(UIApplication*)application { | 44 - (void)applicationDidEnterBackground:(UIApplication*)application { |
| 42 } | 45 } |
| 43 | 46 |
| 44 - (void)applicationWillEnterForeground:(UIApplication*)application { | 47 - (void)applicationWillEnterForeground:(UIApplication*)application { |
| 45 } | 48 } |
| 46 | 49 |
| 47 - (void)applicationDidBecomeActive:(UIApplication*)application { | 50 - (void)applicationDidBecomeActive:(UIApplication*)application { |
| 48 } | 51 } |
| 49 | 52 |
| 50 - (void)applicationWillTerminate:(UIApplication*)application { | 53 - (void)applicationWillTerminate:(UIApplication*)application { |
| 51 [CRIWV shutDown]; | 54 [CRIWV shutDown]; |
| 52 } | 55 } |
| 53 | 56 |
| 54 - (void)dealloc { | |
| 55 [_window release]; | |
| 56 [super dealloc]; | |
| 57 } | |
| 58 | |
| 59 @end | 57 @end |
| OLD | NEW |