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

Unified Diff: ios/web/web_state/ui/crw_wk_web_view_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: s/mimeType/MIMEType 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
« 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 a254291c0b210d52bbffc4e7411cfdcf15a22b97..ea5ca812dc1a2e5095eaabbfb3b6cf985a2de4d0 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
@@ -509,17 +509,8 @@ WKWebViewErrorSource WKWebViewErrorSourceFromError(NSError* error) {
return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
}
- 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;
+ std::string MIMEType = self.webState->GetContentsMimeType();
+ return [self documentTypeFromMIMEType:base::SysUTF8ToNSString(MIMEType)];
}
- (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