Print Preview: Making margin selection sticky (part 1/2).
This CL makes sticky default, minimum and no margins selections. Selecting custom margins is not remembered for now (will be addressed in a follow up CL).
BUG=102446
TEST=See bug description.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=108245
http://codereview.chromium.org/8428005/diff/2002/chrome/browser/resources/print_preview/margin_settings.js File chrome/browser/resources/print_preview/margin_settings.js (right): http://codereview.chromium.org/8428005/diff/2002/chrome/browser/resources/print_preview/margin_settings.js#newcode198 chrome/browser/resources/print_preview/margin_settings.js:198: MarginSettings.valueToIndex = {}; Is there any specific reason to ...
http://codereview.chromium.org/8428005/diff/2002/chrome/browser/resources/pri...
File chrome/browser/resources/print_preview/margin_settings.js (right):
http://codereview.chromium.org/8428005/diff/2002/chrome/browser/resources/pri...
chrome/browser/resources/print_preview/margin_settings.js:198:
MarginSettings.valueToIndex = {};
On 2011/11/01 17:17:57, kmadhusu wrote:
> Is there any specific reason to create this object?
> Index and the value are the same all the time.
>
> MarginSettings.valueToIndex[0] = 0;
> MarginSettings.valueToIndex[1] = 1;
> MarginSettings.valueToIndex[2] = 2;
> MarginSettings.valueToIndex[3] = 3;
>
It happens to be the same, but this is not a constraint. I did it this way to
allow for reordering the options in the dropdown without any other changes
needed. Otherwise reordering the options will also require to change the "value"
to match the index in 2 places (margin_settings.html and print_job_constants.h).
http://codereview.chromium.org/8428005/diff/2002/printing/print_job_constants.h
File printing/print_job_constants.h (right):
http://codereview.chromium.org/8428005/diff/2002/printing/print_job_constants...
printing/print_job_constants.h:121: PRINTABLE_AREA_MARGINS,
On 2011/11/01 17:17:57, kmadhusu wrote:
> Can you rename this as MINIMUM_MARGINS?
I think that the current name is more descriptive from the suggested ine. We
display "Minimum" to the user for simplicity but that does not need to affect
internal naming. Maybe vandebo has a stronger opinion on whether to rename or
not.
Issue 8428005: Print Preview: Making margin selection sticky (part 1/2).
(Closed)
Created 9 years, 1 month ago by dpapad
Modified 9 years, 1 month ago
Reviewers: vandebo (ex-Chrome), kmadhusu
Base URL: svn://svn.chromium.org/chrome/trunk/src
Comments: 9