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

Side by Side Diff: chrome/browser/resources/print_preview/data/print_ticket_store.js

Issue 2516523002: Fix CrOS reverting to Save as PDF and random PDF preview fail (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'use strict'; 6 'use strict';
7 7
8 // TODO(rltoscano): Maybe clear print ticket when destination changes. Or 8 // TODO(rltoscano): Maybe clear print ticket when destination changes. Or
9 // better yet, carry over any print ticket state that is possible. I.e. if 9 // better yet, carry over any print ticket state that is possible. I.e. if
10 // destination changes, the new destination might not support duplex anymore, 10 // destination changes, the new destination might not support duplex anymore,
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 } 551 }
552 this.vendorItems_.updateValue({}); 552 this.vendorItems_.updateValue({});
553 } 553 }
554 }, 554 },
555 555
556 /** 556 /**
557 * Called when the capabilities of the selected destination are ready. 557 * Called when the capabilities of the selected destination are ready.
558 * @private 558 * @private
559 */ 559 */
560 onSelectedDestinationCapabilitiesReady_: function() { 560 onSelectedDestinationCapabilitiesReady_: function() {
561 if (!this.destinationStore_.selectedDestination)
dpapad 2016/11/18 00:29:16 Can you add a comment explaining how this function
rbpotter 2016/11/18 02:59:23 I was getting an error here previously but after f
562 return;
561 var caps = assert( 563 var caps = assert(
562 this.destinationStore_.selectedDestination.capabilities); 564 this.destinationStore_.selectedDestination.capabilities);
563 var isFirstUpdate = this.capabilitiesHolder_.get() == null; 565 var isFirstUpdate = this.capabilitiesHolder_.get() == null;
564 this.capabilitiesHolder_.set(caps); 566 this.capabilitiesHolder_.set(caps);
565 if (isFirstUpdate) { 567 if (isFirstUpdate) {
566 this.isInitialized_ = true; 568 this.isInitialized_ = true;
567 cr.dispatchSimpleEvent(this, PrintTicketStore.EventType.INITIALIZE); 569 cr.dispatchSimpleEvent(this, PrintTicketStore.EventType.INITIALIZE);
568 } else { 570 } else {
569 cr.dispatchSimpleEvent( 571 cr.dispatchSimpleEvent(
570 this, PrintTicketStore.EventType.CAPABILITIES_CHANGE); 572 this, PrintTicketStore.EventType.CAPABILITIES_CHANGE);
571 } 573 }
572 }, 574 },
573 575
574 /** 576 /**
575 * Called when document data model has changed. Dispatches a print ticket 577 * Called when document data model has changed. Dispatches a print ticket
576 * store event. 578 * store event.
577 * @private 579 * @private
578 */ 580 */
579 onDocumentInfoChange_: function() { 581 onDocumentInfoChange_: function() {
580 cr.dispatchSimpleEvent(this, PrintTicketStore.EventType.DOCUMENT_CHANGE); 582 cr.dispatchSimpleEvent(this, PrintTicketStore.EventType.DOCUMENT_CHANGE);
581 }, 583 },
582 }; 584 };
583 585
584 // Export 586 // Export
585 return { 587 return {
586 PrintTicketStore: PrintTicketStore 588 PrintTicketStore: PrintTicketStore
587 }; 589 };
588 }); 590 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698