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

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

Issue 2919693002: Print Preview: Change getPrinters to cr.sendWithPromise (Closed)
Patch Set: Address comments Created 3 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/data/local_parsers.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/destination_store.js
diff --git a/chrome/browser/resources/print_preview/data/destination_store.js b/chrome/browser/resources/print_preview/data/destination_store.js
index 116b1c64ee0f5fcb3fff3e44a513e9c1ef7009b6..19499638cd577b7a46a0f850f0cfd48baaa9da5c 100644
--- a/chrome/browser/resources/print_preview/data/destination_store.js
+++ b/chrome/browser/resources/print_preview/data/destination_store.js
@@ -1078,7 +1078,8 @@ cr.define('print_preview', function() {
startLoadLocalDestinations: function() {
if (!this.hasLoadedAllLocalDestinations_) {
this.hasLoadedAllLocalDestinations_ = true;
- this.nativeLayer_.startGetLocalDestinations();
+ this.nativeLayer_.getPrinters().then(
+ this.onLocalDestinationsSet_.bind(this));
this.isLocalDestinationSearchInProgress_ = true;
cr.dispatchSimpleEvent(
this, DestinationStore.EventType.DESTINATION_SEARCH_STARTED);
@@ -1362,10 +1363,6 @@ cr.define('print_preview', function() {
var nativeLayerEventTarget = this.nativeLayer_.getEventTarget();
this.tracker_.add(
nativeLayerEventTarget,
- print_preview.NativeLayer.EventType.LOCAL_DESTINATIONS_SET,
- this.onLocalDestinationsSet_.bind(this));
- this.tracker_.add(
- nativeLayerEventTarget,
print_preview.NativeLayer.EventType.CAPABILITIES_SET,
this.onLocalDestinationCapabilitiesSet_.bind(this));
this.tracker_.add(
@@ -1437,11 +1434,12 @@ cr.define('print_preview', function() {
/**
* Called when the local destinations have been got from the native layer.
- * @param {Event} event Contains the local destinations.
+ * @param {!Array<!print_preview.LocalDestinationInfo>} destinationInfos A
+ * list of the local destinations retrieved.
* @private
*/
- onLocalDestinationsSet_: function(event) {
- var localDestinations = event.destinationInfos.map(function(destInfo) {
+ onLocalDestinationsSet_: function(destinationInfos) {
+ var localDestinations = destinationInfos.map(function(destInfo) {
return print_preview.LocalDestinationParser.parse(destInfo);
});
this.insertDestinations_(localDestinations);
« no previous file with comments | « no previous file | chrome/browser/resources/print_preview/data/local_parsers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698