diff options
author | sverrir@google.com <sverrir@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-06 15:25:50 +0000 |
---|---|---|
committer | sverrir@google.com <sverrir@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-06 15:25:50 +0000 |
commit | 0e0fca32b226a29a774728b642848bfdd732f791 (patch) | |
tree | 70547f886163e2a364ed47a8d5c85765d48f0e12 /chrome/plugin | |
parent | d09e2889c21d0a420b70680291906e4a17fb8503 (diff) | |
download | chromium_src-0e0fca32b226a29a774728b642848bfdd732f791.zip chromium_src-0e0fca32b226a29a774728b642848bfdd732f791.tar.gz chromium_src-0e0fca32b226a29a774728b642848bfdd732f791.tar.bz2 |
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
Diffstat (limited to 'chrome/plugin')
-rw-r--r-- | chrome/plugin/webplugin_delegate_stub.cc | 17 |
1 files changed, 7 insertions, 10 deletions
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. |