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

Unified Diff: chrome/browser/printing/printed_document.cc

Issue 149181: Move Emf class to the printing library. Also creates a platform agnostic Nat... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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/browser/printing/printed_document.h ('k') | chrome/browser/printing/printed_page.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/printed_document.cc
===================================================================
--- chrome/browser/printing/printed_document.cc (revision 19913)
+++ chrome/browser/printing/printed_document.cc (working copy)
@@ -18,7 +18,6 @@
#include "chrome/browser/printing/page_overlays.h"
#include "chrome/browser/printing/printed_pages_source.h"
#include "chrome/browser/printing/printed_page.h"
-#include "chrome/common/gfx/emf.h"
#include "printing/units.h"
#include "skia/ext/platform_device.h"
@@ -60,12 +59,14 @@
PrintedDocument::~PrintedDocument() {
}
-void PrintedDocument::SetPage(int page_number, gfx::Emf* emf, double shrink) {
+void PrintedDocument::SetPage(int page_number,
+ NativeMetafile* metafile,
+ double shrink) {
// Notice the page_number + 1, the reason is that this is the value that will
// be shown. Users dislike 0-based counting.
scoped_refptr<PrintedPage> page(
new PrintedPage(page_number + 1,
- emf, immutable_.settings_.page_setup_pixels().physical_size()));
+ metafile, immutable_.settings_.page_setup_pixels().physical_size()));
{
AutoLock lock(lock_);
mutable_.pages_[page_number] = page;
@@ -123,7 +124,7 @@
BOOL res = ModifyWorldTransform(context, &xform, MWT_LEFTMULTIPLY);
DCHECK_NE(res, 0);
- if (!page.emf()->SafePlayback(context)) {
+ if (!page.native_metafile()->SafePlayback(context)) {
NOTREACHED();
}
@@ -176,7 +177,7 @@
for (; page != PageNumber::npos(); ++page) {
PrintedPages::const_iterator itr = mutable_.pages_.find(page.ToInt());
if (itr == mutable_.pages_.end() || !itr->second.get() ||
- !itr->second->emf())
+ !itr->second->native_metafile())
return false;
}
return true;
@@ -202,7 +203,7 @@
}
size_t total = 0;
for (size_t i = 0; i < pages_copy.size(); ++i) {
- total += pages_copy[i]->emf()->GetDataSize();
+ total += pages_copy[i]->native_metafile()->GetDataSize();
}
return total;
}
@@ -321,7 +322,7 @@
file_util::ReplaceIllegalCharacters(&filename, '_');
std::wstring path(g_debug_dump_info->debug_dump_path);
file_util::AppendToPath(&path, filename);
- page.emf()->SaveTo(path);
+ page.native_metafile()->SaveTo(path);
}
void PrintedDocument::set_debug_dump_path(const std::wstring& debug_dump_path) {
« no previous file with comments | « chrome/browser/printing/printed_document.h ('k') | chrome/browser/printing/printed_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698