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

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 comment. 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 c4ae78e4db36e9b98176fb370d8bdff28a489f99..1b18149b5cbc6e9f3eeaf28f24301444294d3d9e 100644
--- a/chrome/browser/resources/print_preview/data/destination.js
+++ b/chrome/browser/resources/print_preview/data/destination.js
@@ -182,6 +182,15 @@ cr.define('print_preview', function() {
this.provisionalType_ = (opt_params && opt_params.provisionalType) ||
Destination.ProvisionalType.NONE;
+ /**
+ * Whether the destination is an enterprise policy controlled printer.
+ * @private {boolean}
+ */
+ this.isEnterprisePrinter_ =
+ (opt_params && opt_params.tags &&
+ arrayContains(opt_params.tags, Destination.EnterprisePrinterTag_)) ||
skau 2017/01/19 03:30:08 Can we add an out_params.isEnterprise instead? We
xdai1 2017/01/19 19:41:30 Done.
+ false;
+
assert(this.provisionalType_ !=
Destination.ProvisionalType.NEEDS_USB_PERMISSON ||
this.isExtension,
@@ -261,6 +270,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
@@ -274,7 +292,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/business.svg'
};
Destination.prototype = {
@@ -489,6 +508,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;
}
@@ -558,7 +580,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 this.isEnterprisePrinter_;
+ },
};
// Export

Powered by Google App Engine
This is Rietveld 408576698