| 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 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 // Load the current URL in a web view, first ensuring the web view is visible. | 1320 // Load the current URL in a web view, first ensuring the web view is visible. |
| 1321 - (void)loadCurrentURLInWebView { | 1321 - (void)loadCurrentURLInWebView { |
| 1322 [self willLoadCurrentURLInWebView]; | 1322 [self willLoadCurrentURLInWebView]; |
| 1323 | 1323 |
| 1324 // Clear the set of URLs opened in external applications. | 1324 // Clear the set of URLs opened in external applications. |
| 1325 _openedApplicationURL.reset([[NSMutableSet alloc] init]); | 1325 _openedApplicationURL.reset([[NSMutableSet alloc] init]); |
| 1326 | 1326 |
| 1327 // Load the url. The UIWebView delegate callbacks take care of updating the | 1327 // Load the url. The UIWebView delegate callbacks take care of updating the |
| 1328 // session history and UI. | 1328 // session history and UI. |
| 1329 const GURL targetURL([self currentNavigationURL]); | 1329 const GURL targetURL([self currentNavigationURL]); |
| 1330 if (!targetURL.is_valid()) | 1330 if (!targetURL.is_valid()) { |
| 1331 [self didFinishWithURL:targetURL loadSuccess:NO]; |
| 1331 return; | 1332 return; |
| 1333 } |
| 1332 | 1334 |
| 1333 // JavaScript should never be evaluated here. User-entered JS should be | 1335 // JavaScript should never be evaluated here. User-entered JS should be |
| 1334 // evaluated via stringByEvaluatingUserJavaScriptFromString. | 1336 // evaluated via stringByEvaluatingUserJavaScriptFromString. |
| 1335 DCHECK(!targetURL.SchemeIs(url::kJavaScriptScheme)); | 1337 DCHECK(!targetURL.SchemeIs(url::kJavaScriptScheme)); |
| 1336 | 1338 |
| 1337 [self ensureWebViewCreated]; | 1339 [self ensureWebViewCreated]; |
| 1338 | 1340 |
| 1339 [self loadRequestForCurrentNavigationItem]; | 1341 [self loadRequestForCurrentNavigationItem]; |
| 1340 } | 1342 } |
| 1341 | 1343 |
| (...skipping 2563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3905 if ([MIMEType isEqualToString:@"text/html"] || | 3907 if ([MIMEType isEqualToString:@"text/html"] || |
| 3906 [MIMEType isEqualToString:@"application/xhtml+xml"] || | 3908 [MIMEType isEqualToString:@"application/xhtml+xml"] || |
| 3907 [MIMEType isEqualToString:@"application/xml"]) { | 3909 [MIMEType isEqualToString:@"application/xml"]) { |
| 3908 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; | 3910 return web::WEB_VIEW_DOCUMENT_TYPE_HTML; |
| 3909 } | 3911 } |
| 3910 | 3912 |
| 3911 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; | 3913 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC; |
| 3912 } | 3914 } |
| 3913 | 3915 |
| 3914 @end | 3916 @end |
| OLD | NEW |