diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-21 01:08:27 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-21 01:08:27 +0000 |
commit | c84cda4d2fa1caccd94623e2d254a8566a916f9c (patch) | |
tree | 85bad096af417e312ef26d5e4037d14cd0874f32 /content/worker | |
parent | f7359a1a9592d2f6230e08b255f528707656373f (diff) | |
download | chromium_src-c84cda4d2fa1caccd94623e2d254a8566a916f9c.zip chromium_src-c84cda4d2fa1caccd94623e2d254a8566a916f9c.tar.gz chromium_src-c84cda4d2fa1caccd94623e2d254a8566a916f9c.tar.bz2 |
Implement WebMimeRegistry::wellKnownMimeTypeForExtension in terms of the newly added net::GetWellKnownMimeTypeFromExtension function.
BUG=86108
TEST=none
Review URL: http://codereview.chromium.org/7205040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89774 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/worker')
-rw-r--r-- | content/worker/worker_webkitclient_impl.cc | 9 | ||||
-rw-r--r-- | content/worker/worker_webkitclient_impl.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/content/worker/worker_webkitclient_impl.cc b/content/worker/worker_webkitclient_impl.cc index 75a822b..d4866d1 100644 --- a/content/worker/worker_webkitclient_impl.cc +++ b/content/worker/worker_webkitclient_impl.cc @@ -14,6 +14,7 @@ #include "content/common/webmessageportchannel_impl.h" #include "content/worker/worker_thread.h" #include "ipc/ipc_sync_message_filter.h" +#include "net/base/mime_util.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobRegistry.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" @@ -238,6 +239,14 @@ WebString WorkerWebKitClientImpl::mimeTypeForExtension( return ASCIIToUTF16(mime_type); } +WebString WorkerWebKitClientImpl::wellKnownMimeTypeForExtension( + const WebString& file_extension) { + std::string mime_type; + net::GetWellKnownMimeTypeFromExtension( + webkit_glue::WebStringToFilePathString(file_extension), &mime_type); + return ASCIIToUTF16(mime_type); +} + WebString WorkerWebKitClientImpl::mimeTypeFromFile( const WebString& file_path) { std::string mime_type; diff --git a/content/worker/worker_webkitclient_impl.h b/content/worker/worker_webkitclient_impl.h index d38db0e..98df47a 100644 --- a/content/worker/worker_webkitclient_impl.h +++ b/content/worker/worker_webkitclient_impl.h @@ -74,6 +74,8 @@ class WorkerWebKitClientImpl : public webkit_glue::WebKitClientImpl, virtual WebKit::WebMimeRegistry::SupportsType supportsNonImageMIMEType( const WebKit::WebString&); virtual WebKit::WebString mimeTypeForExtension(const WebKit::WebString&); + virtual WebKit::WebString wellKnownMimeTypeForExtension( + const WebKit::WebString&); virtual WebKit::WebString mimeTypeFromFile(const WebKit::WebString&); virtual WebKit::WebString preferredExtensionForMIMEType( const WebKit::WebString&); |