summaryrefslogtreecommitdiffstats
path: root/webkit/activex_shim
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-11 06:24:44 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-11 06:24:44 +0000
commit80be1d88700fff788f873971ee90cba5e813195d (patch)
tree65c22e9388787dc360c15839de7586d364d7e44a /webkit/activex_shim
parenteb169bacbcdd25706efbe7ddd0117e9766496205 (diff)
downloadchromium_src-80be1d88700fff788f873971ee90cba5e813195d.zip
chromium_src-80be1d88700fff788f873971ee90cba5e813195d.tar.gz
chromium_src-80be1d88700fff788f873971ee90cba5e813195d.tar.bz2
Removing the Activex shim plugin from the list of default plugins caused some activex shim tests to fail. This basically fails for pages which instantiate the media player like an activex only. To handle this case we attempt to map the clsid to a NPAPI mime type if possible in the shim. If we succeed then the shim is instantiated as an NPAPI plugin as before. It internally loads the media player activex.
Review URL: http://codereview.chromium.org/66072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/activex_shim')
-rw-r--r--webkit/activex_shim/activex_shared.cc13
-rw-r--r--webkit/activex_shim/activex_shared.h4
2 files changed, 17 insertions, 0 deletions
diff --git a/webkit/activex_shim/activex_shared.cc b/webkit/activex_shim/activex_shared.cc
index c5b06a5..649ce01 100644
--- a/webkit/activex_shim/activex_shared.cc
+++ b/webkit/activex_shim/activex_shared.cc
@@ -225,4 +225,17 @@ bool IsMimeTypeActiveX(const std::string& mimetype) {
LowerCaseEqualsASCII(mimetype, "application/oleobject");
}
+bool GetMimeTypeForClsid(const std::string& clsid, std::string* mime_type) {
+ DCHECK(mime_type != NULL);
+
+ if (!base::strcasecmp(clsid.c_str(),
+ "6BF52A52-394A-11D3-B153-00C04F79FAA6") ||
+ !base::strcasecmp(clsid.c_str(),
+ "22D6F312-B0F6-11D0-94AB-0080C74C7E95")) {
+ *mime_type = "application/x-mplayer2";
+ return true;
+ }
+ return false;
+}
+
} // namespace activex_shim
diff --git a/webkit/activex_shim/activex_shared.h b/webkit/activex_shim/activex_shared.h
index 9b34dc9..062dd8d 100644
--- a/webkit/activex_shim/activex_shared.h
+++ b/webkit/activex_shim/activex_shared.h
@@ -61,6 +61,10 @@ bool IsCodebaseAllowed(const std::string& clsid, const std::string& codebase);
// "application/oleobject"
bool IsMimeTypeActiveX(const std::string& mimetype);
+// Returns the NPAPI mime type for the CLSID passed in. On failure
+// return false
+bool GetMimeTypeForClsid(const std::string& clsid, std::string* mime_type);
+
} // namespace activex_shim
#endif // #ifndef WEBKIT_ACTIVEX_SHIM_ACTIVEX_SHARED_H__