summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-15 19:38:09 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-15 19:38:09 +0000
commit6876dff90c40f6abf9013705f723fedf871d3fdb (patch)
tree9c2cfde383438b553cc19165e43d36a5836ddb44 /chrome
parent8dea61fb429c909d4fd8436e5d8372b8739b3dd2 (diff)
downloadchromium_src-6876dff90c40f6abf9013705f723fedf871d3fdb.zip
chromium_src-6876dff90c40f6abf9013705f723fedf871d3fdb.tar.gz
chromium_src-6876dff90c40f6abf9013705f723fedf871d3fdb.tar.bz2
linux: reinstate Pepper plugins
Someone mistakenly disabled it. This also factorizes the various platforms. In particular, PluginInstance::set_window_handle, cause of complexity isn't needed. That window_handle is only used for regular plugins in 2 places: - on Win32 windowed plugins to invalidate the plugin window. There's no plugin window on Pepper so this isn't needed. - on Win32 and Linux for windowless plugins to get a reference to the browser's window. That isn't cross-platform so shouldn't be in Pepper. Review URL: http://codereview.chromium.org/551042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/renderer/render_view.cc21
-rw-r--r--chrome/renderer/webplugin_delegate_pepper.cc13
-rw-r--r--chrome/renderer/webplugin_delegate_pepper.h5
3 files changed, 6 insertions, 33 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index b901a7e..92b42a7 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -2760,32 +2760,20 @@ webkit_glue::WebPluginDelegate* RenderView::CreatePluginDelegate(
}
}
if (in_process_plugin) {
-#if defined(OS_WIN) // In-proc plugins aren't supported on Linux.
if (use_pepper_host) {
return WebPluginDelegatePepper::Create(
path,
*mime_type_to_use,
- AsWeakPtr(),
- gfx::NativeViewFromId(host_window_));
+ AsWeakPtr());
} else {
+#if defined(OS_WIN) // In-proc plugins aren't supported on Linux or Mac.
return WebPluginDelegateImpl::Create(
path, *mime_type_to_use, gfx::NativeViewFromId(host_window_));
- }
-#elif defined(OS_MACOSX)
- if (use_pepper_host) {
- return WebPluginDelegatePepper::Create(
- path,
- *mime_type_to_use,
- AsWeakPtr(),
- host_window_);
- } else {
+#else
NOTIMPLEMENTED();
return NULL;
- }
-#else
- NOTIMPLEMENTED();
- return NULL;
#endif
+ }
}
return new WebPluginDelegateProxy(*mime_type_to_use, AsWeakPtr());
@@ -4068,4 +4056,3 @@ bool RenderView::SendAndRunNestedMessageLoop(IPC::SyncMessage* message) {
return rv;
}
-
diff --git a/chrome/renderer/webplugin_delegate_pepper.cc b/chrome/renderer/webplugin_delegate_pepper.cc
index e2c62a1..fd7cc79 100644
--- a/chrome/renderer/webplugin_delegate_pepper.cc
+++ b/chrome/renderer/webplugin_delegate_pepper.cc
@@ -58,8 +58,7 @@ uint32 WebPluginDelegatePepper::next_buffer_id = 0;
WebPluginDelegatePepper* WebPluginDelegatePepper::Create(
const FilePath& filename,
const std::string& mime_type,
- const base::WeakPtr<RenderView>& render_view,
- gfx::PluginWindowHandle containing_view) {
+ const base::WeakPtr<RenderView>& render_view) {
scoped_refptr<NPAPI::PluginLib> plugin_lib =
NPAPI::PluginLib::CreatePluginLib(filename);
if (plugin_lib.get() == NULL)
@@ -72,7 +71,6 @@ WebPluginDelegatePepper* WebPluginDelegatePepper::Create(
scoped_refptr<NPAPI::PluginInstance> instance =
plugin_lib->CreateInstance(mime_type);
return new WebPluginDelegatePepper(render_view,
- containing_view,
instance.get());
}
@@ -99,13 +97,6 @@ bool WebPluginDelegatePepper::Initialize(
if (!start_result)
return false;
- // For windowless plugins we should set the containing window handle
- // as the instance window handle. This is what Safari does. Not having
- // a valid window handle causes subtle bugs with plugins which retreive
- // the window handle and validate the same. The window handle can be
- // retreived via NPN_GetValue of NPNVnetscapeWindow.
- instance_->set_window_handle(parent_);
-
plugin_url_ = url.spec();
return true;
@@ -709,12 +700,10 @@ void WebPluginDelegatePepper::AudioStream::OnVolume(double volume) {
WebPluginDelegatePepper::WebPluginDelegatePepper(
const base::WeakPtr<RenderView>& render_view,
- gfx::PluginWindowHandle containing_view,
NPAPI::PluginInstance *instance)
: render_view_(render_view),
plugin_(NULL),
instance_(instance),
- parent_(containing_view),
buffer_size_(0),
plugin_buffer_(0),
nested_delegate_(NULL) {
diff --git a/chrome/renderer/webplugin_delegate_pepper.h b/chrome/renderer/webplugin_delegate_pepper.h
index d2da979..608748c 100644
--- a/chrome/renderer/webplugin_delegate_pepper.h
+++ b/chrome/renderer/webplugin_delegate_pepper.h
@@ -40,8 +40,7 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate {
static WebPluginDelegatePepper* Create(
const FilePath& filename,
const std::string& mime_type,
- const base::WeakPtr<RenderView>& render_view,
- gfx::PluginWindowHandle containing_view);
+ const base::WeakPtr<RenderView>& render_view);
// WebPluginDelegate implementation
virtual bool Initialize(const GURL& url,
@@ -189,7 +188,6 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate {
private:
WebPluginDelegatePepper(
const base::WeakPtr<RenderView>& render_view,
- gfx::PluginWindowHandle containing_view,
NPAPI::PluginInstance *instance);
~WebPluginDelegatePepper();
@@ -210,7 +208,6 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate {
webkit_glue::WebPlugin* plugin_;
scoped_refptr<NPAPI::PluginInstance> instance_;
- gfx::PluginWindowHandle parent_;
NPWindow window_;
gfx::Rect window_rect_;
gfx::Rect clip_rect_;