Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: webkit/tools/test_shell/test_webview_delegate.cc

Issue 7746009: [Mac] Support windowless Flash plugin rendering directly to the context for single-process apps (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/tools/test_shell/mac/test_webview_delegate.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/test_webview_delegate.cc
===================================================================
--- webkit/tools/test_shell/test_webview_delegate.cc (revision 98412)
+++ webkit/tools/test_shell/test_webview_delegate.cc (working copy)
@@ -53,6 +53,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h"
#include "ui/gfx/native_widget_types.h"
@@ -127,6 +128,7 @@
using WebKit::WebWindowFeatures;
using WebKit::WebWorker;
using WebKit::WebWorkerClient;
+using WebKit::WebVector;
using WebKit::WebView;
namespace {
@@ -601,6 +603,37 @@
if (plugins.empty())
return NULL;
+#if defined(OS_MACOSX)
+ if (!shell_->layout_test_mode()) {
+ bool flash = LowerCaseEqualsASCII(params.mimeType.utf8(),
+ "application/x-shockwave-flash");
+ if (flash) {
+ // Mac does not support windowed plugins. Force Flash plugins to use
+ // windowless mode by setting the wmode="opaque" attribute.
+ DCHECK(params.attributeNames.size() == params.attributeValues.size());
+ size_t size = params.attributeNames.size();
+
+ WebVector<WebString> new_names(size+1), new_values(size+1);
+
+ for (size_t i = 0; i < size; ++i) {
+ new_names[i] = params.attributeNames[i];
+ new_values[i] = params.attributeValues[i];
+ }
+
+ new_names[size] = "wmode";
+ new_values[size] = "opaque";
+
+ WebPluginParams new_params = params;
+ new_params.attributeNames.swap(new_names);
+ new_params.attributeValues.swap(new_values);
+
+ return new webkit::npapi::WebPluginImpl(
+ frame, new_params, plugins.front().path, mime_types.front(),
+ AsWeakPtr());
+ }
+ }
+#endif // defined (OS_MACOSX)
+
return new webkit::npapi::WebPluginImpl(
frame, params, plugins.front().path, mime_types.front(), AsWeakPtr());
}
« no previous file with comments | « webkit/tools/test_shell/mac/test_webview_delegate.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698