Chromium Code Reviews| 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 48210c64dc0c8d3a2f80361c9c3fbdb7357cf6ba..28f70bf3f758f2a544ce5df7607ba2a75d1eba20 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; |
|
dpapad
2011/08/01 17:51:40
This seems to leave the object in an inconsistent
kmadhusu
2011/08/02 22:53:45
I have called updatePageSelection() in requestPrin
|
| requestPrintPreview(); |
| }, |