| 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 <ChromeWebView/ChromeWebView.h> | |
| 8 | |
| 9 #import "ios/web_view/shell/shell_view_controller.h" | 7 #import "ios/web_view/shell/shell_view_controller.h" |
| 10 | 8 |
| 11 #if !defined(__has_feature) || !__has_feature(objc_arc) | 9 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 12 #error "This file requires ARC support." | 10 #error "This file requires ARC support." |
| 13 #endif | 11 #endif |
| 14 | 12 |
| 15 @implementation ShellAppDelegate | 13 @implementation ShellAppDelegate |
| 16 | 14 |
| 17 @synthesize window = _window; | 15 @synthesize window = _window; |
| 18 | 16 |
| 19 - (BOOL)application:(UIApplication*)application | 17 - (BOOL)application:(UIApplication*)application |
| 20 willFinishLaunchingWithOptions:(NSDictionary*)launchOptions { | 18 willFinishLaunchingWithOptions:(NSDictionary*)launchOptions { |
| 21 // Note that initialization of the window and the root view controller must be | 19 // Note that initialization of the window and the root view controller must be |
| 22 // done here, not in -application:didFinishLaunchingWithOptions: when state | 20 // done here, not in -application:didFinishLaunchingWithOptions: when state |
| 23 // restoration is supported. | 21 // restoration is supported. |
| 24 | 22 |
| 25 self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | 23 self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
| 26 self.window.backgroundColor = [UIColor whiteColor]; | 24 self.window.backgroundColor = [UIColor whiteColor]; |
| 27 | 25 |
| 28 [CWV configureWithUserAgentProductName:@"Dummy/1.0"]; | |
| 29 | |
| 30 ShellViewController* controller = [[ShellViewController alloc] init]; | 26 ShellViewController* controller = [[ShellViewController alloc] init]; |
| 31 // Gives a restoration identifier so that state restoration works. | 27 // Gives a restoration identifier so that state restoration works. |
| 32 controller.restorationIdentifier = @"rootViewController"; | 28 controller.restorationIdentifier = @"rootViewController"; |
| 33 self.window.rootViewController = controller; | 29 self.window.rootViewController = controller; |
| 34 | 30 |
| 35 return YES; | 31 return YES; |
| 36 } | 32 } |
| 37 | 33 |
| 38 - (BOOL)application:(UIApplication*)application | 34 - (BOOL)application:(UIApplication*)application |
| 39 didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { | 35 didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 61 return YES; | 57 return YES; |
| 62 } | 58 } |
| 63 | 59 |
| 64 - (BOOL)application:(UIApplication*)application | 60 - (BOOL)application:(UIApplication*)application |
| 65 shouldRestoreApplicationState:(NSCoder*)coder { | 61 shouldRestoreApplicationState:(NSCoder*)coder { |
| 66 // TODO(crbug.com/710329): Make this value configurable in the settings. | 62 // TODO(crbug.com/710329): Make this value configurable in the settings. |
| 67 return YES; | 63 return YES; |
| 68 } | 64 } |
| 69 | 65 |
| 70 @end | 66 @end |
| OLD | NEW |