summaryrefslogtreecommitdiffstats
path: root/content/plugin
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-11 21:54:06 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-11 21:54:06 +0000
commit7d748990b39550c77aa914ba6846885dd7352e10 (patch)
tree3777582ee9816b3488f218b594db1918e5ebe752 /content/plugin
parent03e204f307255e8f39aeb002f94b8eb04137e7f9 (diff)
downloadchromium_src-7d748990b39550c77aa914ba6846885dd7352e10.zip
chromium_src-7d748990b39550c77aa914ba6846885dd7352e10.tar.gz
chromium_src-7d748990b39550c77aa914ba6846885dd7352e10.tar.bz2
Connect the right metafiles for print preview on Linux and Windows.
+ Remove the NativeMetafileFactory since we can't just use preview flag. + Update each Metafile constructor site to use PreviewMetafile or NativeMetafileImpl. + Fix misc. problems blocking pdf generation on Windows. + Rename the metafile interface. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/6826027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/plugin')
-rw-r--r--content/plugin/webplugin_delegate_stub.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/content/plugin/webplugin_delegate_stub.cc b/content/plugin/webplugin_delegate_stub.cc
index 3b1e680..73a46ad 100644
--- a/content/plugin/webplugin_delegate_stub.cc
+++ b/content/plugin/webplugin_delegate_stub.cc
@@ -23,9 +23,7 @@
#include "webkit/glue/webcursor.h"
#if defined(OS_WIN)
-#include "base/memory/scoped_ptr.h"
-#include "printing/native_metafile_factory.h"
-#include "printing/native_metafile.h"
+#include "printing/metafile_impl.h"
#endif // defined(OS_WIN)
using WebKit::WebBindings;
@@ -271,27 +269,26 @@ void WebPluginDelegateStub::OnDidPaint() {
void WebPluginDelegateStub::OnPrint(base::SharedMemoryHandle* shared_memory,
uint32* size) {
#if defined(OS_WIN)
- scoped_ptr<printing::NativeMetafile> metafile(
- printing::NativeMetafileFactory::Create());
- if (!metafile->Init()) {
+ printing::NativeMetafile metafile;
+ if (!metafile.Init()) {
NOTREACHED();
return;
}
- HDC hdc = metafile->context();
+ HDC hdc = metafile.context();
skia::PlatformDevice::InitializeDC(hdc);
delegate_->Print(hdc);
- if (!metafile->FinishDocument()) {
+ if (!metafile.FinishDocument()) {
NOTREACHED();
return;
}
- *size = metafile->GetDataSize();
+ *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);
+ bool success = metafile.GetData(shared_buf.memory(), *size);
DCHECK(success);
#else
// TODO(port): plugin printing.