Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 1844363004: [ios] Signal DidFinishLoad if target URL is invalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698