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

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

Issue 1458703004: Fixes document type detection on iOS 9. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments 1 Created 5 years, 1 month 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 d95db1dabe5641c956b231f5a927c4a8576410c1..cf924ce323a90bc745466713bd499fffc8d33b62 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -820,6 +820,16 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
return [self webViewDocumentType] == web::WEB_VIEW_DOCUMENT_TYPE_HTML;
}
+- (web::WebViewDocumentType)documentTypeFromMIMEType:(NSString*)MIMEType {
Eugene But (OOO till 7-30) 2015/11/19 16:29:01 NIT: Please try keeping the same order for interfa
stkhapugin 2015/11/20 10:50:43 Done.
+ if ([MIMEType isEqualToString:@"text/html"] ||
+ [MIMEType isEqualToString:@"application/xhtml+xml"] ||
+ [MIMEType isEqualToString:@"application/xml"]) {
+ return web::WEB_VIEW_DOCUMENT_TYPE_HTML;
+ }
+
+ return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
+}
+
// Stop doing stuff, especially network stuff. Close the request tracker.
- (void)terminateNetworkActivity {
DCHECK(!_isHalted);

Powered by Google App Engine
This is Rietveld 408576698