| 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 CWVWebViewConfiguration* configuration = |
| 137 [CWVWebViewConfiguration defaultConfiguration]; |
| 138 self.webView = [[CWVWebView alloc] initWithFrame:[_containerView bounds] |
| 139 configuration:configuration]; |
| 137 _webView.navigationDelegate = self; | 140 _webView.navigationDelegate = self; |
| 138 _webView.UIDelegate = self; | 141 _webView.UIDelegate = self; |
| 139 _translateController = [[TranslateController alloc] init]; | 142 _translateController = [[TranslateController alloc] init]; |
| 140 _webView.translationDelegate = _translateController; | 143 _webView.translationDelegate = _translateController; |
| 141 | 144 |
| 142 [_webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | | 145 [_webView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | |
| 143 UIViewAutoresizingFlexibleHeight]; | 146 UIViewAutoresizingFlexibleHeight]; |
| 144 [_containerView addSubview:_webView]; | 147 [_containerView addSubview:_webView]; |
| 145 | 148 |
| 146 NSURLRequest* request = [NSURLRequest | 149 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 | 346 // TODO(crbug.com/679895): Add some visual indication that the page load has |
| 344 // finished. | 347 // finished. |
| 345 [self updateToolbar]; | 348 [self updateToolbar]; |
| 346 } | 349 } |
| 347 | 350 |
| 348 - (void)webViewWebContentProcessDidTerminate:(CWVWebView*)webView { | 351 - (void)webViewWebContentProcessDidTerminate:(CWVWebView*)webView { |
| 349 NSLog(@"webViewWebContentProcessDidTerminate"); | 352 NSLog(@"webViewWebContentProcessDidTerminate"); |
| 350 } | 353 } |
| 351 | 354 |
| 352 @end | 355 @end |
| OLD | NEW |