From 0e0fca32b226a29a774728b642848bfdd732f791 Mon Sep 17 00:00:00 2001 From: "sverrir@google.com" Date: Mon, 6 Jul 2009 15:25:50 +0000 Subject: Move Emf class to the printing library. Also creates a platform agnostic NativeMetafile definition to ease platform porting. BUG=none TEST=none (No functional change) Review URL: http://codereview.chromium.org/149181 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19943 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/plugin/webplugin_delegate_stub.cc | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'chrome/plugin') diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc index 8cc3273..e607667 100644 --- a/chrome/plugin/webplugin_delegate_stub.cc +++ b/chrome/plugin/webplugin_delegate_stub.cc @@ -13,16 +13,13 @@ #include "chrome/plugin/plugin_channel.h" #include "chrome/plugin/plugin_thread.h" #include "chrome/plugin/webplugin_proxy.h" +#include "printing/native_metafile.h" #include "third_party/npapi/bindings/npapi.h" #include "third_party/npapi/bindings/npruntime.h" #include "skia/ext/platform_device.h" #include "webkit/glue/webcursor.h" #include "webkit/glue/webplugin_delegate.h" -#if defined(OS_WIN) -#include "chrome/common/gfx/emf.h" -#endif - class FinishDestructionTask : public Task { public: FinishDestructionTask(WebPluginDelegate* delegate, WebPlugin* webplugin) @@ -230,26 +227,26 @@ void WebPluginDelegateStub::OnDidPaint() { void WebPluginDelegateStub::OnPrint(base::SharedMemoryHandle* shared_memory, size_t* size) { #if defined(OS_WIN) - gfx::Emf emf; - if (!emf.CreateDc(NULL, NULL)) { + printing::NativeMetafile metafile; + if (!metafile.CreateDc(NULL, NULL)) { NOTREACHED(); return; } - HDC hdc = emf.hdc(); + HDC hdc = metafile.hdc(); skia::PlatformDevice::InitializeDC(hdc); delegate_->Print(hdc); - if (!emf.CloseDc()) { + if (!metafile.CloseDc()) { NOTREACHED(); return; } - *size = emf.GetDataSize(); + *size = metafile.GetDataSize(); DCHECK(*size); base::SharedMemory shared_buf; CreateSharedBuffer(*size, &shared_buf, shared_memory); // Retrieve a copy of the data. - bool success = emf.GetData(shared_buf.memory(), *size); + bool success = metafile.GetData(shared_buf.memory(), *size); DCHECK(success); #else // TODO(port): plugin printing. -- cgit v1.1