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

Unified Diff: chrome/browser/resources/print_preview/page_settings.js

Issue 7647010: Print preview page selection should not require a rerendering of draft pages. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed comment Created 9 years, 4 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
Index: chrome/browser/resources/print_preview/page_settings.js
diff --git a/chrome/browser/resources/print_preview/page_settings.js b/chrome/browser/resources/print_preview/page_settings.js
index a0c36d0701f38d3fc5d444cc52e13687661d0603..dd36aaa2bb77b0f20454824d11182c7752b10a4d 100644
--- a/chrome/browser/resources/print_preview/page_settings.js
+++ b/chrome/browser/resources/print_preview/page_settings.js
@@ -177,9 +177,8 @@ cr.define('print_preview', function() {
/**
* Updates |this.previouslySelectedPages_| with the currently selected
* pages.
- * @private
*/
- updatePageSelection_: function() {
+ updatePageSelection: function() {
this.previouslySelectedPages_ = this.selectedPagesSet;
},
@@ -194,6 +193,14 @@ cr.define('print_preview', function() {
},
/**
+ * Checks if the page selection has changed and is valid.
+ * @return {boolean} true if the page selection is changed and is valid.
+ */
+ hasPageSelectionChangedAndIsValid: function() {
+ return this.isPageSelectionValid() && this.hasPageSelectionChanged_();
+ },
+
+ /**
* Validates the contents of |this.selectedPagesTextfield|.
*
* @return {boolean} true if the text is valid.
@@ -212,8 +219,8 @@ cr.define('print_preview', function() {
* @return {boolean} true if a new preview was requested.
*/
requestPrintPreviewIfNeeded: function() {
- if (this.isPageSelectionValid() && this.hasPageSelectionChanged_()) {
- this.updatePageSelection_();
+ if (this.hasPageSelectionChangedAndIsValid()) {
+ this.updatePageSelection();
requestPrintPreview();
return true;
}
@@ -274,7 +281,6 @@ cr.define('print_preview', function() {
cr.dispatchSimpleEvent(document, 'updatePrintButton');
return;
}
- this.previouslySelectedPages_ = this.selectedPagesSet;
requestPrintPreview();
},

Powered by Google App Engine
This is Rietveld 408576698