diff options
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/blocked_plugin.cc | 14 | ||||
-rw-r--r-- | chrome/renderer/blocked_plugin.h | 18 | ||||
-rw-r--r-- | chrome/renderer/pepper_devices.cc | 4 | ||||
-rw-r--r-- | chrome/renderer/pepper_devices_browsertest.cc | 21 | ||||
-rw-r--r-- | chrome/renderer/pepper_plugin_delegate_impl.cc | 2 | ||||
-rw-r--r-- | chrome/renderer/pepper_scrollbar_widget.cc | 2 | ||||
-rw-r--r-- | chrome/renderer/pepper_widget.cc | 14 | ||||
-rw-r--r-- | chrome/renderer/render_process_impl.cc | 4 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 46 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 21 | ||||
-rw-r--r-- | chrome/renderer/render_widget.cc | 4 | ||||
-rw-r--r-- | chrome/renderer/render_widget.h | 8 | ||||
-rw-r--r-- | chrome/renderer/renderer_glue.cc | 3 | ||||
-rw-r--r-- | chrome/renderer/webplugin_delegate_pepper.cc | 39 | ||||
-rw-r--r-- | chrome/renderer/webplugin_delegate_pepper.h | 22 | ||||
-rw-r--r-- | chrome/renderer/webplugin_delegate_proxy.cc | 17 | ||||
-rw-r--r-- | chrome/renderer/webplugin_delegate_proxy.h | 20 |
17 files changed, 140 insertions, 119 deletions
diff --git a/chrome/renderer/blocked_plugin.cc b/chrome/renderer/blocked_plugin.cc index e3d2a3a..68af8f8 100644 --- a/chrome/renderer/blocked_plugin.cc +++ b/chrome/renderer/blocked_plugin.cc @@ -22,9 +22,9 @@ #include "third_party/WebKit/WebKit/chromium/public/WebPoint.h" #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" -#include "webkit/glue/plugins/plugin_group.h" -#include "webkit/glue/plugins/webview_plugin.h" #include "webkit/glue/webpreferences.h" +#include "webkit/plugins/npapi/plugin_group.h" +#include "webkit/plugins/npapi/webview_plugin.h" using WebKit::WebContextMenuData; using WebKit::WebFrame; @@ -42,7 +42,7 @@ static const unsigned kMenuActionRemove = 2; BlockedPlugin::BlockedPlugin(RenderView* render_view, WebFrame* frame, - const PluginGroup& info, + const webkit::npapi::PluginGroup& info, const WebPluginParams& params, const WebPreferences& preferences, int template_id, @@ -65,10 +65,10 @@ BlockedPlugin::BlockedPlugin(RenderView* render_view, std::string html_data = jstemplate_builder::GetTemplatesHtml( template_html, &values, "t"); - plugin_ = WebViewPlugin::Create(this, - preferences, - html_data, - GURL(kBlockedPluginDataURL)); + plugin_ = webkit::npapi::WebViewPlugin::Create(this, + preferences, + html_data, + GURL(kBlockedPluginDataURL)); registrar_.Add(this, NotificationType::SHOULD_LOAD_PLUGINS, diff --git a/chrome/renderer/blocked_plugin.h b/chrome/renderer/blocked_plugin.h index 53859bc..7b616bf 100644 --- a/chrome/renderer/blocked_plugin.h +++ b/chrome/renderer/blocked_plugin.h @@ -11,26 +11,32 @@ #include "chrome/renderer/custom_menu_listener.h" #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" #include "webkit/glue/cpp_bound_class.h" -#include "webkit/glue/plugins/webview_plugin.h" +#include "webkit/plugins/npapi/webview_plugin.h" class GURL; -class PluginGroup; class RenderView; + +namespace webkit { +namespace npapi { +class PluginGroup; +} +} + class BlockedPlugin : public CppBoundClass, - public WebViewPlugin::Delegate, + public webkit::npapi::WebViewPlugin::Delegate, public NotificationObserver, public CustomMenuListener { public: BlockedPlugin(RenderView* render_view, WebKit::WebFrame* frame, - const PluginGroup& info, + const webkit::npapi::PluginGroup& info, const WebKit::WebPluginParams& params, const WebPreferences& settings, int template_id, const string16& message); - WebViewPlugin* plugin() { return plugin_; } + webkit::npapi::WebViewPlugin* plugin() { return plugin_; } // WebViewPlugin::Delegate methods: virtual void BindWebFrame(WebKit::WebFrame* frame); @@ -62,7 +68,7 @@ class BlockedPlugin : public CppBoundClass, RenderView* render_view_; WebKit::WebFrame* frame_; WebKit::WebPluginParams plugin_params_; - WebViewPlugin* plugin_; + webkit::npapi::WebViewPlugin* plugin_; // The name of the plugin that was blocked. string16 name_; diff --git a/chrome/renderer/pepper_devices.cc b/chrome/renderer/pepper_devices.cc index aa98711..407d454 100644 --- a/chrome/renderer/pepper_devices.cc +++ b/chrome/renderer/pepper_devices.cc @@ -9,8 +9,8 @@ #include "chrome/renderer/webplugin_delegate_pepper.h" #include "skia/ext/platform_canvas.h" #include "third_party/skia/include/core/SkBitmap.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/webplugin.h" namespace { diff --git a/chrome/renderer/pepper_devices_browsertest.cc b/chrome/renderer/pepper_devices_browsertest.cc index e8e0bbe..963975c 100644 --- a/chrome/renderer/pepper_devices_browsertest.cc +++ b/chrome/renderer/pepper_devices_browsertest.cc @@ -18,9 +18,9 @@ #include "third_party/WebKit/WebKit/chromium/public/WebPlugin.h" #include "third_party/WebKit/WebKit/chromium/public/WebPluginParams.h" #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/webplugin_impl.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugin_impl.h" class PepperDeviceTest; @@ -135,9 +135,9 @@ class PepperDeviceTest : public RenderViewTest { virtual void SetUp(); virtual void TearDown(); - NPAPI::PluginVersionInfo version_info_; + webkit::npapi::PluginVersionInfo version_info_; - scoped_ptr<webkit_glue::WebPluginImpl> plugin_; + scoped_ptr<webkit::npapi::WebPluginImpl> plugin_; WebPluginDelegatePepper* pepper_plugin_; // FIXME(brettw): check lifetime. }; @@ -147,7 +147,7 @@ PepperDeviceTest::PepperDeviceTest() { version_info_.file_description = ASCIIToWide("Pepper device test plugin"); version_info_.file_version = ASCIIToWide("1"); version_info_.mime_types = ASCIIToWide(kTestPluginMimeType); - NPAPI::PluginEntryPoints entry_points = { + webkit::npapi::PluginEntryPoints entry_points = { #if !defined(OS_POSIX) || defined(OS_MACOSX) NP_GetEntryPoints, #endif @@ -163,14 +163,14 @@ PepperDeviceTest::~PepperDeviceTest() { void PepperDeviceTest::SetUp() { RenderViewTest::SetUp(); - NPAPI::PluginList::Singleton()->RegisterInternalPlugin(version_info_); + webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(version_info_); // Create the WebKit plugin with no delegates (this seems to work // sufficiently for the test). WebKit::WebPluginParams params; - plugin_.reset(new webkit_glue::WebPluginImpl( + plugin_.reset(new webkit::npapi::WebPluginImpl( NULL, params, FilePath(), std::string(), - base::WeakPtr<webkit_glue::WebPluginPageDelegate>())); + base::WeakPtr<webkit::npapi::WebPluginPageDelegate>())); // Create a pepper plugin for the RenderView. pepper_plugin_ = WebPluginDelegatePepper::Create( @@ -201,7 +201,8 @@ void PepperDeviceTest::TearDown() { if (pepper_plugin_) pepper_plugin_->PluginDestroyed(); - NPAPI::PluginList::Singleton()->UnregisterInternalPlugin(version_info_.path); + webkit::npapi::PluginList::Singleton()->UnregisterInternalPlugin( + version_info_.path); RenderViewTest::TearDown(); } diff --git a/chrome/renderer/pepper_plugin_delegate_impl.cc b/chrome/renderer/pepper_plugin_delegate_impl.cc index 87aa127..e223202 100644 --- a/chrome/renderer/pepper_plugin_delegate_impl.cc +++ b/chrome/renderer/pepper_plugin_delegate_impl.cc @@ -41,7 +41,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" #include "webkit/fileapi/file_system_callback_dispatcher.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/webplugin.h" #include "webkit/plugins/ppapi/ppb_file_io_impl.h" #include "webkit/plugins/ppapi/plugin_module.h" #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" diff --git a/chrome/renderer/pepper_scrollbar_widget.cc b/chrome/renderer/pepper_scrollbar_widget.cc index 63c446a..c4878a3 100644 --- a/chrome/renderer/pepper_scrollbar_widget.cc +++ b/chrome/renderer/pepper_scrollbar_widget.cc @@ -11,7 +11,7 @@ #include "skia/ext/platform_canvas.h" #include "skia/ext/platform_device.h" #include "third_party/WebKit/WebKit/chromium/public/WebScrollbar.h" -#include "webkit/glue/plugins/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_instance.h" #include "webkit/glue/webkit_glue.h" using WebKit::WebInputEvent; diff --git a/chrome/renderer/pepper_widget.cc b/chrome/renderer/pepper_widget.cc index ba37f87..176510f 100644 --- a/chrome/renderer/pepper_widget.cc +++ b/chrome/renderer/pepper_widget.cc @@ -9,9 +9,9 @@ #include "chrome/renderer/pepper_scrollbar_widget.h" #include "chrome/renderer/webplugin_delegate_pepper.h" #include "skia/ext/platform_canvas.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/webplugin.h" -#include "webkit/glue/plugins/webplugin_delegate.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/webplugin.h" +#include "webkit/plugins/npapi/webplugin_delegate.h" #if defined(OS_WIN) #include "base/win/windows_version.h" @@ -57,8 +57,8 @@ NPError NPPaintWidget(NPP instance, if (iter == g_widgets.Get().end()) return NPERR_INVALID_PARAM; - NPAPI::PluginInstance* plugin = - static_cast<NPAPI::PluginInstance*>(instance->ndata); + webkit::npapi::PluginInstance* plugin = + static_cast<webkit::npapi::PluginInstance*>(instance->ndata); WebPluginDelegatePepper* delegate = static_cast<WebPluginDelegatePepper*>(plugin->webplugin()->delegate()); Graphics2DDeviceContext* gdc = delegate->GetGraphicsContext(context); @@ -135,8 +135,8 @@ void PepperWidget::Init(NPP instance, int id) { } void PepperWidget::WidgetPropertyChanged(NPWidgetProperty property) { - NPAPI::PluginInstance* instance = - static_cast<NPAPI::PluginInstance*>(instance_->ndata); + webkit::npapi::PluginInstance* instance = + static_cast<webkit::npapi::PluginInstance*>(instance_->ndata); NPPExtensions* extensions = NULL; instance->NPP_GetValue(NPPVPepperExtensions, &extensions); if (!extensions) diff --git a/chrome/renderer/render_process_impl.cc b/chrome/renderer/render_process_impl.cc index 1396713..495a234 100644 --- a/chrome/renderer/render_process_impl.cc +++ b/chrome/renderer/render_process_impl.cc @@ -35,8 +35,8 @@ #include "native_client/src/shared/imc/nacl_imc.h" #include "native_client/src/trusted/plugin/nacl_entry_points.h" #include "skia/ext/platform_canvas.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/plugin_lib.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_lib.h" #include "webkit/glue/webkit_glue.h" #if defined(OS_MACOSX) diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 2c50d8e..5dd3359 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -172,18 +172,18 @@ #include "webkit/glue/image_resource_fetcher.h" #include "webkit/glue/media/video_renderer_impl.h" #include "webkit/glue/password_form_dom_manager.h" -#include "webkit/glue/plugins/default_plugin_shared.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/webplugin_delegate.h" -#include "webkit/glue/plugins/webplugin_delegate_impl.h" -#include "webkit/glue/plugins/webplugin_impl.h" -#include "webkit/glue/plugins/webview_plugin.h" #include "webkit/glue/resource_fetcher.h" #include "webkit/glue/site_isolation_metrics.h" #include "webkit/glue/webaccessibility.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/webkit_glue.h" #include "webkit/glue/webmediaplayer_impl.h" +#include "webkit/plugins/npapi/default_plugin_shared.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/webplugin_delegate.h" +#include "webkit/plugins/npapi/webplugin_delegate_impl.h" +#include "webkit/plugins/npapi/webplugin_impl.h" +#include "webkit/plugins/npapi/webview_plugin.h" #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" #if defined(OS_WIN) @@ -842,7 +842,7 @@ void RenderView::PluginCrashed(const FilePath& plugin_path) { WebPlugin* RenderView::CreatePluginNoCheck(WebFrame* frame, const WebPluginParams& params) { - WebPluginInfo info; + webkit::npapi::WebPluginInfo info; bool found; ContentSetting setting; std::string mime_type; @@ -2026,14 +2026,15 @@ void RenderView::OnMissingPluginStatus( #if defined(OS_WIN) if (!first_default_plugin_) { // Show the InfoBar for the first available plugin. - if (status == default_plugin::MISSING_PLUGIN_AVAILABLE) { + if (status == webkit::npapi::default_plugin::MISSING_PLUGIN_AVAILABLE) { first_default_plugin_ = delegate->AsWeakPtr(); Send(new ViewHostMsg_MissingPluginStatus(routing_id_, status)); } } else { // Closes the InfoBar if user clicks on the plugin (instead of the InfoBar) // to start the download/install. - if (status == default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD) { + if (status == + webkit::npapi::default_plugin::MISSING_PLUGIN_USER_STARTED_DOWNLOAD) { Send(new ViewHostMsg_MissingPluginStatus(routing_id_, status)); } } @@ -2754,7 +2755,7 @@ WebPlugin* RenderView::createPlugin(WebFrame* frame, bool found = false; ContentSetting plugin_setting = CONTENT_SETTING_DEFAULT; CommandLine* cmd = CommandLine::ForCurrentProcess(); - WebPluginInfo info; + webkit::npapi::WebPluginInfo info; GURL url(params.url); std::string actual_mime_type; Send(new ViewHostMsg_GetPluginInfo(url, @@ -2769,8 +2770,8 @@ WebPlugin* RenderView::createPlugin(WebFrame* frame, return NULL; DCHECK(plugin_setting != CONTENT_SETTING_DEFAULT); - const PluginGroup* group = - NPAPI::PluginList::Singleton()->GetPluginGroup(info); + const webkit::npapi::PluginGroup* group = + webkit::npapi::PluginList::Singleton()->GetPluginGroup(info); DCHECK(group != NULL); if (cmd->HasSwitch(switches::kBlockOutdatedPlugins) && @@ -2789,7 +2790,7 @@ WebPlugin* RenderView::createPlugin(WebFrame* frame, ContentSetting host_setting = current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS]; - if (info.path.value() == kDefaultPluginLibraryName || + if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName || plugin_setting == CONTENT_SETTING_ALLOW || host_setting == CONTENT_SETTING_ALLOW) { scoped_refptr<webkit::ppapi::PluginModule> pepper_module( @@ -3939,7 +3940,7 @@ void RenderView::openFileSystem( // webkit_glue::WebPluginPageDelegate ----------------------------------------- -webkit_glue::WebPluginDelegate* RenderView::CreatePluginDelegate( +webkit::npapi::WebPluginDelegate* RenderView::CreatePluginDelegate( const FilePath& file_path, const std::string& mime_type) { if (!PluginChannelHost::IsListening()) @@ -4007,7 +4008,7 @@ webkit_glue::WebPluginDelegate* RenderView::CreatePluginDelegate( return pepper_plugin; } else { #if defined(OS_WIN) // In-proc plugins aren't supported on Linux or Mac. - return WebPluginDelegateImpl::Create( + return webkit::npapi::WebPluginDelegateImpl::Create( file_path, mime_type, gfx::NativeViewFromId(host_window_)); #else NOTIMPLEMENTED(); @@ -4034,7 +4035,7 @@ void RenderView::WillDestroyPluginWindow(gfx::PluginWindowHandle window) { CleanupWindowInPluginMoves(window); } -void RenderView::DidMovePlugin(const webkit_glue::WebPluginGeometry& move) { +void RenderView::DidMovePlugin(const webkit::npapi::WebPluginGeometry& move) { SchedulePluginMove(move); } @@ -4436,18 +4437,19 @@ WebPlugin* RenderView::CreatePepperPlugin( pepper_module, params, pepper_delegate_.AsWeakPtr()); } -WebPlugin* RenderView::CreateNPAPIPlugin(WebFrame* frame, - const WebPluginParams& params, - const FilePath& path, - const std::string& mime_type) { - return new webkit_glue::WebPluginImpl( +WebPlugin* RenderView::CreateNPAPIPlugin( + WebFrame* frame, + const WebPluginParams& params, + const FilePath& path, + const std::string& mime_type) { + return new webkit::npapi::WebPluginImpl( frame, params, path, mime_type, AsWeakPtr()); } WebPlugin* RenderView::CreatePluginPlaceholder( WebFrame* frame, const WebPluginParams& params, - const PluginGroup& group, + const webkit::npapi::PluginGroup& group, int resource_id, int message_id) { // |blocked_plugin| will delete itself when the WebViewPlugin diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index d7589dc..af7b969 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -43,8 +43,8 @@ #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" #include "third_party/WebKit/WebKit/chromium/public/WebViewClient.h" #include "third_party/WebKit/WebKit/chromium/public/WebNavigationType.h" -#include "webkit/glue/plugins/webplugin_page_delegate.h" #include "webkit/glue/webpreferences.h" +#include "webkit/plugins/npapi/webplugin_page_delegate.h" #if defined(OS_WIN) // RenderView is a diamond-shaped hierarchy, with WebWidgetClient at the root. @@ -74,7 +74,6 @@ class NotificationProvider; class PageClickTracker; class PasswordAutocompleteManager; class PepperDeviceTest; -class PluginGroup; class PrintWebViewHelper; class RenderViewVisitor; class SkBitmap; @@ -97,12 +96,16 @@ class Rect; } namespace webkit { -namespace ppapi { +namespace npapi { +class PluginGroup; +} // namespace npapi + +namespace ppapi { class PluginInstance; class FullscreenContainer; - } // namespace ppapi + } // namespace webkit namespace safe_browsing { @@ -171,7 +174,7 @@ class RenderView : public RenderWidget, public WebKit::WebViewClient, public WebKit::WebFrameClient, public WebKit::WebPageSerializerClient, - public webkit_glue::WebPluginPageDelegate, + public webkit::npapi::WebPluginPageDelegate, public base::SupportsWeakPtr<RenderView> { public: // Creates a new RenderView. The parent_hwnd specifies a HWND to use as the @@ -650,12 +653,12 @@ class RenderView : public RenderWidget, // webkit_glue::WebPluginPageDelegate implementation ------------------------- - virtual webkit_glue::WebPluginDelegate* CreatePluginDelegate( + virtual webkit::npapi::WebPluginDelegate* CreatePluginDelegate( const FilePath& file_path, const std::string& mime_type); virtual void CreatedPluginWindow(gfx::PluginWindowHandle handle); virtual void WillDestroyPluginWindow(gfx::PluginWindowHandle handle); - virtual void DidMovePlugin(const webkit_glue::WebPluginGeometry& move); + virtual void DidMovePlugin(const webkit::npapi::WebPluginGeometry& move); virtual void DidStartLoadingForPlugin(); virtual void DidStopLoadingForPlugin(); virtual void ShowModalHTMLDialogForPlugin( @@ -1026,7 +1029,7 @@ class RenderView : public RenderWidget, WebKit::WebPlugin* CreatePluginPlaceholder( WebKit::WebFrame* frame, const WebKit::WebPluginParams& params, - const PluginGroup& group, + const webkit::npapi::PluginGroup& group, int resource_id, int message_id); @@ -1339,7 +1342,7 @@ class RenderView : public RenderWidget, // Remember the first uninstalled plugin, so that we can ask the plugin // to install itself when user clicks on the info bar. - base::WeakPtr<webkit_glue::WebPluginDelegate> first_default_plugin_; + base::WeakPtr<webkit::npapi::WebPluginDelegate> first_default_plugin_; PepperPluginDelegateImpl pepper_delegate_; diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc index 13c194d..041fcd9 100644 --- a/chrome/renderer/render_widget.cc +++ b/chrome/renderer/render_widget.cc @@ -27,8 +27,8 @@ #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" -#include "webkit/glue/plugins/webplugin.h" #include "webkit/glue/webkit_glue.h" +#include "webkit/plugins/npapi/webplugin.h" #if defined(OS_POSIX) #include "ipc/ipc_channel_posix.h" @@ -955,7 +955,7 @@ void RenderWidget::resetInputMethod() { } void RenderWidget::SchedulePluginMove( - const webkit_glue::WebPluginGeometry& move) { + const webkit::npapi::WebPluginGeometry& move) { size_t i = 0; for (; i < plugin_window_moves_.size(); ++i) { if (plugin_window_moves_[i].window == move.window) { diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h index 0fd6634..92826e9 100644 --- a/chrome/renderer/render_widget.h +++ b/chrome/renderer/render_widget.h @@ -46,9 +46,11 @@ class WebWidget; struct WebPopupMenuInfo; } -namespace webkit_glue { +namespace webkit { +namespace npapi { struct WebPluginGeometry; } +} // RenderWidget provides a communication bridge between a WebWidget and // a RenderWidgetHost, the latter of which lives in a different process. @@ -111,7 +113,7 @@ class RenderWidget : public IPC::Channel::Listener, // Called when a plugin is moved. These events are queued up and sent with // the next paint or scroll message to the host. - void SchedulePluginMove(const webkit_glue::WebPluginGeometry& move); + void SchedulePluginMove(const webkit::npapi::WebPluginGeometry& move); // Called when a plugin window has been destroyed, to make sure the currently // pending moves don't try to reference it. @@ -337,7 +339,7 @@ class RenderWidget : public IPC::Channel::Listener, WebKit::WebPopupType popup_type_; // Holds all the needed plugin window moves for a scroll. - typedef std::vector<webkit_glue::WebPluginGeometry> WebPluginGeometryVector; + typedef std::vector<webkit::npapi::WebPluginGeometry> WebPluginGeometryVector; WebPluginGeometryVector plugin_window_moves_; // A custom background for the widget. diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc index 5cae2a9..ae5984b 100644 --- a/chrome/renderer/renderer_glue.cc +++ b/chrome/renderer/renderer_glue.cc @@ -205,7 +205,8 @@ bool ClipboardReadFilenames(Clipboard::Buffer buffer, return result; } -void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins) { +void GetPlugins(bool refresh, + std::vector<webkit::npapi::WebPluginInfo>* plugins) { if (!RenderThread::current()->plugin_refresh_allowed()) refresh = false; RenderThread::current()->Send(new ViewHostMsg_GetPlugins(refresh, plugins)); diff --git a/chrome/renderer/webplugin_delegate_pepper.cc b/chrome/renderer/webplugin_delegate_pepper.cc index 1d2be20..68a14ad 100644 --- a/chrome/renderer/webplugin_delegate_pepper.cc +++ b/chrome/renderer/webplugin_delegate_pepper.cc @@ -55,26 +55,26 @@ #include "third_party/npapi/bindings/npapi_extensions_private.h" #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" -#include "webkit/glue/plugins/plugin_constants_win.h" -#include "webkit/glue/plugins/plugin_instance.h" -#include "webkit/glue/plugins/plugin_lib.h" -#include "webkit/glue/plugins/plugin_list.h" -#include "webkit/glue/plugins/plugin_host.h" -#include "webkit/glue/plugins/plugin_stream_url.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/webkit_glue.h" +#include "webkit/plugins/npapi/plugin_constants_win.h" +#include "webkit/plugins/npapi/plugin_instance.h" +#include "webkit/plugins/npapi/plugin_lib.h" +#include "webkit/plugins/npapi/plugin_list.h" +#include "webkit/plugins/npapi/plugin_host.h" +#include "webkit/plugins/npapi/plugin_stream_url.h" #if defined(ENABLE_GPU) -#include "webkit/glue/plugins/plugin_constants_win.h" +#include "webkit/plugins/npapi/plugin_constants_win.h" #endif #if defined(ENABLE_GPU) using gpu::Buffer; #endif -using webkit_glue::WebPlugin; -using webkit_glue::WebPluginDelegate; -using webkit_glue::WebPluginResourceClient; +using webkit::npapi::WebPlugin; +using webkit::npapi::WebPluginDelegate; +using webkit::npapi::WebPluginResourceClient; using WebKit::WebCursorInfo; using WebKit::WebKeyboardEvent; using WebKit::WebInputEvent; @@ -114,8 +114,8 @@ WebPluginDelegatePepper* WebPluginDelegatePepper::Create( const FilePath& filename, const std::string& mime_type, const base::WeakPtr<RenderView>& render_view) { - scoped_refptr<NPAPI::PluginLib> plugin_lib( - NPAPI::PluginLib::CreatePluginLib(filename)); + scoped_refptr<webkit::npapi::PluginLib> plugin_lib( + webkit::npapi::PluginLib::CreatePluginLib(filename)); if (plugin_lib.get() == NULL) return NULL; @@ -123,7 +123,7 @@ WebPluginDelegatePepper* WebPluginDelegatePepper::Create( if (err != NPERR_NO_ERROR) return NULL; - scoped_refptr<NPAPI::PluginInstance> instance( + scoped_refptr<webkit::npapi::PluginInstance> instance( plugin_lib->CreateInstance(mime_type)); return new WebPluginDelegatePepper(render_view, instance.get()); @@ -544,7 +544,7 @@ string16 WebPluginDelegatePepper::GetSelectedText(bool html) const { return string16(); string16 rv = UTF8ToUTF16(static_cast<char*>(text)); - NPAPI::PluginHost::Singleton()->host_functions()->memfree(text); + webkit::npapi::PluginHost::Singleton()->host_functions()->memfree(text); return rv; } @@ -680,8 +680,8 @@ NPError WebPluginDelegatePepper::Device3DInitializeContext( // Create an instance of the GPU plugin that is responsible for 3D // rendering. - nested_delegate_ = new WebPluginDelegateProxy(kGPUPluginMimeType, - render_view_); + nested_delegate_ = new WebPluginDelegateProxy( + "application/vnd.google.chrome.gpu-plugin", render_view_); // TODO(apatrick): should the GPU plugin be attached to plugin_? if (nested_delegate_->Initialize(GURL(), @@ -1270,7 +1270,8 @@ bool WebPluginDelegatePepper::VectorPrintPage(int page_number, size_in_pixels.height(), true, false, true, true); #endif // defined(OS_WIN) - NPAPI::PluginHost::Singleton()->host_functions()->memfree(pdf_output); + webkit::npapi::PluginHost::Singleton()->host_functions()->memfree( + pdf_output); return ret; } @@ -1378,7 +1379,7 @@ void WebPluginDelegatePepper::PrintEnd() { WebPluginDelegatePepper::WebPluginDelegatePepper( const base::WeakPtr<RenderView>& render_view, - NPAPI::PluginInstance *instance) + webkit::npapi::PluginInstance *instance) : render_view_(render_view), plugin_(NULL), instance_(instance), @@ -1636,7 +1637,7 @@ void WebPluginDelegatePepper::SendNestedDelegateGeometryToBrowser( return; } - webkit_glue::WebPluginGeometry geom; + webkit::npapi::WebPluginGeometry geom; geom.window = nested_delegate_->GetPluginWindowHandle(); geom.window_rect = window_rect; geom.clip_rect = clip_rect; diff --git a/chrome/renderer/webplugin_delegate_pepper.h b/chrome/renderer/webplugin_delegate_pepper.h index cfe34a1..6285424 100644 --- a/chrome/renderer/webplugin_delegate_pepper.h +++ b/chrome/renderer/webplugin_delegate_pepper.h @@ -22,19 +22,21 @@ #include "third_party/npapi/bindings/npapi.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/WebKit/chromium/public/WebFileChooserCompletion.h" -#include "webkit/glue/plugins/webplugin_delegate.h" +#include "webkit/plugins/npapi/webplugin_delegate.h" class FilePath; class RenderView; class WebCursor; class WebPluginDelegateProxy; -namespace NPAPI { +namespace webkit { +namespace npapi { class PluginInstance; } +} // An implementation of WebPluginDelegate for Pepper in-process plugins. -class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate, +class WebPluginDelegatePepper : public webkit::npapi::WebPluginDelegate, public WebKit::WebFileChooserCompletion { public: static WebPluginDelegatePepper* Create( @@ -42,7 +44,7 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate, const std::string& mime_type, const base::WeakPtr<RenderView>& render_view); - NPAPI::PluginInstance* instance() { return instance_.get(); } + webkit::npapi::PluginInstance* instance() { return instance_.get(); } // WebKit::WebFileChooserCompletion implementation. virtual void didChooseFile( @@ -52,7 +54,7 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate, virtual bool Initialize(const GURL& url, const std::vector<std::string>& arg_names, const std::vector<std::string>& arg_values, - webkit_glue::WebPlugin* plugin, + webkit::npapi::WebPlugin* plugin, bool load_manually); virtual void PluginDestroyed(); virtual void UpdateGeometry(const gfx::Rect& window_rect, @@ -79,9 +81,9 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate, virtual void DidFinishManualLoading(); virtual void DidManualLoadFail(); virtual void InstallMissingPlugin(); - virtual webkit_glue::WebPluginResourceClient* CreateResourceClient( + virtual webkit::npapi::WebPluginResourceClient* CreateResourceClient( unsigned long resource_id, const GURL& url, int notify_id); - virtual webkit_glue::WebPluginResourceClient* CreateSeekableResourceClient( + virtual webkit::npapi::WebPluginResourceClient* CreateSeekableResourceClient( unsigned long resource_id, int range_request_id); virtual bool StartFind(const string16& search_text, bool case_sensitive, @@ -208,7 +210,7 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate, private: WebPluginDelegatePepper( const base::WeakPtr<RenderView>& render_view, - NPAPI::PluginInstance *instance); + webkit::npapi::PluginInstance *instance); ~WebPluginDelegatePepper(); // Set a task that calls the repaint callback the next time the window @@ -275,8 +277,8 @@ class WebPluginDelegatePepper : public webkit_glue::WebPluginDelegate, base::WeakPtr<RenderView> render_view_; - webkit_glue::WebPlugin* plugin_; - scoped_refptr<NPAPI::PluginInstance> instance_; + webkit::npapi::WebPlugin* plugin_; + scoped_refptr<webkit::npapi::PluginInstance> instance_; NPWindow window_; gfx::Rect window_rect_; diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index 5c8d550..1b2e7d7 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -48,7 +48,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/WebKit/chromium/public/WebVector.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" -#include "webkit/glue/plugins/webplugin.h" +#include "webkit/plugins/npapi/webplugin.h" #include "webkit/glue/webkit_glue.h" #if defined(OS_POSIX) @@ -65,7 +65,7 @@ using WebKit::WebView; // Proxy for WebPluginResourceClient. The object owns itself after creation, // deleting itself after its callback has been called. -class ResourceClientProxy : public webkit_glue::WebPluginResourceClient { +class ResourceClientProxy : public webkit::npapi::WebPluginResourceClient { public: ResourceClientProxy(PluginChannelHost* channel, int instance_id) : channel_(channel), instance_id_(instance_id), resource_id_(0), @@ -267,10 +267,11 @@ static bool SilverlightColorIsTransparent(const std::string& color) { return false; } -bool WebPluginDelegateProxy::Initialize(const GURL& url, +bool WebPluginDelegateProxy::Initialize( + const GURL& url, const std::vector<std::string>& arg_names, const std::vector<std::string>& arg_values, - webkit_glue::WebPlugin* plugin, + webkit::npapi::WebPlugin* plugin, bool load_manually) { IPC::ChannelHandle channel_handle; if (!RenderThread::current()->Send(new ViewHostMsg_OpenChannelToPlugin( @@ -1349,7 +1350,7 @@ void WebPluginDelegateProxy::OnHandleURLRequest( params.popups_allowed, params.notify_redirects); } -webkit_glue::WebPluginResourceClient* +webkit::npapi::WebPluginResourceClient* WebPluginDelegateProxy::CreateResourceClient( unsigned long resource_id, const GURL& url, int notify_id) { if (!channel_host_) @@ -1361,7 +1362,7 @@ WebPluginDelegateProxy::CreateResourceClient( return proxy; } -webkit_glue::WebPluginResourceClient* +webkit::npapi::WebPluginResourceClient* WebPluginDelegateProxy::CreateSeekableResourceClient( unsigned long resource_id, int range_request_id) { if (!channel_host_) @@ -1404,7 +1405,7 @@ bool WebPluginDelegateProxy::BindFakePluginWindowHandle(bool opaque) { // Since this isn't a real window, it doesn't get initial size and location // information the way a real windowed plugin would, so we need to feed it its // starting geometry. - webkit_glue::WebPluginGeometry geom; + webkit::npapi::WebPluginGeometry geom; geom.window = fake_window; geom.window_rect = plugin_rect_; geom.clip_rect = clip_rect_; @@ -1543,7 +1544,7 @@ bool WebPluginDelegateProxy::UseSynchronousGeometryUpdates() { // The move networks plugin needs to be informed of geometry updates // synchronously. - std::vector<WebPluginMimeType>::iterator index; + std::vector<webkit::npapi::WebPluginMimeType>::iterator index; for (index = info_.mime_types.begin(); index != info_.mime_types.end(); index++) { if (index->mime_type == "application/x-vnd.moveplayer.qm" || diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h index 2c20583..30e212e 100644 --- a/chrome/renderer/webplugin_delegate_proxy.h +++ b/chrome/renderer/webplugin_delegate_proxy.h @@ -18,8 +18,8 @@ #include "googleurl/src/gurl.h" #include "ipc/ipc_channel.h" #include "ipc/ipc_message.h" -#include "webkit/glue/plugins/webplugininfo.h" -#include "webkit/glue/plugins/webplugin_delegate.h" +#include "webkit/plugins/npapi/webplugininfo.h" +#include "webkit/plugins/npapi/webplugin_delegate.h" #if defined(OS_MACOSX) #include "base/hash_tables.h" @@ -44,14 +44,16 @@ namespace skia { class PlatformCanvas; } -namespace webkit_glue { +namespace webkit { +namespace npapi { class WebPlugin; } +} // An implementation of WebPluginDelegate that proxies all calls to // the plugin process. class WebPluginDelegateProxy - : public webkit_glue::WebPluginDelegate, + : public webkit::npapi::WebPluginDelegate, public IPC::Channel::Listener, public IPC::Message::Sender, public base::SupportsWeakPtr<WebPluginDelegateProxy> { @@ -64,7 +66,7 @@ class WebPluginDelegateProxy virtual bool Initialize(const GURL& url, const std::vector<std::string>& arg_names, const std::vector<std::string>& arg_values, - webkit_glue::WebPlugin* plugin, + webkit::npapi::WebPlugin* plugin, bool load_manually); virtual void UpdateGeometry(const gfx::Rect& window_rect, const gfx::Rect& clip_rect); @@ -113,9 +115,9 @@ class WebPluginDelegateProxy virtual void DidFinishManualLoading(); virtual void DidManualLoadFail(); virtual void InstallMissingPlugin(); - virtual webkit_glue::WebPluginResourceClient* CreateResourceClient( + virtual webkit::npapi::WebPluginResourceClient* CreateResourceClient( unsigned long resource_id, const GURL& url, int notify_id); - virtual webkit_glue::WebPluginResourceClient* CreateSeekableResourceClient( + virtual webkit::npapi::WebPluginResourceClient* CreateSeekableResourceClient( unsigned long resource_id, int range_request_id); CommandBufferProxy* CreateCommandBuffer(); @@ -231,13 +233,13 @@ class WebPluginDelegateProxy #endif base::WeakPtr<RenderView> render_view_; - webkit_glue::WebPlugin* plugin_; + webkit::npapi::WebPlugin* plugin_; bool uses_shared_bitmaps_; gfx::PluginWindowHandle window_; scoped_refptr<PluginChannelHost> channel_host_; std::string mime_type_; int instance_id_; - WebPluginInfo info_; + webkit::npapi::WebPluginInfo info_; gfx::Rect plugin_rect_; gfx::Rect clip_rect_; |