summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing/print_view_manager.cc
diff options
context:
space:
mode:
authorsverrir@google.com <sverrir@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-06 15:25:50 +0000
committersverrir@google.com <sverrir@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-06 15:25:50 +0000
commit0e0fca32b226a29a774728b642848bfdd732f791 (patch)
tree70547f886163e2a364ed47a8d5c85765d48f0e12 /chrome/browser/printing/print_view_manager.cc
parentd09e2889c21d0a420b70680291906e4a17fb8503 (diff)
downloadchromium_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/browser/printing/print_view_manager.cc')
-rw-r--r--chrome/browser/printing/print_view_manager.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc
index d775ff5..1c56d00d 100644
--- a/chrome/browser/printing/print_view_manager.cc
+++ b/chrome/browser/printing/print_view_manager.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/printing/print_view_manager.h"
#include "app/l10n_util.h"
+#include "base/scoped_ptr.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/printing/print_job.h"
#include "chrome/browser/printing/print_job_manager.h"
@@ -13,10 +14,10 @@
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "chrome/browser/tab_contents/tab_contents.h"
-#include "chrome/common/gfx/emf.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/render_messages.h"
#include "grit/generated_resources.h"
+#include "printing/native_metafile.h"
using base::TimeDelta;
@@ -95,23 +96,24 @@ void PrintViewManager::DidPrintPage(
return;
}
- base::SharedMemory shared_buf(params.emf_data_handle, true);
+ base::SharedMemory shared_buf(params.metafile_data_handle, true);
if (!shared_buf.Map(params.data_size)) {
NOTREACHED() << "couldn't map";
owner_.Stop();
return;
}
- gfx::Emf* emf = new gfx::Emf;
- if (!emf->CreateFromData(shared_buf.memory(), params.data_size)) {
- NOTREACHED() << "Invalid EMF header";
- delete emf;
+ scoped_ptr<NativeMetafile> metafile(new NativeMetafile());
+ if (!metafile->CreateFromData(shared_buf.memory(), params.data_size)) {
+ NOTREACHED() << "Invalid metafile header";
owner_.Stop();
return;
}
// Update the rendered document. It will send notifications to the listener.
- document->SetPage(params.page_number, emf, params.actual_shrink);
+ document->SetPage(params.page_number,
+ metafile.release(),
+ params.actual_shrink);
ShouldQuitFromInnerMessageLoop();
}
@@ -301,7 +303,7 @@ void PrintViewManager::TerminatePrintJob(bool cancel) {
return;
if (cancel) {
- // We don't need the EMF data anymore because the printing is canceled.
+ // We don't need the metafile data anymore because the printing is canceled.
print_job_->Cancel();
waiting_to_print_ = false;
inside_inner_message_loop_ = false;