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

Side by Side 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: git cl w 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/web/web_state/ui/crw_web_controller.h" 5 #import "ios/web/web_state/ui/crw_web_controller.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/ios/block_types.h" 10 #include "base/ios/block_types.h"
(...skipping 3840 matching lines...) Expand 10 before | Expand all | Expand 10 after
3851 - (NSString*)externalRequestWindowName { 3851 - (NSString*)externalRequestWindowName {
3852 if (!_externalRequest || !_externalRequest->window_name) 3852 if (!_externalRequest || !_externalRequest->window_name)
3853 return @""; 3853 return @"";
3854 return _externalRequest->window_name; 3854 return _externalRequest->window_name;
3855 } 3855 }
3856 3856
3857 - (void)resetExternalRequest { 3857 - (void)resetExternalRequest {
3858 _externalRequest.reset(); 3858 _externalRequest.reset();
3859 } 3859 }
3860 3860
3861 - (web::WebViewDocumentType)documentTypeFromMIMEType:(NSString*)MIMEType {
3862 if (!MIMEType.length) {
3863 return web::WEB_VIEW_DOCUMENT_TYPE_UNKNOWN;
3864 }
3865
3866 if ([MIMEType isEqualToString:@"text/html"] ||
3867 [MIMEType isEqualToString:@"application/xhtml+xml"] ||
3868 [MIMEType isEqualToString:@"application/xml"]) {
3869 return web::WEB_VIEW_DOCUMENT_TYPE_HTML;
3870 }
3871
3872 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
3873 }
3874
3861 @end 3875 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698