diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-15 23:36:15 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-15 23:36:15 +0000 |
commit | d2ffd6ceb97c5590c01be7580bd2e38dbd7ac2c7 (patch) | |
tree | b56aac35897a683b276ec3c861f2e9d54a66f940 | |
parent | c9bd2e8e19e8c5891d68e99b4c610c04a62046a0 (diff) | |
download | chromium_src-d2ffd6ceb97c5590c01be7580bd2e38dbd7ac2c7.zip chromium_src-d2ffd6ceb97c5590c01be7580bd2e38dbd7ac2c7.tar.gz chromium_src-d2ffd6ceb97c5590c01be7580bd2e38dbd7ac2c7.tar.bz2 |
Delete the plugin printing code, which wasn't actually called.
Review URL: http://codereview.chromium.org/6874023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81835 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/common/plugin_messages.h | 5 | ||||
-rw-r--r-- | content/plugin/plugin_channel.h | 1 | ||||
-rw-r--r-- | content/plugin/webplugin_delegate_stub.cc | 62 | ||||
-rw-r--r-- | content/plugin/webplugin_delegate_stub.h | 6 | ||||
-rw-r--r-- | content/renderer/webplugin_delegate_proxy.cc | 30 | ||||
-rw-r--r-- | content/renderer/webplugin_delegate_proxy.h | 1 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate.h | 3 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl.h | 1 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc | 4 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl_mac.mm | 4 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl_win.cc | 15 |
11 files changed, 1 insertions, 131 deletions
diff --git a/content/common/plugin_messages.h b/content/common/plugin_messages.h index f817664..813d8bb 100644 --- a/content/common/plugin_messages.h +++ b/content/common/plugin_messages.h @@ -4,7 +4,6 @@ // // Multiply-included message file, hence no include guard. -#include "base/shared_memory.h" #include "build/build_config.h" #include "content/common/common_param_traits.h" #include "content/common/webkit_param_traits.h" @@ -178,10 +177,6 @@ IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_Paint, // plugin knows it can send more invalidates. IPC_MESSAGE_ROUTED0(PluginMsg_DidPaint) -IPC_SYNC_MESSAGE_ROUTED0_2(PluginMsg_Print, - base::SharedMemoryHandle /* shared_memory*/, - uint32 /* size */) - IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_GetPluginScriptableObject, int /* route_id */) diff --git a/content/plugin/plugin_channel.h b/content/plugin/plugin_channel.h index f3c50fc..50b2054 100644 --- a/content/plugin/plugin_channel.h +++ b/content/plugin/plugin_channel.h @@ -9,6 +9,7 @@ #include <vector> #include "base/memory/ref_counted.h" #include "base/memory/scoped_handle.h" +#include "base/process.h" #include "build/build_config.h" #include "content/plugin/plugin_channel_base.h" #include "content/plugin/webplugin_delegate_stub.h" diff --git a/content/plugin/webplugin_delegate_stub.cc b/content/plugin/webplugin_delegate_stub.cc index 73a46ad..9555313 100644 --- a/content/plugin/webplugin_delegate_stub.cc +++ b/content/plugin/webplugin_delegate_stub.cc @@ -22,10 +22,6 @@ #include "webkit/plugins/npapi/webplugin_delegate_impl.h" #include "webkit/glue/webcursor.h" -#if defined(OS_WIN) -#include "printing/metafile_impl.h" -#endif // defined(OS_WIN) - using WebKit::WebBindings; using WebKit::WebCursorInfo; using webkit::npapi::WebPlugin; @@ -104,7 +100,6 @@ bool WebPluginDelegateStub::OnMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(PluginMsg_HandleInputEvent, OnHandleInputEvent) IPC_MESSAGE_HANDLER(PluginMsg_Paint, OnPaint) IPC_MESSAGE_HANDLER(PluginMsg_DidPaint, OnDidPaint) - IPC_MESSAGE_HANDLER(PluginMsg_Print, OnPrint) IPC_MESSAGE_HANDLER(PluginMsg_GetPluginScriptableObject, OnGetPluginScriptableObject) IPC_MESSAGE_HANDLER(PluginMsg_UpdateGeometry, OnUpdateGeometry) @@ -266,36 +261,6 @@ void WebPluginDelegateStub::OnDidPaint() { webplugin_->DidPaint(); } -void WebPluginDelegateStub::OnPrint(base::SharedMemoryHandle* shared_memory, - uint32* size) { -#if defined(OS_WIN) - printing::NativeMetafile metafile; - if (!metafile.Init()) { - NOTREACHED(); - return; - } - HDC hdc = metafile.context(); - skia::PlatformDevice::InitializeDC(hdc); - delegate_->Print(hdc); - if (!metafile.FinishDocument()) { - NOTREACHED(); - return; - } - - *size = metafile.GetDataSize(); - DCHECK(*size); - base::SharedMemory shared_buf; - CreateSharedBuffer(*size, &shared_buf, shared_memory); - - // Retrieve a copy of the data. - bool success = metafile.GetData(shared_buf.memory(), *size); - DCHECK(success); -#else - // TODO(port): plugin printing. - NOTIMPLEMENTED(); -#endif -} - void WebPluginDelegateStub::OnUpdateGeometry( const PluginMsg_UpdateGeometry_Param& param) { webplugin_->UpdateGeometry( @@ -398,33 +363,6 @@ void WebPluginDelegateStub::OnInstallMissingPlugin() { delegate_->InstallMissingPlugin(); } -void WebPluginDelegateStub::CreateSharedBuffer( - uint32 size, - base::SharedMemory* shared_buf, - base::SharedMemoryHandle* remote_handle) { - if (!shared_buf->CreateAndMapAnonymous(size)) { - NOTREACHED(); - shared_buf->Close(); - return; - } - -#if defined(OS_WIN) - BOOL result = DuplicateHandle(GetCurrentProcess(), - shared_buf->handle(), - channel_->renderer_handle(), - remote_handle, 0, FALSE, - DUPLICATE_SAME_ACCESS); - DCHECK_NE(result, 0); - - // If the calling function's shared_buf is on the stack, its destructor will - // close the shared memory buffer handle. This is fine since we already - // duplicated the handle to the renderer process so it will stay "alive". -#else - // TODO(port): this should use TransportDIB. - NOTIMPLEMENTED(); -#endif -} - void WebPluginDelegateStub::OnHandleURLRequestReply( unsigned long resource_id, const GURL& url, int notify_id) { WebPluginResourceClient* resource_client = diff --git a/content/plugin/webplugin_delegate_stub.h b/content/plugin/webplugin_delegate_stub.h index 48442fa..b602a04 100644 --- a/content/plugin/webplugin_delegate_stub.h +++ b/content/plugin/webplugin_delegate_stub.h @@ -10,7 +10,6 @@ #include <vector> #include "base/memory/ref_counted.h" -#include "base/shared_memory.h" #include "base/task.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_channel.h" @@ -73,7 +72,6 @@ class WebPluginDelegateStub : public IPC::Channel::Listener, bool* handled, WebCursor* cursor); void OnPaint(const gfx::Rect& damaged_rect); void OnDidPaint(); - void OnPrint(base::SharedMemoryHandle* shared_memory, uint32* size); void OnUpdateGeometry(const PluginMsg_UpdateGeometry_Param& param); void OnGetPluginScriptableObject(int* route_id); void OnSendJavaScriptStream(const GURL& url, @@ -104,10 +102,6 @@ class WebPluginDelegateStub : public IPC::Channel::Listener, int notify_id); void OnHTTPRangeRequestReply(unsigned long resource_id, int range_request_id); - void CreateSharedBuffer(uint32 size, - base::SharedMemory* shared_buf, - base::SharedMemoryHandle* remote_handle); - std::string mime_type_; int instance_id_; diff --git a/content/renderer/webplugin_delegate_proxy.cc b/content/renderer/webplugin_delegate_proxy.cc index bcf32d0..6513306 100644 --- a/content/renderer/webplugin_delegate_proxy.cc +++ b/content/renderer/webplugin_delegate_proxy.cc @@ -54,10 +54,6 @@ #include "ipc/ipc_channel_posix.h" #endif -#if defined(OS_WIN) -#include "printing/metafile_impl.h" -#endif - using WebKit::WebBindings; using WebKit::WebCursorInfo; using WebKit::WebDragData; @@ -910,32 +906,6 @@ bool WebPluginDelegateProxy::BackgroundChanged( return false; } -void WebPluginDelegateProxy::Print(gfx::NativeDrawingContext context) { - base::SharedMemoryHandle shared_memory; - uint32 size; - if (!Send(new PluginMsg_Print(instance_id_, &shared_memory, &size))) - return; - - base::SharedMemory memory(shared_memory, true); - if (!memory.Map(size)) { - NOTREACHED(); - return; - } - -#if defined(OS_WIN) - printing::NativeMetafile metafile; - if (!metafile.InitFromData(memory.memory(), size)) { - NOTREACHED(); - return; - } - // Playback the buffer. - metafile.Playback(context, NULL); -#else - // TODO(port): plugin printing. - NOTIMPLEMENTED(); -#endif -} - NPObject* WebPluginDelegateProxy::GetPluginScriptableObject() { if (npobject_) return WebBindings::retainObject(npobject_); diff --git a/content/renderer/webplugin_delegate_proxy.h b/content/renderer/webplugin_delegate_proxy.h index 043e639..304e72b 100644 --- a/content/renderer/webplugin_delegate_proxy.h +++ b/content/renderer/webplugin_delegate_proxy.h @@ -70,7 +70,6 @@ class WebPluginDelegateProxy virtual void UpdateGeometry(const gfx::Rect& window_rect, const gfx::Rect& clip_rect); virtual void Paint(WebKit::WebCanvas* canvas, const gfx::Rect& rect); - virtual void Print(gfx::NativeDrawingContext context); virtual NPObject* GetPluginScriptableObject(); virtual void DidFinishLoadWithReason(const GURL& url, NPReason reason, int notify_id); diff --git a/webkit/plugins/npapi/webplugin_delegate.h b/webkit/plugins/npapi/webplugin_delegate.h index 8412711..c3a4a04 100644 --- a/webkit/plugins/npapi/webplugin_delegate.h +++ b/webkit/plugins/npapi/webplugin_delegate.h @@ -80,9 +80,6 @@ class WebPluginDelegate : public WebPlugin2DDeviceDelegate, // windowless plugins. virtual void Paint(WebKit::WebCanvas* canvas, const gfx::Rect& rect) = 0; - // Tells the plugin to print itself. - virtual void Print(gfx::NativeDrawingContext hdc) = 0; - // Informs the plugin that it has gained or lost focus. This is only called in // windowless mode. virtual void SetFocus(bool focused) = 0; diff --git a/webkit/plugins/npapi/webplugin_delegate_impl.h b/webkit/plugins/npapi/webplugin_delegate_impl.h index fc955a7..039bb23 100644 --- a/webkit/plugins/npapi/webplugin_delegate_impl.h +++ b/webkit/plugins/npapi/webplugin_delegate_impl.h @@ -101,7 +101,6 @@ class WebPluginDelegateImpl : public WebPluginDelegate { virtual void UpdateGeometry(const gfx::Rect& window_rect, const gfx::Rect& clip_rect); virtual void Paint(WebKit::WebCanvas* canvas, const gfx::Rect& rect); - virtual void Print(gfx::NativeDrawingContext context); virtual void SetFocus(bool focused); virtual bool HandleInputEvent(const WebKit::WebInputEvent& event, WebKit::WebCursorInfo* cursor_info); diff --git a/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc b/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc index 769bc39..dc34edb 100644 --- a/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc +++ b/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc @@ -116,10 +116,6 @@ void WebPluginDelegateImpl::Paint(WebKit::WebCanvas* canvas, skia::EndPlatformPaint(canvas); } -void WebPluginDelegateImpl::Print(cairo_t* context) { - NOTIMPLEMENTED(); -} - void WebPluginDelegateImpl::InstallMissingPlugin() { NOTIMPLEMENTED(); } diff --git a/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm b/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm index cfa5f4e..8d9351e 100644 --- a/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm +++ b/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm @@ -469,10 +469,6 @@ void WebPluginDelegateImpl::Paint(CGContextRef context, const gfx::Rect& rect) { #endif } -void WebPluginDelegateImpl::Print(CGContextRef context) { - NOTIMPLEMENTED(); -} - bool WebPluginDelegateImpl::PlatformHandleInputEvent( const WebInputEvent& event, WebCursorInfo* cursor_info) { DCHECK(cursor_info != NULL); diff --git a/webkit/plugins/npapi/webplugin_delegate_impl_win.cc b/webkit/plugins/npapi/webplugin_delegate_impl_win.cc index ff9c468..c055773 100644 --- a/webkit/plugins/npapi/webplugin_delegate_impl_win.cc +++ b/webkit/plugins/npapi/webplugin_delegate_impl_win.cc @@ -471,21 +471,6 @@ void WebPluginDelegateImpl::Paint(WebKit::WebCanvas* canvas, } } -void WebPluginDelegateImpl::Print(HDC hdc) { - // Disabling the call to NPP_Print as it causes a crash in - // flash in some cases. In any case this does not work as expected - // as the EMF meta file dc passed in needs to be created with the - // the plugin window dc as its sibling dc and the window rect - // in .01 mm units. -#if 0 - NPPrint npprint; - npprint.mode = NP_EMBED; - npprint.print.embedPrint.platformPrint = reinterpret_cast<void*>(hdc); - npprint.print.embedPrint.window = window_; - instance()->NPP_Print(&npprint); -#endif -} - void WebPluginDelegateImpl::InstallMissingPlugin() { NPEvent evt; evt.event = default_plugin::kInstallMissingPluginMessage; |