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

Unified Diff: chrome/common/temp_scaffolding_stubs.cc

Issue 203062: Linux: print page to file rather than using shared memory to send it to the b... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: style Created 11 years, 3 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/common/temp_scaffolding_stubs.h ('k') | chrome/renderer/print_web_view_helper_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/temp_scaffolding_stubs.cc
===================================================================
--- chrome/common/temp_scaffolding_stubs.cc (revision 26282)
+++ chrome/common/temp_scaffolding_stubs.cc (working copy)
@@ -13,12 +13,8 @@
#include "chrome/browser/rlz/rlz.h"
#if defined(OS_LINUX)
-#include "base/path_service.h"
#include "chrome/browser/dock_info.h"
-#include "chrome/browser/tab_contents/tab_contents.h"
-#include "chrome/common/chrome_paths.h"
#include "chrome/common/render_messages.h"
-#include "printing/native_metafile.h"
#endif
#if defined(OS_MACOSX)
@@ -326,47 +322,3 @@
#endif
-//------------------------------------------------------------------------------
-
-#if defined(OS_LINUX)
-// TODO(myhuang): This is a quick hack for testing purpose. We should implement
-// PrintViewManager and other related classes later on Linux.
-namespace printing {
-
-void PrintViewManager::DidPrintPage(
- const ViewHostMsg_DidPrintPage_Params& params) {
- base::SharedMemory shared_buf(params.metafile_data_handle, true);
- if (!shared_buf.Map(params.data_size)) {
- NOTREACHED() << "couldn't map";
- owner_.Stop();
- return;
- }
-
- // The only format we can use now is PDF since Cairo needs to create a
- // temporary file for a PostScript surface. We do not allow disk I/O in the
- // renderer.
- scoped_ptr<NativeMetafile> metafile(
- new NativeMetafile(printing::NativeMetafile::PDF));
-
- if (!metafile->Init(shared_buf.memory(), params.data_size)) {
- NOTREACHED() << "Invalid metafile header";
- shared_buf.Unmap();
- owner_.Stop();
- return;
- }
-
- // Save the PDF file to default download location.
- // NOTE: Existing file will be overwritten.
- FilePath default_save_path;
- if (!PathService::Get(chrome::DIR_DEFAULT_DOWNLOADS, &default_save_path)) {
- NOTREACHED();
- }
- FilePath save_filename =
- default_save_path.Append(FilePath("chromium_printing_test.pdf"));
- metafile->SaveTo(save_filename);
- shared_buf.Unmap();
-}
-
-} // namespace printing
-
-#endif
« no previous file with comments | « chrome/common/temp_scaffolding_stubs.h ('k') | chrome/renderer/print_web_view_helper_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698