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

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

Issue 2935303003: Print Preview: Remove global onPrivetPrintFailed (Closed)
Patch Set: Fix annotations Created 3 years, 6 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 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 /** 8 /**
9 * A data store that stores destinations and dispatches events when the data 9 * A data store that stores destinations and dispatches events when the data
10 * store changes. 10 * store changes.
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 * @param {?string} serializedDefaultDestinationSelectionRulesStr Serialized 550 * @param {?string} serializedDefaultDestinationSelectionRulesStr Serialized
551 * default destination selection rules. 551 * default destination selection rules.
552 */ 552 */
553 init: function( 553 init: function(
554 isInAppKioskMode, 554 isInAppKioskMode,
555 systemDefaultDestinationId, 555 systemDefaultDestinationId,
556 serializedDefaultDestinationSelectionRulesStr) { 556 serializedDefaultDestinationSelectionRulesStr) {
557 this.pdfPrinterEnabled_ = !isInAppKioskMode; 557 this.pdfPrinterEnabled_ = !isInAppKioskMode;
558 this.systemDefaultDestinationId_ = systemDefaultDestinationId; 558 this.systemDefaultDestinationId_ = systemDefaultDestinationId;
559 this.createLocalPdfPrintDestination_(); 559 this.createLocalPdfPrintDestination_();
560 cr.addWebUIListener('privet-printer-added',
561 this.onPrivetPrinterAdded_.bind(this));
562 cr.addWebUIListener('extension-printers-added',
563 this.onExtensionPrintersAdded_.bind(this));
564 560
565 if (!this.appState_.isSelectedDestinationValid()) { 561 if (!this.appState_.isSelectedDestinationValid()) {
566 var destinationMatch = this.convertToDestinationMatch_( 562 var destinationMatch = this.convertToDestinationMatch_(
567 serializedDefaultDestinationSelectionRulesStr); 563 serializedDefaultDestinationSelectionRulesStr);
568 if (destinationMatch) { 564 if (destinationMatch) {
569 this.fetchMatchingDestination_(destinationMatch); 565 this.fetchMatchingDestination_(destinationMatch);
570 return; 566 return;
571 } 567 }
572 } 568 }
573 569
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 return this.getDestinationKey_( 1665 return this.getDestinationKey_(
1670 destination.origin, destination.id, destination.account); 1666 destination.origin, destination.id, destination.account);
1671 } 1667 }
1672 }; 1668 };
1673 1669
1674 // Export 1670 // Export
1675 return { 1671 return {
1676 DestinationStore: DestinationStore 1672 DestinationStore: DestinationStore
1677 }; 1673 };
1678 }); 1674 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/component.js ('k') | chrome/browser/resources/print_preview/native_layer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698