OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef NET_BASE_MIME_UTIL_H__ | 5 #ifndef NET_BASE_MIME_UTIL_H__ |
6 #define NET_BASE_MIME_UTIL_H__ | 6 #define NET_BASE_MIME_UTIL_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 NET_EXPORT bool GetPreferredExtensionForMimeType( | 37 NET_EXPORT bool GetPreferredExtensionForMimeType( |
38 const std::string& mime_type, | 38 const std::string& mime_type, |
39 FilePath::StringType* extension); | 39 FilePath::StringType* extension); |
40 | 40 |
41 // Check to see if a particular MIME type is in our list. | 41 // Check to see if a particular MIME type is in our list. |
42 NET_EXPORT bool IsSupportedImageMimeType(const std::string& mime_type); | 42 NET_EXPORT bool IsSupportedImageMimeType(const std::string& mime_type); |
43 NET_EXPORT bool IsSupportedMediaMimeType(const std::string& mime_type); | 43 NET_EXPORT bool IsSupportedMediaMimeType(const std::string& mime_type); |
44 NET_EXPORT bool IsSupportedNonImageMimeType(const std::string& mime_type); | 44 NET_EXPORT bool IsSupportedNonImageMimeType(const std::string& mime_type); |
45 NET_EXPORT bool IsUnsupportedTextMimeType(const std::string& mime_type); | 45 NET_EXPORT bool IsUnsupportedTextMimeType(const std::string& mime_type); |
46 NET_EXPORT bool IsSupportedJavascriptMimeType(const std::string& mime_type); | 46 NET_EXPORT bool IsSupportedJavascriptMimeType(const std::string& mime_type); |
| 47 NET_EXPORT bool IsSupportedCertificateMimeType(const std::string& mime_type); |
47 | 48 |
48 // Get whether this mime type should be displayed in view-source mode. | 49 // Get whether this mime type should be displayed in view-source mode. |
49 // (For example, XML.) | 50 // (For example, XML.) |
50 NET_EXPORT bool IsViewSourceMimeType(const std::string& mime_type); | 51 NET_EXPORT bool IsViewSourceMimeType(const std::string& mime_type); |
51 | 52 |
52 // Convenience function. | 53 // Convenience function. |
53 NET_EXPORT bool IsSupportedMimeType(const std::string& mime_type); | 54 NET_EXPORT bool IsSupportedMimeType(const std::string& mime_type); |
54 | 55 |
55 // Returns true if this the mime_type_pattern matches a given mime-type. | 56 // Returns true if this the mime_type_pattern matches a given mime-type. |
56 // Checks for absolute matching and wildcards. mime-types should be in | 57 // Checks for absolute matching and wildcards. mime-types should be in |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 NET_EXPORT void GetMediaTypesBlacklistedForTests( | 105 NET_EXPORT void GetMediaTypesBlacklistedForTests( |
105 std::vector<std::string>* types); | 106 std::vector<std::string>* types); |
106 NET_EXPORT void GetMediaCodecsBlacklistedForTests( | 107 NET_EXPORT void GetMediaCodecsBlacklistedForTests( |
107 std::vector<std::string>* codecs); | 108 std::vector<std::string>* codecs); |
108 | 109 |
109 // Returns the IANA media type contained in |mime_type|, or an empty | 110 // Returns the IANA media type contained in |mime_type|, or an empty |
110 // string if |mime_type| does not specifify a known media type. | 111 // string if |mime_type| does not specifify a known media type. |
111 // Supported media types are defined at: | 112 // Supported media types are defined at: |
112 // http://www.iana.org/assignments/media-types/index.html | 113 // http://www.iana.org/assignments/media-types/index.html |
113 NET_EXPORT const std::string GetIANAMediaType(const std::string& mime_type); | 114 NET_EXPORT const std::string GetIANAMediaType(const std::string& mime_type); |
| 115 |
| 116 // A list of supported certificate-related mime types. |
| 117 enum CertificateMimeType { |
| 118 #define CERTIFICATE_MIME_TYPE(name, value) CERTIFICATE_MIME_TYPE_ ## name = valu
e, |
| 119 #include "net/base/mime_util_certificate_type_list.h" |
| 120 #undef CERTIFICATE_MIME_TYPE |
| 121 }; |
| 122 |
| 123 NET_EXPORT CertificateMimeType GetCertificateMimeTypeForMimeType( |
| 124 const std::string& mime_type); |
| 125 |
114 } // namespace net | 126 } // namespace net |
115 | 127 |
116 #endif // NET_BASE_MIME_UTIL_H__ | 128 #endif // NET_BASE_MIME_UTIL_H__ |
OLD | NEW |