Upstream version 5.34.98.0
[platform/framework/web/crosswalk.git] / src / webkit / glue / simple_webmimeregistry_impl.h
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
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_GLUE_SIMPLE_WEBMIMEREGISTRY_IMPL_H_
6 #define WEBKIT_GLUE_SIMPLE_WEBMIMEREGISTRY_IMPL_H_
7
8 #include <string>
9
10 #include "base/compiler_specific.h"
11 #include "third_party/WebKit/public/platform/WebMimeRegistry.h"
12 #include "webkit/glue/webkit_glue_export.h"
13
14 namespace webkit_glue {
15
16 class WEBKIT_GLUE_EXPORT SimpleWebMimeRegistryImpl :
17     NON_EXPORTED_BASE(public blink::WebMimeRegistry) {
18  public:
19   SimpleWebMimeRegistryImpl() {}
20   virtual ~SimpleWebMimeRegistryImpl() {}
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 blink::WebString& string);
25
26   // WebMimeRegistry methods:
27   virtual blink::WebMimeRegistry::SupportsType supportsMIMEType(
28       const blink::WebString&);
29   virtual blink::WebMimeRegistry::SupportsType supportsImageMIMEType(
30       const blink::WebString&);
31   virtual blink::WebMimeRegistry::SupportsType supportsJavaScriptMIMEType(
32       const blink::WebString&);
33   virtual blink::WebMimeRegistry::SupportsType supportsMediaMIMEType(
34       const blink::WebString&,
35       const blink::WebString&,
36       const blink::WebString&);
37   virtual bool supportsMediaSourceMIMEType(const blink::WebString&,
38                                            const blink::WebString&);
39   virtual blink::WebMimeRegistry::SupportsType supportsNonImageMIMEType(
40       const blink::WebString&);
41   virtual blink::WebString mimeTypeForExtension(const blink::WebString&);
42   virtual blink::WebString wellKnownMimeTypeForExtension(
43       const blink::WebString&);
44   virtual blink::WebString mimeTypeFromFile(const blink::WebString&);
45 };
46
47 }  // namespace webkit_glue
48
49 #endif  // WEBKIT_GLUE_SIMPLE_WEBMIMEREGISTRY_IMPL_H_