OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #include "webkit/glue/simple_webmimeregistry_impl.h" | 5 #include "webkit/glue/simple_webmimeregistry_impl.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #include "net/base/mime_util.h" | 9 #include "net/base/mime_util.h" |
10 #include "webkit/api/public/WebString.h" | 10 #include "webkit/api/public/WebString.h" |
11 #include "webkit/glue/glue_util.h" | 11 #include "webkit/glue/glue_util.h" |
12 #include "webkit/glue/webkit_glue.h" | 12 #include "webkit/glue/webkit_glue.h" |
13 | 13 |
14 using WebKit::WebString; | 14 using WebKit::WebString; |
15 | 15 |
16 namespace webkit_glue { | 16 namespace webkit_glue { |
17 | 17 |
18 bool SimpleWebMimeRegistryImpl::supportsImageMIMEType( | 18 bool SimpleWebMimeRegistryImpl::supportsImageMIMEType( |
19 const WebString& mime_type) { | 19 const WebString& mime_type) { |
20 return net::IsSupportedImageMimeType(UTF16ToASCII(mime_type).c_str()); | 20 return net::IsSupportedImageMimeType(UTF16ToASCII(mime_type).c_str()); |
21 } | 21 } |
22 | 22 |
23 bool SimpleWebMimeRegistryImpl::supportsJavaScriptMIMEType( | 23 bool SimpleWebMimeRegistryImpl::supportsJavaScriptMIMEType( |
24 const WebString& mime_type) { | 24 const WebString& mime_type) { |
25 return net::IsSupportedJavascriptMimeType(UTF16ToASCII(mime_type).c_str()); | 25 return net::IsSupportedJavascriptMimeType(UTF16ToASCII(mime_type).c_str()); |
26 } | 26 } |
27 | 27 |
| 28 bool SimpleWebMimeRegistryImpl::supportsMediaMIMEType( |
| 29 const WebString& mime_type) { |
| 30 return net::IsSupportedMediaMimeType(UTF16ToASCII(mime_type).c_str()); |
| 31 } |
| 32 |
28 bool SimpleWebMimeRegistryImpl::supportsNonImageMIMEType( | 33 bool SimpleWebMimeRegistryImpl::supportsNonImageMIMEType( |
29 const WebString& mime_type) { | 34 const WebString& mime_type) { |
30 return net::IsSupportedNonImageMimeType(UTF16ToASCII(mime_type).c_str()); | 35 return net::IsSupportedNonImageMimeType(UTF16ToASCII(mime_type).c_str()); |
31 } | 36 } |
32 | 37 |
33 WebString SimpleWebMimeRegistryImpl::mimeTypeForExtension( | 38 WebString SimpleWebMimeRegistryImpl::mimeTypeForExtension( |
34 const WebString& file_extension) { | 39 const WebString& file_extension) { |
35 std::string mime_type; | 40 std::string mime_type; |
36 net::GetMimeTypeFromExtension( | 41 net::GetMimeTypeFromExtension( |
37 WebStringToFilePathString(file_extension), &mime_type); | 42 WebStringToFilePathString(file_extension), &mime_type); |
(...skipping 10 matching lines...) Expand all Loading... |
48 | 53 |
49 WebString SimpleWebMimeRegistryImpl::preferredExtensionForMIMEType( | 54 WebString SimpleWebMimeRegistryImpl::preferredExtensionForMIMEType( |
50 const WebString& mime_type) { | 55 const WebString& mime_type) { |
51 FilePath::StringType file_extension; | 56 FilePath::StringType file_extension; |
52 net::GetPreferredExtensionForMimeType(UTF16ToASCII(mime_type), | 57 net::GetPreferredExtensionForMimeType(UTF16ToASCII(mime_type), |
53 &file_extension); | 58 &file_extension); |
54 return FilePathStringToWebString(file_extension); | 59 return FilePathStringToWebString(file_extension); |
55 } | 60 } |
56 | 61 |
57 } // namespace webkit_glue | 62 } // namespace webkit_glue |
OLD | NEW |