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

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

Issue 2451843002: Add Store+Sync to reading list. (Closed)
Patch Set: works! 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
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 b9f9c01b1a2336520849349babe34746b5979f0f..6ca0044785cc285a6a929d0b13090deb1fb8aee9 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -4815,7 +4815,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 {

Powered by Google App Engine
This is Rietveld 408576698