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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2398233003: with sync (Closed)
Patch Set: done Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/sync/ios_chrome_sync_client.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index 4b3851642a5e02d492e6878998756f4ae43df959..5069bf8a9c98989cedc0195accce5485c856714b 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -4726,7 +4726,18 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
}
- (void)loadRequest:(NSMutableURLRequest*)request {
- _latestWKNavigation.reset([[_webView loadRequest:request] retain]);
+ if ([[request URL] isFileURL]) {
+ NSURL* url = [request URL];
+ NSMutableArray* partsArray =
+ [NSMutableArray arrayWithArray:[url pathComponents]];
+ [partsArray removeLastObject];
+ _latestWKNavigation.reset([[_webView
+ loadFileURL:url
+ allowingReadAccessToURL:[NSURL fileURLWithPathComponents:partsArray]]
+ retain]);
+ } else {
+ _latestWKNavigation.reset([[_webView loadRequest:request] retain]);
+ }
}
- (void)loadPOSTRequest:(NSMutableURLRequest*)request {
« no previous file with comments | « ios/chrome/browser/sync/ios_chrome_sync_client.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698