OLD | NEW |
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 Loading... |
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 |
OLD | NEW |