summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 20:34:16 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 20:34:16 +0000
commit4a93d168ac89970e222a548f512cd70a54b12901 (patch)
tree36e82b6c1382e8a376afa88975ec27f31c502c0e /webkit
parent28f9033b54cd783536fd7cc84d6f0ef536dc5105 (diff)
downloadchromium_src-4a93d168ac89970e222a548f512cd70a54b12901.zip
chromium_src-4a93d168ac89970e222a548f512cd70a54b12901.tar.gz
chromium_src-4a93d168ac89970e222a548f512cd70a54b12901.tar.bz2
Handle mimetype queries for media files
Added code path from WebKit to net::mimt_util to query supported mime-types for media files. BUG=12777 Review URL: http://codereview.chromium.org/114060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17225 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/api/public/WebMimeRegistry.h1
-rw-r--r--webkit/api/src/WebMediaPlayerClientImpl.cpp10
-rw-r--r--webkit/glue/simple_webmimeregistry_impl.cc5
-rw-r--r--webkit/glue/simple_webmimeregistry_impl.h1
4 files changed, 13 insertions, 4 deletions
diff --git a/webkit/api/public/WebMimeRegistry.h b/webkit/api/public/WebMimeRegistry.h
index 40e5c98..100331f 100644
--- a/webkit/api/public/WebMimeRegistry.h
+++ b/webkit/api/public/WebMimeRegistry.h
@@ -40,6 +40,7 @@ namespace WebKit {
public:
virtual bool supportsImageMIMEType(const WebString& mimeType) = 0;
virtual bool supportsJavaScriptMIMEType(const WebString& mimeType) = 0;
+ virtual bool supportsMediaMIMEType(const WebString& mimeType) = 0;
virtual bool supportsNonImageMIMEType(const WebString& mimeType) = 0;
virtual WebString mimeTypeForExtension(const WebString& fileExtension) = 0;
diff --git a/webkit/api/src/WebMediaPlayerClientImpl.cpp b/webkit/api/src/WebMediaPlayerClientImpl.cpp
index 9312516..d4d565a 100644
--- a/webkit/api/src/WebMediaPlayerClientImpl.cpp
+++ b/webkit/api/src/WebMediaPlayerClientImpl.cpp
@@ -13,6 +13,7 @@
#include "WebKit.h"
#include "WebKitClient.h"
#include "WebMediaPlayer.h"
+#include "WebMimeRegistry.h"
#include "WebRect.h"
#include "WebSize.h"
#include "WebString.h"
@@ -326,16 +327,17 @@ MediaPlayerPrivateInterface* WebMediaPlayerClientImpl::create(MediaPlayer* playe
void WebMediaPlayerClientImpl::getSupportedTypes(HashSet<String>& supportedTypes)
{
- // FIXME: decide what to do here, we should fill in the HashSet about
- // codecs that we support.
+ // FIXME: integrate this list with WebMediaPlayerClientImpl::supportsType.
notImplemented();
}
MediaPlayer::SupportsType WebMediaPlayerClientImpl::supportsType(const String& type,
const String& codecs)
{
- // FIXME: implement this properly.
- return MediaPlayer::IsSupported;
+ // FIXME: respect codecs, now we only check for mime-type.
+ if (webKitClient()->mimeRegistry()->supportsMediaMIMEType(type))
+ return MediaPlayer::IsSupported;
+ return MediaPlayer::IsNotSupported;
}
WebMediaPlayerClientImpl::WebMediaPlayerClientImpl()
diff --git a/webkit/glue/simple_webmimeregistry_impl.cc b/webkit/glue/simple_webmimeregistry_impl.cc
index d678c1b..95c39a1 100644
--- a/webkit/glue/simple_webmimeregistry_impl.cc
+++ b/webkit/glue/simple_webmimeregistry_impl.cc
@@ -25,6 +25,11 @@ bool SimpleWebMimeRegistryImpl::supportsJavaScriptMIMEType(
return net::IsSupportedJavascriptMimeType(UTF16ToASCII(mime_type).c_str());
}
+bool SimpleWebMimeRegistryImpl::supportsMediaMIMEType(
+ const WebString& mime_type) {
+ return net::IsSupportedMediaMimeType(UTF16ToASCII(mime_type).c_str());
+}
+
bool SimpleWebMimeRegistryImpl::supportsNonImageMIMEType(
const WebString& mime_type) {
return net::IsSupportedNonImageMimeType(UTF16ToASCII(mime_type).c_str());
diff --git a/webkit/glue/simple_webmimeregistry_impl.h b/webkit/glue/simple_webmimeregistry_impl.h
index 7d5140b..c783ebd 100644
--- a/webkit/glue/simple_webmimeregistry_impl.h
+++ b/webkit/glue/simple_webmimeregistry_impl.h
@@ -14,6 +14,7 @@ class SimpleWebMimeRegistryImpl : public WebKit::WebMimeRegistry {
// WebMimeRegistry methods:
virtual bool supportsImageMIMEType(const WebKit::WebString&);
virtual bool supportsJavaScriptMIMEType(const WebKit::WebString&);
+ virtual bool supportsMediaMIMEType(const WebKit::WebString&);
virtual bool supportsNonImageMIMEType(const WebKit::WebString&);
virtual WebKit::WebString mimeTypeForExtension(const WebKit::WebString&);
virtual WebKit::WebString mimeTypeFromFile(const WebKit::WebString&);