OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "content/child/simple_webmimeregistry_impl.h" | 5 #include "content/child/simple_webmimeregistry_impl.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 WebMimeRegistry::IsSupported : WebMimeRegistry::IsNotSupported; | 33 WebMimeRegistry::IsSupported : WebMimeRegistry::IsNotSupported; |
34 } | 34 } |
35 | 35 |
36 WebMimeRegistry::SupportsType | 36 WebMimeRegistry::SupportsType |
37 SimpleWebMimeRegistryImpl::supportsJavaScriptMIMEType( | 37 SimpleWebMimeRegistryImpl::supportsJavaScriptMIMEType( |
38 const WebString& mime_type) { | 38 const WebString& mime_type) { |
39 return net::IsSupportedJavascriptMimeType(ToASCIIOrEmpty(mime_type)) ? | 39 return net::IsSupportedJavascriptMimeType(ToASCIIOrEmpty(mime_type)) ? |
40 WebMimeRegistry::IsSupported : WebMimeRegistry::IsNotSupported; | 40 WebMimeRegistry::IsSupported : WebMimeRegistry::IsNotSupported; |
41 } | 41 } |
42 | 42 |
43 WebMimeRegistry::SupportsType | |
44 SimpleWebMimeRegistryImpl::supportsDartMIMEType( | |
45 const WebString& mime_type) { | |
46 return net::IsSupportedDartMimeType(ToASCIIOrEmpty(mime_type)) ? | |
47 WebMimeRegistry::IsSupported : WebMimeRegistry::IsNotSupported; | |
48 } | |
49 | |
50 // When debugging layout tests failures in the test shell, | 43 // When debugging layout tests failures in the test shell, |
51 // see TestShellWebMimeRegistryImpl. | 44 // see TestShellWebMimeRegistryImpl. |
52 WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMediaMIMEType( | 45 WebMimeRegistry::SupportsType SimpleWebMimeRegistryImpl::supportsMediaMIMEType( |
53 const WebString& mime_type, | 46 const WebString& mime_type, |
54 const WebString& codecs, | 47 const WebString& codecs, |
55 const WebString& key_system) { | 48 const WebString& key_system) { |
56 // Media features are only supported at the content/renderer/ layer. | 49 // Media features are only supported at the content/renderer/ layer. |
57 return IsNotSupported; | 50 return IsNotSupported; |
58 } | 51 } |
59 | 52 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 90 |
98 WebString SimpleWebMimeRegistryImpl::mimeTypeFromFile( | 91 WebString SimpleWebMimeRegistryImpl::mimeTypeFromFile( |
99 const WebString& file_path) { | 92 const WebString& file_path) { |
100 std::string mime_type; | 93 std::string mime_type; |
101 net::GetMimeTypeFromFile(base::FilePath::FromUTF16Unsafe(file_path), | 94 net::GetMimeTypeFromFile(base::FilePath::FromUTF16Unsafe(file_path), |
102 &mime_type); | 95 &mime_type); |
103 return WebString::fromUTF8(mime_type); | 96 return WebString::fromUTF8(mime_type); |
104 } | 97 } |
105 | 98 |
106 } // namespace content | 99 } // namespace content |
OLD | NEW |