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

Unified Diff: chrome/renderer/print_web_view_helper_win.cc

Issue 6544028: Create a Factory for NativeMetafile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ARM compile failure fix Created 9 years, 10 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_mac.mm ('k') | chrome/renderer/webplugin_delegate_pepper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/print_web_view_helper_win.cc
diff --git a/chrome/renderer/print_web_view_helper_win.cc b/chrome/renderer/print_web_view_helper_win.cc
index ccce2e96b976d5857bb2851ebb191e16e8596c7e..e0332c85dbe012922bf7ad6da7f965fe8cf0f644 100644
--- a/chrome/renderer/print_web_view_helper_win.cc
+++ b/chrome/renderer/print_web_view_helper_win.cc
@@ -8,6 +8,8 @@
#include "base/process_util.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/render_messages_params.h"
+#include "printing/native_metafile_factory.h"
+#include "printing/native_metafile.h"
#include "printing/units.h"
#include "skia/ext/vector_canvas.h"
#include "skia/ext/vector_platform_device.h"
@@ -67,7 +69,8 @@ void PrintWebViewHelper::PrintPage(const ViewMsg_PrintPage_Params& params,
WebFrame* frame) {
// Generate a memory-based metafile. It will use the current screen's DPI.
// Each metafile contains a single page.
- scoped_ptr<printing::NativeMetafile> metafile(new printing::NativeMetafile);
+ scoped_ptr<printing::NativeMetafile> metafile(
+ printing::NativeMetafileFactory::CreateMetafile());
metafile->CreateDc(NULL, NULL);
DCHECK(metafile->hdc());
skia::PlatformDevice::InitializeDC(metafile->hdc());
@@ -133,7 +136,8 @@ void PrintWebViewHelper::CreatePreviewDocument(
// PDF backend" work is completed for windows, make changes to replace this
// EMF with PDF metafile.
// http://code.google.com/p/chromium/issues/detail?id=62889
- scoped_ptr<printing::NativeMetafile> metafile(new printing::NativeMetafile);
+ scoped_ptr<printing::NativeMetafile> metafile(
+ printing::NativeMetafileFactory::CreateMetafile());
metafile->CreateDc(NULL, NULL);
DCHECK(metafile->hdc());
skia::PlatformDevice::InitializeDC(metafile->hdc());
@@ -258,7 +262,7 @@ void PrintWebViewHelper::RenderPage(
NOTREACHED();
scoped_ptr<printing::NativeMetafile> metafile2(
- new printing::NativeMetafile);
+ printing::NativeMetafileFactory::CreateMetafile());
// Page used alpha blend, but printer doesn't support it. Rewrite the
// metafile and flatten out the transparency.
HDC bitmap_dc = CreateCompatibleDC(GetDC(NULL));
« no previous file with comments | « chrome/renderer/print_web_view_helper_mac.mm ('k') | chrome/renderer/webplugin_delegate_pepper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698