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

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

Issue 979303002: Update UI for extension destinations in print preview destination list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 9 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
Index: chrome/browser/resources/print_preview/data/destination.js
diff --git a/chrome/browser/resources/print_preview/data/destination.js b/chrome/browser/resources/print_preview/data/destination.js
index 6daad812b68dbaf74bddacd9fe1a641eda29b78b..edce220a5ee90ffeeefcfb3a9a5f32978b014d4a 100644
--- a/chrome/browser/resources/print_preview/data/destination.js
+++ b/chrome/browser/resources/print_preview/data/destination.js
@@ -55,6 +55,7 @@ cr.define('print_preview', function() {
* isTosAccepted: (boolean|undefined),
* cloudID: (string|undefined),
* extensionId: (string|undefined),
+ * extensionName: (string|undefined),
* description: (string|undefined)}=} opt_params Optional parameters
* for the destination.
* @constructor
@@ -160,6 +161,12 @@ cr.define('print_preview', function() {
* @private {string}
*/
this.extensionId_ = (opt_params && opt_params.extensionId) || '';
+
+ /**
+ * Extension name for extension managed printers.
+ * @private {string}
+ */
+ this.extensionName_ = (opt_params && opt_params.extensionName) || '';
};
/**
@@ -343,7 +350,7 @@ cr.define('print_preview', function() {
this.id_ == Destination.GooglePromotedId.FEDEX) {
return this.account_;
}
- return this.location || this.description;
+ return this.location || this.extensionName || this.description;
},
/** @return {!Array<string>} Tags associated with the destination. */
@@ -364,6 +371,14 @@ cr.define('print_preview', function() {
return this.extensionId_;
},
+ /**
+ * @return {string} Extension name associated with the destination.
+ * Non-empty only for extension managed printers.
+ */
+ get extensionName() {
+ return this.extensionName_;
+ },
+
/** @return {?print_preview.Cdd} Print capabilities of the destination. */
get capabilities() {
return this.capabilities_;
@@ -435,10 +450,6 @@ cr.define('print_preview', function() {
return Destination.IconUrl_.FEDEX;
} else if (this.id_ == Destination.GooglePromotedId.SAVE_AS_PDF) {
return Destination.IconUrl_.PDF;
- } else if (this.isExtension) {
- // TODO(tbarzic): Update the way extension printers are displayed in the
- // destination list when the desired UX is defined.
- return 'chrome://extension-icon/' + this.extensionId + '/48/1';
} else if (this.isLocal) {
return Destination.IconUrl_.LOCAL;
} else if (this.type_ == Destination.Type.MOBILE && this.isOwned_) {
@@ -486,6 +497,7 @@ cr.define('print_preview', function() {
*/
matches: function(query) {
return !!this.displayName_.match(query) ||
+ !!this.extensionName_.match(query) ||
this.extraPropertiesToMatch.some(function(property) {
return property.match(query);
});

Powered by Google App Engine
This is Rietveld 408576698