diff options
author | kmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-04 22:33:05 +0000 |
---|---|---|
committer | kmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-04 22:33:05 +0000 |
commit | 1098044ebaddc4b637b043e7e6654f33969fef67 (patch) | |
tree | 957e90b740542023e5978c1767722980fd4b1695 /chrome | |
parent | a0447ff91941befe514212dc07d873b2be5f2abb (diff) | |
download | chromium_src-1098044ebaddc4b637b043e7e6654f33969fef67.zip chromium_src-1098044ebaddc4b637b043e7e6654f33969fef67.tar.gz chromium_src-1098044ebaddc4b637b043e7e6654f33969fef67.tar.bz2 |
PrintPreview: Rename PrintMsg_Print_Params struct member variable (printable_size => content_size).
|printable_size| is a misnomer. |content_size| is correct.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8784012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112945 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/printing/print_dialog_cloud.cc | 2 | ||||
-rw-r--r-- | chrome/browser/printing/printing_message_filter.cc | 2 | ||||
-rw-r--r-- | chrome/common/print_messages.cc | 4 | ||||
-rw-r--r-- | chrome/common/print_messages.h | 4 | ||||
-rw-r--r-- | chrome/renderer/mock_printer.cc | 8 | ||||
-rw-r--r-- | chrome/renderer/mock_printer.h | 2 | ||||
-rw-r--r-- | chrome/renderer/print_web_view_helper.cc | 14 | ||||
-rw-r--r-- | chrome/renderer/print_web_view_helper_mac.mm | 12 | ||||
-rw-r--r-- | chrome/renderer/print_web_view_helper_win.cc | 4 |
9 files changed, 26 insertions, 26 deletions
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc index 6b94c24..59707b5 100644 --- a/chrome/browser/printing/print_dialog_cloud.cc +++ b/chrome/browser/printing/print_dialog_cloud.cc @@ -404,7 +404,7 @@ void CloudPrintFlowHandler::HandleSetPageParameters(const ListValue* args) { const double kMaxPageShrink = 2.0; PrintMsg_Print_Params default_settings; - default_settings.printable_size = gfx::Size(kWidth, kHeight); + default_settings.content_size = gfx::Size(kWidth, kHeight); default_settings.dpi = kDPI; default_settings.min_shrink = kMinPageShrink; default_settings.max_shrink = kMaxPageShrink; diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc index fc5723e..ef50b6f 100644 --- a/chrome/browser/printing/printing_message_filter.cc +++ b/chrome/browser/printing/printing_message_filter.cc @@ -44,7 +44,7 @@ static base::LazyInstance<PrintingSequencePathMap> void RenderParamsFromPrintSettings(const printing::PrintSettings& settings, PrintMsg_Print_Params* params) { params->page_size = settings.page_setup_device_units().physical_size(); - params->printable_size.SetSize( + params->content_size.SetSize( settings.page_setup_device_units().content_area().width(), settings.page_setup_device_units().content_area().height()); params->margin_top = settings.page_setup_device_units().content_area().y(); diff --git a/chrome/common/print_messages.cc b/chrome/common/print_messages.cc index 4464f13..8ec7074 100644 --- a/chrome/common/print_messages.cc +++ b/chrome/common/print_messages.cc @@ -10,7 +10,7 @@ PrintMsg_Print_Params::PrintMsg_Print_Params() : page_size(), - printable_size(), + content_size(), margin_top(0), margin_left(0), dpi(0), @@ -33,7 +33,7 @@ PrintMsg_Print_Params::~PrintMsg_Print_Params() {} void PrintMsg_Print_Params::Reset() { page_size = gfx::Size(); - printable_size = gfx::Size(); + content_size = gfx::Size(); margin_top = 0; margin_left = 0; dpi = 0; diff --git a/chrome/common/print_messages.h b/chrome/common/print_messages.h index c0af962..fef3034 100644 --- a/chrome/common/print_messages.h +++ b/chrome/common/print_messages.h @@ -27,7 +27,7 @@ struct PrintMsg_Print_Params { void Reset(); gfx::Size page_size; - gfx::Size printable_size; + gfx::Size content_size; int margin_top; int margin_left; double dpi; @@ -70,7 +70,7 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) IPC_STRUCT_TRAITS_MEMBER(page_size) // In pixels according to dpi_x and dpi_y. - IPC_STRUCT_TRAITS_MEMBER(printable_size) + IPC_STRUCT_TRAITS_MEMBER(content_size) // The y-offset of the printable area, in pixels according to dpi. IPC_STRUCT_TRAITS_MEMBER(margin_top) diff --git a/chrome/renderer/mock_printer.cc b/chrome/renderer/mock_printer.cc index 869e742a..28708df 100644 --- a/chrome/renderer/mock_printer.cc +++ b/chrome/renderer/mock_printer.cc @@ -48,7 +48,7 @@ MockPrinter::MockPrinter() use_invalid_settings_(false) { page_size_.SetSize(static_cast<int>(8.5 * dpi_), static_cast<int>(11.0 * dpi_)); - printable_size_.SetSize(static_cast<int>((7.5 * dpi_)), + content_size_.SetSize(static_cast<int>((7.5 * dpi_)), static_cast<int>((10.0 * dpi_))); margin_left_ = margin_top_ = static_cast<int>(0.5 * dpi_); } @@ -79,7 +79,7 @@ void MockPrinter::SetDefaultPrintSettings(const PrintMsg_Print_Params& params) { desired_dpi_ = params.desired_dpi; selection_only_ = params.selection_only; page_size_ = params.page_size; - printable_size_ = params.printable_size; + content_size_ = params.content_size; margin_left_ = params.margin_left; margin_top_ = params.margin_top; display_header_footer_ = params.display_header_footer; @@ -110,7 +110,7 @@ void MockPrinter::ScriptedPrint(int cookie, settings->params.selection_only = selection_only_; settings->params.document_cookie = document_cookie_; settings->params.page_size = page_size_; - settings->params.printable_size = printable_size_; + settings->params.content_size = content_size_; settings->params.is_first_request = is_first_request_; settings->params.preview_request_id = preview_request_id_; settings->params.display_header_footer = display_header_footer_; @@ -257,7 +257,7 @@ void MockPrinter::SetPrintParams(PrintMsg_Print_Params* params) { params->selection_only = selection_only_; params->document_cookie = document_cookie_; params->page_size = page_size_; - params->printable_size = printable_size_; + params->content_size = content_size_; params->margin_left = margin_left_; params->margin_top = margin_top_; params->is_first_request = is_first_request_; diff --git a/chrome/renderer/mock_printer.h b/chrome/renderer/mock_printer.h index b9d6846..c73ac87 100644 --- a/chrome/renderer/mock_printer.h +++ b/chrome/renderer/mock_printer.h @@ -107,7 +107,7 @@ class MockPrinter { // In pixels according to dpi_x and dpi_y. gfx::Size page_size_; - gfx::Size printable_size_; + gfx::Size content_size_; int margin_left_; int margin_top_; diff --git a/chrome/renderer/print_web_view_helper.cc b/chrome/renderer/print_web_view_helper.cc index 8ef7e83..499b1fd 100644 --- a/chrome/renderer/print_web_view_helper.cc +++ b/chrome/renderer/print_web_view_helper.cc @@ -100,7 +100,7 @@ int GetDPI(const PrintMsg_Print_Params* print_params) { bool PrintMsg_Print_Params_IsEmpty(const PrintMsg_Print_Params& params) { return !params.document_cookie && !params.desired_dpi && !params.max_shrink && - !params.min_shrink && !params.dpi && params.printable_size.IsEmpty() && + !params.min_shrink && !params.dpi && params.content_size.IsEmpty() && !params.selection_only && params.page_size.IsEmpty() && !params.margin_top && !params.margin_left && !params.supports_alpha_blend; @@ -108,7 +108,7 @@ bool PrintMsg_Print_Params_IsEmpty(const PrintMsg_Print_Params& params) { bool PageLayoutIsEqual(const PrintMsg_PrintPages_Params& oldParams, const PrintMsg_PrintPages_Params& newParams) { - return oldParams.params.printable_size == newParams.params.printable_size && + return oldParams.params.content_size == newParams.params.content_size && oldParams.params.page_size == newParams.params.page_size && oldParams.params.margin_top == newParams.params.margin_top && oldParams.params.margin_left == newParams.params.margin_left && @@ -138,10 +138,10 @@ bool PrintMsg_Print_Params_IsEqual( void CalculatePrintCanvasSize(const PrintMsg_Print_Params& print_params, gfx::Size* result) { int dpi = GetDPI(&print_params); - result->set_width(ConvertUnit(print_params.printable_size.width(), dpi, + result->set_width(ConvertUnit(print_params.content_size.width(), dpi, print_params.desired_dpi)); - result->set_height(ConvertUnit(print_params.printable_size.height(), dpi, + result->set_height(ConvertUnit(print_params.content_size.height(), dpi, print_params.desired_dpi)); } @@ -895,11 +895,11 @@ void PrintWebViewHelper::GetPageSizeAndMarginsInPoints( dpi, printing::kPixelsPerInch); int margin_right_in_pixels = ConvertUnit( default_params.page_size.width() - - default_params.printable_size.width() - default_params.margin_left, + default_params.content_size.width() - default_params.margin_left, dpi, printing::kPixelsPerInch); int margin_bottom_in_pixels = ConvertUnit( default_params.page_size.height() - - default_params.printable_size.height() - default_params.margin_top, + default_params.content_size.height() - default_params.margin_top, dpi, printing::kPixelsPerInch); int margin_left_in_pixels = ConvertUnit( default_params.margin_left, @@ -954,7 +954,7 @@ void PrintWebViewHelper::UpdatePrintableSizeInPrintParameters( PrintWebViewHelper::GetPageSizeAndMarginsInPoints(frame, 0, *params, &page_layout_in_points); int dpi = GetDPI(params); - params->printable_size = gfx::Size( + params->content_size = gfx::Size( static_cast<int>(ConvertUnitDouble( page_layout_in_points.content_width, printing::kPointsPerInch, dpi)), diff --git a/chrome/renderer/print_web_view_helper_mac.mm b/chrome/renderer/print_web_view_helper_mac.mm index 1700f66..dddac46 100644 --- a/chrome/renderer/print_web_view_helper_mac.mm +++ b/chrome/renderer/print_web_view_helper_mac.mm @@ -36,8 +36,8 @@ void PrintWebViewHelper::PrintPageInternal( int page_number = params.page_number; // Render page for printing. - gfx::Rect content_area(params.params.printable_size); - RenderPage(params.params.printable_size, content_area, scale_factor, + gfx::Rect content_area(params.params.content_size); + RenderPage(params.params.content_size, content_area, scale_factor, page_number, frame, false, &metafile); metafile.FinishDocument(); @@ -49,8 +49,8 @@ void PrintWebViewHelper::PrintPageInternal( page_params.page_size = params.params.page_size; page_params.content_area = gfx::Rect(params.params.margin_left, params.params.margin_top, - params.params.printable_size.width(), - params.params.printable_size.height()); + params.params.content_size.width(), + params.params.content_size.height()); // Ask the browser to create the shared memory for us. if (!CopyMetafileDataToSharedMem(&metafile, @@ -65,8 +65,8 @@ bool PrintWebViewHelper::RenderPreviewPage(int page_number) { float scale_factor = print_preview_context_.frame()->getPrintPageShrink(0); PrintMsg_Print_Params printParams = print_preview_context_.print_params(); gfx::Rect content_area(printParams.margin_left, printParams.margin_top, - printParams.printable_size.width(), - printParams.printable_size.height()); + printParams.content_size.width(), + printParams.content_size.height()); scoped_ptr<printing::Metafile> draft_metafile; printing::Metafile* initial_render_metafile = diff --git a/chrome/renderer/print_web_view_helper_win.cc b/chrome/renderer/print_web_view_helper_win.cc index 08b6bed..4ee351b 100644 --- a/chrome/renderer/print_web_view_helper_win.cc +++ b/chrome/renderer/print_web_view_helper_win.cc @@ -132,8 +132,8 @@ void PrintWebViewHelper::PrintPageInternal( page_params.actual_shrink = scale_factor; page_params.page_size = params.params.page_size; page_params.content_area = gfx::Rect(params.params.margin_left, - params.params.margin_top, params.params.printable_size.width(), - params.params.printable_size.height()); + params.params.margin_top, params.params.content_size.width(), + params.params.content_size.height()); if (!CopyMetafileDataToSharedMem(metafile.get(), &(page_params.metafile_data_handle))) { |