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

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

Issue 1148383002: Add onGetUsbPrinterInfoRequested event to printerProvider API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split out print_preview integration into a separate patch. Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | extensions/browser/api/printer_provider/printer_provider_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 /** 1001 /**
1002 * Called when an extension responds to a getExtensionDestinations 1002 * Called when an extension responds to a getExtensionDestinations
1003 * request. 1003 * request.
1004 * @param {Object} event Contains information about list of printers 1004 * @param {Object} event Contains information about list of printers
1005 * reported by the extension. 1005 * reported by the extension.
1006 * {@code done} parameter is set iff this is the final list of printers 1006 * {@code done} parameter is set iff this is the final list of printers
1007 * returned as part of getExtensionDestinations request. 1007 * returned as part of getExtensionDestinations request.
1008 * @private 1008 * @private
1009 */ 1009 */
1010 onExtensionPrintersAdded_: function(event) { 1010 onExtensionPrintersAdded_: function(event) {
1011 this.insertDestinations_(event.printers.map(function(printer) { 1011 // Filter out printers enumerated from providers' "usbPrinters" manifest
1012 // key for now.
1013 var filteredPrinters = event.printers.filter(function(printer) {
Vitaly Buka (NO REVIEWS) 2015/05/21 00:54:43 this piece for another CL?
Reilly Grant (use Gerrit) 2015/05/21 00:59:55 This piece keeps the changes in this CL from havin
1014 return 'extensionId' in printer;
1015 });
1016 this.insertDestinations_(filteredPrinters.map(function(printer) {
1012 return print_preview.ExtensionDestinationParser.parse(printer); 1017 return print_preview.ExtensionDestinationParser.parse(printer);
1013 })); 1018 }));
1014 1019
1015 if (event.done && this.isExtensionDestinationSearchInProgress_) { 1020 if (event.done && this.isExtensionDestinationSearchInProgress_) {
1016 clearTimeout(this.extensionSearchTimeout_); 1021 clearTimeout(this.extensionSearchTimeout_);
1017 this.endExtensionPrinterSearch_(); 1022 this.endExtensionPrinterSearch_();
1018 } 1023 }
1019 }, 1024 },
1020 1025
1021 /** 1026 /**
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 return id == this.appState_.selectedDestinationId && 1098 return id == this.appState_.selectedDestinationId &&
1094 origin == this.appState_.selectedDestinationOrigin; 1099 origin == this.appState_.selectedDestinationOrigin;
1095 } 1100 }
1096 }; 1101 };
1097 1102
1098 // Export 1103 // Export
1099 return { 1104 return {
1100 DestinationStore: DestinationStore 1105 DestinationStore: DestinationStore
1101 }; 1106 };
1102 }); 1107 });
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/api/printer_provider/printer_provider_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698