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

Unified Diff: chrome/browser/resources/print_preview/data/print_ticket_store.js

Issue 15495007: Begins preview generation as soon as initial state is loaded. Doesn't wait for print destination to… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/native_layer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/data/print_ticket_store.js
diff --git a/chrome/browser/resources/print_preview/data/print_ticket_store.js b/chrome/browser/resources/print_preview/data/print_ticket_store.js
index 94e4b6aa91aa0fc83ea1047053aa228e99e40051..d217132b5d47634c31cb222bbeff32a7e039a10d 100644
--- a/chrome/browser/resources/print_preview/data/print_ticket_store.js
+++ b/chrome/browser/resources/print_preview/data/print_ticket_store.js
@@ -272,6 +272,8 @@ cr.define('print_preview', function() {
this.cssBackground_.updateValue(this.appState_.getField(
print_preview.AppState.Field.IS_CSS_BACKGROUND_ENABLED));
}
+ this.isInitialized_ = true;
+ cr.dispatchSimpleEvent(this, PrintTicketStore.EventType.INITIALIZE);
},
/** @return {boolean} Whether the header-footer capability is available. */
@@ -519,10 +521,7 @@ cr.define('print_preview', function() {
var caps = this.destinationStore_.selectedDestination.capabilities;
var isFirstUpdate = this.capabilitiesHolder_.get() == null;
this.capabilitiesHolder_.set(caps);
- if (isFirstUpdate) {
- this.isInitialized_ = true;
- cr.dispatchSimpleEvent(this, PrintTicketStore.EventType.INITIALIZE);
- } else {
+ if (!isFirstUpdate) {
// Reset user selection for certain ticket items.
this.customMargins_.updateValue(null);
this.appState_.persistCustomMargins(null);
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/native_layer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698