Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1665)

Unified Diff: content/plugin/webplugin_delegate_stub.cc

Issue 6826027: Connect the right metafiles for print preview on Linux and Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile problems Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/print_web_view_helper_win.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/plugin/webplugin_delegate_stub.cc
diff --git a/content/plugin/webplugin_delegate_stub.cc b/content/plugin/webplugin_delegate_stub.cc
index 3b1e680c5b765c7c4ac6bf63b5821472d79152ad..73a46ad15af740899952bd054bf353ef5a09f986 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.
« no previous file with comments | « chrome/renderer/print_web_view_helper_win.cc ('k') | content/renderer/render_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698