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

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

Issue 1491263002: Revert of Fixes document type detection on iOS 9. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
Patch Set: Created 5 years 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/web/web_state/ui/crw_web_controller+protected.h ('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_wk_web_view_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
index b7b9ce8c8ed29dae7f2cdefdb0074fbce8073d3a..547e9f9fe4fa273f4a5cf9db80465a24388755b6 100644
--- a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
+++ b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
@@ -536,8 +536,17 @@
return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
}
- std::string MIMEType = self.webState->GetContentsMimeType();
- return [self documentTypeFromMIMEType:base::SysUTF8ToNSString(MIMEType)];
+ std::string mimeType = self.webState->GetContentsMimeType();
+ if (mimeType.empty()) {
+ return web::WEB_VIEW_DOCUMENT_TYPE_UNKNOWN;
+ }
+
+ if (mimeType == "text/html" || mimeType == "application/xhtml+xml" ||
+ mimeType == "application/xml") {
+ return web::WEB_VIEW_DOCUMENT_TYPE_HTML;
+ }
+
+ return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
}
- (void)loadRequest:(NSMutableURLRequest*)request {
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller+protected.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698