diff options
author | thestig <thestig@chromium.org> | 2016-02-09 16:44:21 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-10 00:45:32 +0000 |
commit | 5e8544fc5972711c5237e3bcd8c018a0b439f4f1 (patch) | |
tree | d958330ceb3c6bad387516c4107eef42be0df779 | |
parent | da238c344c410840c91669a52b8ec6cebe04ee7f (diff) | |
download | chromium_src-5e8544fc5972711c5237e3bcd8c018a0b439f4f1.zip chromium_src-5e8544fc5972711c5237e3bcd8c018a0b439f4f1.tar.gz chromium_src-5e8544fc5972711c5237e3bcd8c018a0b439f4f1.tar.bz2 |
Cleanup: Remove unused PrintSettings shrink factors.
- They have been unused for 7 years.
- The copy that is being used eventually moved to
third_party/WebKit/Source/core/page/PrintContext.cpp.
Review URL: https://codereview.chromium.org/1676953003
Cr-Commit-Position: refs/heads/master@{#374553}
-rw-r--r-- | chrome/test/data/printing/cloud_print_uitest.html | 4 | ||||
-rw-r--r-- | components/printing/browser/print_manager_utils.cc | 4 | ||||
-rw-r--r-- | components/printing/common/print_messages.cc | 4 | ||||
-rw-r--r-- | components/printing/common/print_messages.h | 8 | ||||
-rw-r--r-- | components/printing/renderer/print_web_view_helper.cc | 6 | ||||
-rw-r--r-- | components/printing/test/mock_printer.cc | 8 | ||||
-rw-r--r-- | components/printing/test/mock_printer.h | 2 | ||||
-rw-r--r-- | printing/print_settings.cc | 2 | ||||
-rw-r--r-- | printing/print_settings.h | 17 | ||||
-rw-r--r-- | printing/print_settings_conversion.cc | 2 |
10 files changed, 4 insertions, 53 deletions
diff --git a/chrome/test/data/printing/cloud_print_uitest.html b/chrome/test/data/printing/cloud_print_uitest.html index 2b79b4a..73a7537 100644 --- a/chrome/test/data/printing/cloud_print_uitest.html +++ b/chrome/test/data/printing/cloud_print_uitest.html @@ -2,7 +2,7 @@ <html> <head> <title>Cloud Print Dialog unittest</title> -<script language="javascript"> +<script language="javascript"> window.onload = onLoad; function onLoad() { @@ -10,8 +10,6 @@ function testPageSetup() { var result = JSON.stringify({'dpi': 300, - 'min_shrink': 1.25, - 'max_shrink': 2.0, 'selection_only': false}); chrome.send('SetPageParameters', [result]); } diff --git a/components/printing/browser/print_manager_utils.cc b/components/printing/browser/print_manager_utils.cc index 7d9df74..44525b5 100644 --- a/components/printing/browser/print_manager_utils.cc +++ b/components/printing/browser/print_manager_utils.cc @@ -22,10 +22,6 @@ void RenderParamsFromPrintSettings(const PrintSettings& settings, params->margin_top = settings.page_setup_device_units().content_area().y(); params->margin_left = settings.page_setup_device_units().content_area().x(); params->dpi = settings.dpi(); - // Currently hardcoded at 1.25. See PrintSettings' constructor. - params->min_shrink = settings.min_shrink(); - // Currently hardcoded at 2.0. See PrintSettings' constructor. - params->max_shrink = settings.max_shrink(); // Currently hardcoded at 72dpi. See PrintSettings' constructor. params->desired_dpi = settings.desired_dpi(); // Always use an invalid cookie. diff --git a/components/printing/common/print_messages.cc b/components/printing/common/print_messages.cc index c3469fc..2f36b94 100644 --- a/components/printing/common/print_messages.cc +++ b/components/printing/common/print_messages.cc @@ -41,8 +41,6 @@ PrintMsg_Print_Params::PrintMsg_Print_Params() margin_top(0), margin_left(0), dpi(0), - min_shrink(0), - max_shrink(0), desired_dpi(0), document_cookie(0), selection_only(false), @@ -67,8 +65,6 @@ void PrintMsg_Print_Params::Reset() { margin_top = 0; margin_left = 0; dpi = 0; - min_shrink = 0; - max_shrink = 0; desired_dpi = 0; document_cookie = 0; selection_only = false; diff --git a/components/printing/common/print_messages.h b/components/printing/common/print_messages.h index 6060a1c..2cbffeb 100644 --- a/components/printing/common/print_messages.h +++ b/components/printing/common/print_messages.h @@ -42,8 +42,6 @@ struct PrintMsg_Print_Params { int margin_top; int margin_left; double dpi; - double min_shrink; - double max_shrink; int desired_dpi; int document_cookie; bool selection_only; @@ -119,12 +117,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) // Specifies dots per inch. IPC_STRUCT_TRAITS_MEMBER(dpi) - // Minimum shrink factor. See PrintSettings::min_shrink for more information. - IPC_STRUCT_TRAITS_MEMBER(min_shrink) - - // Maximum shrink factor. See PrintSettings::max_shrink for more information. - IPC_STRUCT_TRAITS_MEMBER(max_shrink) - // Desired apparent dpi on paper. IPC_STRUCT_TRAITS_MEMBER(desired_dpi) diff --git a/components/printing/renderer/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc index f2556cc..91c7230 100644 --- a/components/printing/renderer/print_web_view_helper.cc +++ b/components/printing/renderer/print_web_view_helper.cc @@ -111,9 +111,9 @@ int GetDPI(const PrintMsg_Print_Params* print_params) { bool PrintMsg_Print_Params_IsValid(const PrintMsg_Print_Params& params) { return !params.content_size.IsEmpty() && !params.page_size.IsEmpty() && !params.printable_area.IsEmpty() && params.document_cookie && - params.desired_dpi && params.max_shrink && params.min_shrink && - params.dpi && (params.margin_top >= 0) && (params.margin_left >= 0) && - params.dpi > kMinDpi && params.document_cookie != 0; + params.desired_dpi && params.dpi && params.margin_top >= 0 && + params.margin_left >= 0 && params.dpi > kMinDpi && + params.document_cookie != 0; } PrintMsg_Print_Params GetCssPrintParams( diff --git a/components/printing/test/mock_printer.cc b/components/printing/test/mock_printer.cc index fd0ac7e..004e008 100644 --- a/components/printing/test/mock_printer.cc +++ b/components/printing/test/mock_printer.cc @@ -57,8 +57,6 @@ MockPrinterPage::~MockPrinterPage() { MockPrinter::MockPrinter() : dpi_(printing::kPointsPerInch), - max_shrink_(2.0), - min_shrink_(1.25), desired_dpi_(printing::kPointsPerInch), selection_only_(false), should_print_backgrounds_(false), @@ -106,8 +104,6 @@ void MockPrinter::GetDefaultPrintSettings(PrintMsg_Print_Params* params) { void MockPrinter::SetDefaultPrintSettings(const PrintMsg_Print_Params& params) { dpi_ = params.dpi; - max_shrink_ = params.max_shrink; - min_shrink_ = params.min_shrink; desired_dpi_ = params.desired_dpi; selection_only_ = params.selection_only; should_print_backgrounds_ = params.should_print_backgrounds; @@ -145,8 +141,6 @@ void MockPrinter::ScriptedPrint(int cookie, settings->Reset(); settings->params.dpi = dpi_; - settings->params.max_shrink = max_shrink_; - settings->params.min_shrink = min_shrink_; settings->params.desired_dpi = desired_dpi_; settings->params.selection_only = selection_only_; settings->params.should_print_backgrounds = should_print_backgrounds_; @@ -286,8 +280,6 @@ int MockPrinter::CreateDocumentCookie() { void MockPrinter::SetPrintParams(PrintMsg_Print_Params* params) { params->dpi = dpi_; - params->max_shrink = max_shrink_; - params->min_shrink = min_shrink_; params->desired_dpi = desired_dpi_; params->selection_only = selection_only_; params->should_print_backgrounds = should_print_backgrounds_; diff --git a/components/printing/test/mock_printer.h b/components/printing/test/mock_printer.h index c989d58..37cae6c 100644 --- a/components/printing/test/mock_printer.h +++ b/components/printing/test/mock_printer.h @@ -121,8 +121,6 @@ class MockPrinter { // Specifies dots per inch. double dpi_; - double max_shrink_; - double min_shrink_; // Desired apparent dpi on paper. int desired_dpi_; diff --git a/printing/print_settings.cc b/printing/print_settings.cc index 7f555f0..159cfa5 100644 --- a/printing/print_settings.cc +++ b/printing/print_settings.cc @@ -131,8 +131,6 @@ PrintSettings::~PrintSettings() { void PrintSettings::Clear() { ranges_.clear(); margin_type_ = DEFAULT_MARGINS; - min_shrink_ = 1.25; - max_shrink_ = 2.; desired_dpi_ = 72; selection_only_ = false; title_ = base::string16(); diff --git a/printing/print_settings.h b/printing/print_settings.h index 08c7d56..6c4f8e7 100644 --- a/printing/print_settings.h +++ b/printing/print_settings.h @@ -143,10 +143,6 @@ class PRINTING_EXPORT PrintSettings { int desired_dpi() const { return desired_dpi_; } - double max_shrink() const { return max_shrink_; } - - double min_shrink() const { return min_shrink_; } - // Cookie generator. It is used to initialize PrintedDocument with its // associated PrintSettings, to be sure that each generated PrintedPage is // correctly associated with its corresponding PrintedDocument. @@ -157,19 +153,6 @@ class PRINTING_EXPORT PrintSettings { // This permits printing selected pages only. PageRanges ranges_; - // By imaging to a width a little wider than the available pixels, thin pages - // will be scaled down a little, matching the way they print in IE and Camino. - // This lets them use fewer sheets than they would otherwise, which is - // presumably why other browsers do this. Wide pages will be scaled down more - // than this. - double min_shrink_; - - // This number determines how small we are willing to reduce the page content - // in order to accommodate the widest line. If the page would have to be - // reduced smaller to make the widest line fit, we just clip instead (this - // behavior matches MacIE and Mozilla, at least) - double max_shrink_; - // Desired visible dots per inch rendering for output. Printing should be // scaled to ScreenDpi/dpix*desired_dpi. int desired_dpi_; diff --git a/printing/print_settings_conversion.cc b/printing/print_settings_conversion.cc index cd0c059..6200d7c 100644 --- a/printing/print_settings_conversion.cc +++ b/printing/print_settings_conversion.cc @@ -227,8 +227,6 @@ void PrintSettingsToJobSettingsDebug(const PrintSettings& settings, // common public constants. So just serialize in "debug" section. base::DictionaryValue* debug = new base::DictionaryValue; job_settings->Set("debug", debug); - debug->SetDouble("minShrink", settings.min_shrink()); - debug->SetDouble("maxShrink", settings.max_shrink()); debug->SetInteger("desiredDpi", settings.desired_dpi()); debug->SetInteger("dpi", settings.dpi()); debug->SetInteger("deviceUnitsPerInch", settings.device_units_per_inch()); |