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

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

Issue 2618313004: [CUPS] Implement the enterprise icon for printers in Print Preview Dialog. (Closed)
Patch Set: Address skau@'s comments. Created 3 years, 11 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 91aa8ecc8b7781d10c80d1c2b15459e851274144..47fe8c248a0701681117873560c3aa86cf6758ab 100644
--- a/chrome/browser/resources/print_preview/data/destination.js
+++ b/chrome/browser/resources/print_preview/data/destination.js
@@ -260,6 +260,15 @@ cr.define('print_preview', function() {
};
/**
+ * Special tag that denotes whether the destination is an enterprise policy
+ * controlled printer.
+ * @type {string}
+ * @const
+ * @private
+ */
+ Destination.EnterprisePrinterTag_ = '__cp__cups_enterprise_printer=true';
+
+ /**
* Enumeration of relative icon URLs for various types of destinations.
* @enum {string}
* @private
@@ -273,7 +282,8 @@ cr.define('print_preview', function() {
THIRD_PARTY: 'images/third_party.png',
PDF: 'images/pdf.png',
DOCS: 'images/google_doc.png',
- FEDEX: 'images/third_party_fedex.png'
+ FEDEX: 'images/third_party_fedex.png',
+ ENTERPRISE: 'images/enterprise_printer.png'
};
Destination.prototype = {
@@ -487,6 +497,9 @@ cr.define('print_preview', function() {
if (this.id_ == Destination.GooglePromotedId.SAVE_AS_PDF) {
return Destination.IconUrl_.PDF;
}
+ if (this.isEnterprisePrinter) {
+ return Destination.IconUrl_.ENTERPRISE;
+ }
if (this.isLocal) {
return Destination.IconUrl_.LOCAL;
}
@@ -556,7 +569,15 @@ cr.define('print_preview', function() {
*/
get isProvisional() {
return this.provisionalType_ != Destination.ProvisionalType.NONE;
- }
+ },
+
+ /**
+ * Whether the printer is enterprise policy controlled printer.
+ * @return {boolean}
+ */
+ get isEnterprisePrinter() {
+ return arrayContains(this.tags_, Destination.EnterprisePrinterTag_);
+ },
};
// Export

Powered by Google App Engine
This is Rietveld 408576698