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

Unified Diff: chrome/renderer/print_web_view_helper_linux.cc

Issue 3619002: Printing: Temporary fix on Linux using dummy print settings until we get the ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: add comment Created 10 years, 2 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 | « no previous file | printing/print_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/print_web_view_helper_linux.cc
===================================================================
--- chrome/renderer/print_web_view_helper_linux.cc (revision 61547)
+++ chrome/renderer/print_web_view_helper_linux.cc (working copy)
@@ -9,7 +9,6 @@
#include "chrome/common/render_messages.h"
#include "chrome/common/render_messages_params.h"
#include "printing/native_metafile.h"
-#include "printing/units.h"
#include "skia/ext/vector_canvas.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSize.h"
@@ -18,34 +17,6 @@
using WebKit::WebFrame;
using WebKit::WebSize;
-static void FillDefaultPrintParams(ViewMsg_Print_Params* params) {
- // TODO(myhuang): Get printing parameters via IPC
- // using the print_web_view_helper.cc version of Print.
- // For testing purpose, we hard-coded printing parameters here.
-
- // The paper size is US Letter (8.5 in. by 11 in.).
- double page_width_in_pixel = 8.5 * printing::kPixelsPerInch;
- double page_height_in_pixel = 11.0 * printing::kPixelsPerInch;
- params->page_size = gfx::Size(
- static_cast<int>(page_width_in_pixel),
- static_cast<int>(page_height_in_pixel));
- params->printable_size = gfx::Size(
- static_cast<int>(
- page_width_in_pixel -
- (NativeMetafile::kLeftMarginInInch +
- NativeMetafile::kRightMarginInInch) * printing::kPixelsPerInch),
- static_cast<int>(
- page_height_in_pixel -
- (NativeMetafile::kTopMarginInInch +
- NativeMetafile::kBottomMarginInInch) * printing::kPixelsPerInch));
- params->margin_top = static_cast<int>(
- NativeMetafile::kTopMarginInInch * printing::kPixelsPerInch);
- params->margin_left = static_cast<int>(
- NativeMetafile::kLeftMarginInInch * printing::kPixelsPerInch);
- params->dpi = printing::kPixelsPerInch;
- params->desired_dpi = params->dpi;
-}
-
void PrintWebViewHelper::PrintPages(const ViewMsg_PrintPages_Params& params,
WebFrame* frame) {
PrepareFrameAndViewForPrint prep_frame_view(params.params,
@@ -104,9 +75,6 @@
const gfx::Size& canvas_size,
WebFrame* frame,
printing::NativeMetafile* metafile) {
- ViewMsg_Print_Params default_params;
- FillDefaultPrintParams(&default_params);
-
double content_width_in_points;
double content_height_in_points;
double margin_top_in_points;
@@ -115,7 +83,7 @@
double margin_left_in_points;
GetPageSizeAndMarginsInPoints(frame,
params.page_number,
- default_params,
+ params.params,
&content_width_in_points,
&content_height_in_points,
&margin_top_in_points,
« no previous file with comments | « no previous file | printing/print_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698