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 28f95f402d761f5bc0ccdaa1c55716f4bd294157..43b1f97c2e818635ea150411989d4e579d704fcc 100644 |
--- a/ios/web/web_state/ui/crw_web_controller.mm |
+++ b/ios/web/web_state/ui/crw_web_controller.mm |
@@ -3858,4 +3858,18 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5; |
_externalRequest.reset(); |
} |
+- (web::WebViewDocumentType)documentTypeFromMIMEType:(NSString*)MIMEType { |
+ if (!MIMEType.length) { |
+ return web::WEB_VIEW_DOCUMENT_TYPE_UNKNOWN; |
+ } |
+ |
+ 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; |
+} |
+ |
@end |