OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/web_state/ui/crw_web_controller.h" | 5 #import "ios/web/web_state/ui/crw_web_controller.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 // Load the current URL in a web view, first ensuring the web view is visible. | 1303 // Load the current URL in a web view, first ensuring the web view is visible. |
1304 - (void)loadCurrentURLInWebView { | 1304 - (void)loadCurrentURLInWebView { |
1305 [self willLoadCurrentURLInWebView]; | 1305 [self willLoadCurrentURLInWebView]; |
1306 | 1306 |
1307 // Clear the set of URLs opened in external applications. | 1307 // Clear the set of URLs opened in external applications. |
1308 _openedApplicationURL.reset([[NSMutableSet alloc] init]); | 1308 _openedApplicationURL.reset([[NSMutableSet alloc] init]); |
1309 | 1309 |
1310 // Load the url. The UIWebView delegate callbacks take care of updating the | 1310 // Load the url. The UIWebView delegate callbacks take care of updating the |
1311 // session history and UI. | 1311 // session history and UI. |
1312 const GURL targetURL([self currentNavigationURL]); | 1312 const GURL targetURL([self currentNavigationURL]); |
1313 if (!targetURL.is_valid()) | 1313 if (!targetURL.is_valid()) { |
| 1314 [self didFinishWithURL:targetURL loadSuccess:NO]; |
1314 return; | 1315 return; |
| 1316 } |
1315 | 1317 |
1316 // JavaScript should never be evaluated here. User-entered JS should be | 1318 // JavaScript should never be evaluated here. User-entered JS should be |
1317 // evaluated via stringByEvaluatingUserJavaScriptFromString. | 1319 // evaluated via stringByEvaluatingUserJavaScriptFromString. |
1318 DCHECK(!targetURL.SchemeIs(url::kJavaScriptScheme)); | 1320 DCHECK(!targetURL.SchemeIs(url::kJavaScriptScheme)); |
1319 | 1321 |
1320 [self ensureWebViewCreated]; | 1322 [self ensureWebViewCreated]; |
1321 | 1323 |
1322 [self loadRequestForCurrentNavigationItem]; | 1324 [self loadRequestForCurrentNavigationItem]; |
1323 } | 1325 } |
1324 | 1326 |
(...skipping 2491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3816 if ([MIMEType isEqualToString:@"text/html"] || | 3818 if ([MIMEType isEqualToString:@"text/html"] || |
3817 [MIMEType isEqualToString:@"application/xhtml+xml"] || | 3819 [MIMEType isEqualToString:@"application/xhtml+xml"] || |
3818 [MIMEType isEqualToString:@"application/xml"]) { | 3820 [MIMEType isEqualToString:@"application/xml"]) { |
3819 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; | 3821 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; |
3820 } | 3822 } |
3821 | 3823 |
3822 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 3824 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
3823 } | 3825 } |
3824 | 3826 |
3825 @end | 3827 @end |
OLD | NEW |