| 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_view_controller.h" | 5 #import "ios/web_view/shell/shell_view_controller.h" |
| 6 | 6 |
| 7 #import <ChromeWebView/ChromeWebView.h> | 7 #import <ChromeWebView/ChromeWebView.h> |
| 8 #import <MobileCoreServices/MobileCoreServices.h> | 8 #import <MobileCoreServices/MobileCoreServices.h> |
| 9 | 9 |
| 10 #import "ios/web_view/shell/translate_controller.h" | 10 #import "ios/web_view/shell/translate_controller.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 [stop setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin]; | 126 [stop setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin]; |
| 127 [stop addTarget:self | 127 [stop addTarget:self |
| 128 action:@selector(stopLoading) | 128 action:@selector(stopLoading) |
| 129 forControlEvents:UIControlEventTouchUpInside]; | 129 forControlEvents:UIControlEventTouchUpInside]; |
| 130 | 130 |
| 131 [_toolbar addSubview:back]; | 131 [_toolbar addSubview:back]; |
| 132 [_toolbar addSubview:forward]; | 132 [_toolbar addSubview:forward]; |
| 133 [_toolbar addSubview:stop]; | 133 [_toolbar addSubview:stop]; |
| 134 [_toolbar addSubview:_field]; | 134 [_toolbar addSubview:_field]; |
| 135 | 135 |
| 136 self.webView = [CWV webViewWithFrame:[_containerView bounds]]; | 136 [CWVWebView setUserAgentProduct:@"Dummy/1.0"]; |
| 137 |
| 138 CWVWebViewConfiguration* configuration = |
| 139 [CWVWebViewConfiguration defaultConfiguration]; |
| 140 self.webView = [[CWVWebView alloc] initWithFrame:[_containerView bounds] |
| 141 configuration:configuration]; |
| 137 _webView.navigationDelegate = self; | 142 _webView.navigationDelegate = self; |
| 138 _webView.UIDelegate = self; | 143 _webView.UIDelegate = self; |
| 139 _translateController = [[TranslateController alloc] init]; | 144 _translateController = [[TranslateController alloc] init]; |
| 140 _webView.translationDelegate = _translateController; | 145 _webView.translationDelegate = _translateController; |
| 141 | 146 |
| 142 [_webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | | 147 [_webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | |
| 143 UIViewAutoresizingFlexibleHeight]; | 148 UIViewAutoresizingFlexibleHeight]; |
| 144 [_containerView addSubview:_webView]; | 149 [_containerView addSubview:_webView]; |
| 145 | 150 |
| 146 NSURLRequest* request = [NSURLRequest | 151 NSURLRequest* request = [NSURLRequest |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 // TODO(crbug.com/679895): Add some visual indication that the page load has | 348 // TODO(crbug.com/679895): Add some visual indication that the page load has |
| 344 // finished. | 349 // finished. |
| 345 [self updateToolbar]; | 350 [self updateToolbar]; |
| 346 } | 351 } |
| 347 | 352 |
| 348 - (void)webViewWebContentProcessDidTerminate:(CWVWebView*)webView { | 353 - (void)webViewWebContentProcessDidTerminate:(CWVWebView*)webView { |
| 349 NSLog(@"webViewWebContentProcessDidTerminate"); | 354 NSLog(@"webViewWebContentProcessDidTerminate"); |
| 350 } | 355 } |
| 351 | 356 |
| 352 @end | 357 @end |
| OLD | NEW |