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

Side by Side Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 1491043004: 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 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 3836 matching lines...) Expand 10 before | Expand all | Expand 10 after
3847 - (NSString*)externalRequestWindowName { 3847 - (NSString*)externalRequestWindowName {
3848 if (!_externalRequest || !_externalRequest->window_name) 3848 if (!_externalRequest || !_externalRequest->window_name)
3849 return @""; 3849 return @"";
3850 return _externalRequest->window_name; 3850 return _externalRequest->window_name;
3851 } 3851 }
3852 3852
3853 - (void)resetExternalRequest { 3853 - (void)resetExternalRequest {
3854 _externalRequest.reset(); 3854 _externalRequest.reset();
3855 } 3855 }
3856 3856
3857 - (web::WebViewDocumentType)documentTypeFromMIMEType:(NSString*)MIMEType {
3858 if (!MIMEType.length) {
3859 return web::WEB_VIEW_DOCUMENT_TYPE_UNKNOWN;
3860 }
3861
3862 if ([MIMEType isEqualToString:@"text/html"] ||
3863 [MIMEType isEqualToString:@"application/xhtml+xml"] ||
3864 [MIMEType isEqualToString:@"application/xml"]) {
3865 return web::WEB_VIEW_DOCUMENT_TYPE_HTML;
3866 }
3867
3868 return web::WEB_VIEW_DOCUMENT_TYPE_GENERIC;
3869 }
3870
3857 @end 3871 @end
OLDNEW
« no previous file with comments | « ios/web/web_state/ui/crw_ui_web_view_web_controller.mm ('k') | ios/web/web_state/ui/crw_web_controller+protected.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698