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

Unified Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 10544089: Implement the file chooser as a new resource "host" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index b88a01cecfd591ec00a3db147178f66fc4430232..293c70aa3f04eade4e28ed3901dd876adaf3b89e 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -41,6 +41,7 @@
#include "content/renderer/media/pepper_platform_video_decoder_impl.h"
#include "content/renderer/p2p/p2p_transport_impl.h"
#include "content/renderer/p2p/socket_dispatcher.h"
+#include "content/renderer/pepper/content_renderer_pepper_host_factory.h"
#include "content/renderer/pepper/pepper_broker_impl.h"
#include "content/renderer/pepper/pepper_device_enumeration_event_handler.h"
#include "content/renderer/pepper/pepper_hung_plugin_filter.h"
@@ -63,6 +64,7 @@
#include "ppapi/c/dev/pp_video_dev.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/private/ppb_flash.h"
+#include "ppapi/host/ppapi_host.h"
#include "ppapi/proxy/host_dispatcher.h"
#include "ppapi/proxy/pepper_file_messages.h"
#include "ppapi/proxy/ppapi_messages.h"
@@ -74,8 +76,6 @@
#include "ppapi/thunk/ppb_tcp_server_socket_private_api.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserCompletion.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h"
@@ -104,7 +104,10 @@ namespace {
class HostDispatcherWrapper
: public webkit::ppapi::PluginDelegate::OutOfProcessProxy {
public:
- HostDispatcherWrapper() {}
+ HostDispatcherWrapper(RenderViewImpl* rv)
+ : render_view_(rv),
+ host_factory_(rv) {
+ }
virtual ~HostDispatcherWrapper() {}
bool Init(const IPC::ChannelHandle& channel_handle,
@@ -125,6 +128,9 @@ class HostDispatcherWrapper
dispatcher_.reset(new ppapi::proxy::HostDispatcher(
pp_module, local_get_interface, filter));
+ host_.reset(new ppapi::host::PpapiHost(dispatcher_.get(), &host_factory_));
+ dispatcher_->AddFilter(host_.get());
+
if (!dispatcher_->InitHostWithChannel(dispatcher_delegate_.get(),
channel_handle,
true, // Client.
@@ -150,6 +156,11 @@ class HostDispatcherWrapper
}
private:
+ RenderViewImpl* render_view_;
+ ContentRendererPepperHostFactory host_factory_;
+
+ scoped_ptr<ppapi::host::PpapiHost> host_;
+
scoped_ptr<ppapi::proxy::HostDispatcher> dispatcher_;
scoped_ptr<ppapi::proxy::ProxyChannel::Delegate> dispatcher_delegate_;
};
@@ -257,7 +268,8 @@ PepperPluginDelegateImpl::CreatePepperPluginModule(
module = new webkit::ppapi::PluginModule(info->name, path,
PepperPluginRegistry::GetInstance());
PepperPluginRegistry::GetInstance()->AddLiveModule(path, module);
- scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper);
+ scoped_ptr<HostDispatcherWrapper> dispatcher(
+ new HostDispatcherWrapper(render_view_));
if (!dispatcher->Init(
channel_handle,
module->pp_module(),
@@ -292,7 +304,8 @@ scoped_refptr<webkit::ppapi::PluginModule>
registry);
RenderThreadImpl::current()->browser_plugin_registry()->AddModule(
guest_process_id, module);
- scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper);
+ scoped_ptr<HostDispatcherWrapper> dispatcher(
+ new HostDispatcherWrapper(render_view_));
if (!dispatcher->Init(
channel_handle,
module->pp_module(),
@@ -716,12 +729,6 @@ PepperPluginDelegateImpl::ConnectToBroker(
return broker;
}
-bool PepperPluginDelegateImpl::RunFileChooser(
- const WebKit::WebFileChooserParams& params,
- WebKit::WebFileChooserCompletion* chooser_completion) {
- return render_view_->runFileChooser(params, chooser_completion);
-}
-
bool PepperPluginDelegateImpl::AsyncOpenFile(
const FilePath& path,
int flags,

Powered by Google App Engine
This is Rietveld 408576698