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

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

Issue 575333002: Compile print_preview, part 2: reduce down to 260 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@I_print_preview
Patch Set: revert movement of enums: now handle in compiler pass Created 6 years, 3 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 943e325be060a72c78fafd00904fd2833019759e..3b803a6cd165acfdbb9e1053a24150070a43c1c8 100644
--- a/chrome/browser/resources/print_preview/data/destination.js
+++ b/chrome/browser/resources/print_preview/data/destination.js
@@ -2,6 +2,38 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+cr.exportPath('print_preview');
+
+/**
+ * The CDD (Cloud Device Description) describes the capabilities of a print
+ * destination.
+ *
+ * @typedef {{
+ * version: string,
+ * printer: {
+ * vendor_capability: !Array.<{Object}>,
+ * collate: ({default: (boolean|undefined)}|undefined),
+ * color: ({
+ * option: !Array.<{
+ * type: (string|undefined),
+ * vendor_id: (string|undefined),
+ * custom_display_name: (string|undefined),
+ * is_default: (boolean|undefined)
+ * }>
+ * }|undefined),
+ * copies: ({default: (number|undefined),
+ * max: (number|undefined)}|undefined),
+ * duplex: ({option: !Array.<{type: (string|undefined),
+ * is_default: (boolean|undefined)}>}|undefined),
+ * page_orientation: ({
+ * option: !Array.<{type: (string|undefined),
+ * is_default: (boolean|undefined)}>
+ * }|undefined)
+ * }
+ * }}
+ */
+print_preview.Cdd;
+
cr.define('print_preview', function() {
'use strict';
@@ -114,7 +146,7 @@ cr.define('print_preview', function() {
* {@code null} if terms-of-service does not apply to the print destination.
* @private {?boolean}
*/
- this.isTosAccepted_ = opt_params && opt_params.isTosAccepted;
+ this.isTosAccepted_ = !!(opt_params && opt_params.isTosAccepted);
/**
* Cloud ID for Privet printers.
@@ -149,6 +181,7 @@ cr.define('print_preview', function() {
*/
Destination.Type = {
GOOGLE: 'google',
+ GOOGLE_PROMOTED: 'google_promoted',
LOCAL: 'local',
MOBILE: 'mobile'
};
@@ -423,43 +456,15 @@ cr.define('print_preview', function() {
* {@code false} otherwise.
*/
matches: function(query) {
- return this.displayName_.match(query) ||
+ return !!this.displayName_.match(query) ||
this.extraPropertiesToMatch.some(function(property) {
return property.match(query);
});
}
};
- /**
- * The CDD (Cloud Device Description) describes the capabilities of a print
- * destination.
- *
- * @typedef {{
- * version: string,
- * printer: {
- * vendor_capability: !Array.<{Object}>,
- * collate: {default: boolean=}=,
- * color: {
- * option: !Array.<{
- * type: string=,
- * vendor_id: string=,
- * custom_display_name: string=,
- * is_default: boolean=
- * }>
- * }=,
- * copies: {default: number=, max: number=}=,
- * duplex: {option: !Array.<{type: string=, is_default: boolean=}>}=,
- * page_orientation: {
- * option: !Array.<{type: string=, is_default: boolean=}>
- * }=
- * }
- * }}
- */
- var Cdd = Object;
-
// Export
return {
Destination: Destination,
- Cdd: Cdd
};
});
« no previous file with comments | « chrome/browser/resources/print_preview/component.js ('k') | chrome/browser/resources/print_preview/data/destination_store.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698