summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 19:01:08 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 19:01:08 +0000
commit95a40d7a887a82b35d9817df40c910c0d021d344 (patch)
treee2414575b446128103b965503c9b58a3b8347d41 /webkit
parent630210c7f07792a413f45b1ebc6aa3c0515e57f3 (diff)
downloadchromium_src-95a40d7a887a82b35d9817df40c910c0d021d344.zip
chromium_src-95a40d7a887a82b35d9817df40c910c0d021d344.tar.gz
chromium_src-95a40d7a887a82b35d9817df40c910c0d021d344.tar.bz2
Revert 50360 - Spoof as Safari when running Silverlight 4 on the Mac
Silverlight 4 doesn't support Chrome, so Chrome doesn't end up on the right event path; spoofing as Safari fixes mouseover handling, and doesn't appear to regress anything. BUG=46842 TEST=Mouseovers should work in Silverlight 4 on the Mac. Review URL: http://codereview.chromium.org/2805019 TBR=stuartmorgan@chromium.org Review URL: http://codereview.chromium.org/2801012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50370 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/plugins/plugin_host.cc23
1 files changed, 6 insertions, 17 deletions
diff --git a/webkit/glue/plugins/plugin_host.cc b/webkit/glue/plugins/plugin_host.cc
index ba6ac76..02e4af9 100644
--- a/webkit/glue/plugins/plugin_host.cc
+++ b/webkit/glue/plugins/plugin_host.cc
@@ -561,29 +561,18 @@ const char* NPN_UserAgent(NPP id) {
// Flash passes in a null id during the NP_initialize call. We need to
// default to the Mozilla user agent if we don't have an NPP instance or
// else Flash won't request windowless mode.
- bool use_mozilla_user_agent = true;
if (id) {
scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
if (plugin.get() && !plugin->use_mozilla_user_agent())
- use_mozilla_user_agent = false;
+ return webkit_glue::GetUserAgent(GURL()).c_str();
}
- if (use_mozilla_user_agent)
- return "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061103 Firefox/2.0a1";
-#elif defined(OS_MACOSX)
- // Silverlight 4 doesn't handle events correctly unless we claim to be Safari.
- scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
- if (plugin.get()) {
- WebPluginInfo plugin_info = plugin->plugin_lib()->plugin_info();
- if (plugin_info.name == L"Silverlight Plug-In" &&
- StartsWith(plugin_info.version, L"4.", false)) {
- return "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-us) "
- "AppleWebKit/534.1+ (KHTML, like Gecko) Version/5.0 Safari/533.16";
- }
- }
-#endif
-
+ return "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061103 Firefox/2.0a1";
+#else
+ // TODO(port): For now we always use our real useragent on Mac and Linux.
+ // We might eventually need to spoof for some plugins.
return webkit_glue::GetUserAgent(GURL()).c_str();
+#endif
}
void NPN_Status(NPP id, const char* message) {