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

Unified Diff: chrome/browser/printing/print_view_manager.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/print_job_worker.cc ('k') | chrome/browser/printing/printed_document.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_view_manager.cc
===================================================================
--- chrome/browser/printing/print_view_manager.cc (revision 19913)
+++ chrome/browser/printing/print_view_manager.cc (working copy)
@@ -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 @@
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 @@
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;
« no previous file with comments | « chrome/browser/printing/print_job_worker.cc ('k') | chrome/browser/printing/printed_document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698