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 WEBMIMEREGISTRY_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_SIMPLE_WEBMIMEREGISTRY_IMPL_H_ |
6 #define WEBMIMEREGISTRY_IMPL_H_ | 6 #define WEBKIT_GLUE_SIMPLE_WEBMIMEREGISTRY_IMPL_H_ |
7 | |
8 #include <string> | |
7 | 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "third_party/WebKit/public/platform/WebMimeRegistry.h" | 11 #include "third_party/WebKit/public/platform/WebMimeRegistry.h" |
10 #include "webkit/glue/webkit_glue_export.h" | 12 #include "webkit/glue/webkit_glue_export.h" |
11 | 13 |
12 namespace webkit_glue { | 14 namespace webkit_glue { |
13 | 15 |
14 class WEBKIT_GLUE_EXPORT SimpleWebMimeRegistryImpl : | 16 class WEBKIT_GLUE_EXPORT SimpleWebMimeRegistryImpl : |
15 NON_EXPORTED_BASE(public WebKit::WebMimeRegistry) { | 17 NON_EXPORTED_BASE(public WebKit::WebMimeRegistry) { |
16 public: | 18 public: |
17 SimpleWebMimeRegistryImpl() {} | 19 SimpleWebMimeRegistryImpl() {} |
18 virtual ~SimpleWebMimeRegistryImpl() {} | 20 virtual ~SimpleWebMimeRegistryImpl() {} |
19 | 21 |
22 // Convert a WebString to ASCII, falling back on an empty string in the case | |
23 // of a non-ASCII string. | |
24 static std::string ToASCIIOrEmpty(const WebKit::WebString& string); | |
scherkus (not reviewing)
2013/06/20 01:33:23
I feel sort of dirty doing this :|
| |
25 | |
20 // WebMimeRegistry methods: | 26 // WebMimeRegistry methods: |
21 virtual WebKit::WebMimeRegistry::SupportsType supportsMIMEType( | 27 virtual WebKit::WebMimeRegistry::SupportsType supportsMIMEType( |
22 const WebKit::WebString&); | 28 const WebKit::WebString&); |
23 virtual WebKit::WebMimeRegistry::SupportsType supportsImageMIMEType( | 29 virtual WebKit::WebMimeRegistry::SupportsType supportsImageMIMEType( |
24 const WebKit::WebString&); | 30 const WebKit::WebString&); |
25 virtual WebKit::WebMimeRegistry::SupportsType supportsJavaScriptMIMEType( | 31 virtual WebKit::WebMimeRegistry::SupportsType supportsJavaScriptMIMEType( |
26 const WebKit::WebString&); | 32 const WebKit::WebString&); |
27 // TODO(ddorwin): Remove after http://webk.it/82983 lands. | 33 // TODO(ddorwin): Remove after http://webk.it/82983 lands. |
28 virtual WebKit::WebMimeRegistry::SupportsType supportsMediaMIMEType( | 34 virtual WebKit::WebMimeRegistry::SupportsType supportsMediaMIMEType( |
29 const WebKit::WebString&, const WebKit::WebString&); | 35 const WebKit::WebString&, const WebKit::WebString&); |
30 virtual WebKit::WebMimeRegistry::SupportsType supportsMediaMIMEType( | 36 virtual WebKit::WebMimeRegistry::SupportsType supportsMediaMIMEType( |
31 const WebKit::WebString&, | 37 const WebKit::WebString&, |
32 const WebKit::WebString&, | 38 const WebKit::WebString&, |
33 const WebKit::WebString&); | 39 const WebKit::WebString&); |
34 virtual bool supportsMediaSourceMIMEType(const WebKit::WebString&, | 40 virtual bool supportsMediaSourceMIMEType(const WebKit::WebString&, |
35 const WebKit::WebString&); | 41 const WebKit::WebString&); |
36 virtual WebKit::WebMimeRegistry::SupportsType supportsNonImageMIMEType( | 42 virtual WebKit::WebMimeRegistry::SupportsType supportsNonImageMIMEType( |
37 const WebKit::WebString&); | 43 const WebKit::WebString&); |
38 virtual WebKit::WebString mimeTypeForExtension(const WebKit::WebString&); | 44 virtual WebKit::WebString mimeTypeForExtension(const WebKit::WebString&); |
39 virtual WebKit::WebString wellKnownMimeTypeForExtension( | 45 virtual WebKit::WebString wellKnownMimeTypeForExtension( |
40 const WebKit::WebString&); | 46 const WebKit::WebString&); |
41 virtual WebKit::WebString mimeTypeFromFile(const WebKit::WebString&); | 47 virtual WebKit::WebString mimeTypeFromFile(const WebKit::WebString&); |
42 virtual WebKit::WebString preferredExtensionForMIMEType( | 48 virtual WebKit::WebString preferredExtensionForMIMEType( |
43 const WebKit::WebString&); | 49 const WebKit::WebString&); |
44 }; | 50 }; |
45 | 51 |
46 } // namespace webkit_glue | 52 } // namespace webkit_glue |
47 | 53 |
48 #endif // WEBMIMEREGISTRY_IMPL_H_ | 54 #endif // WEBKIT_GLUE_SIMPLE_WEBMIMEREGISTRY_IMPL_H_ |
OLD | NEW |