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

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

Issue 313723002: Convert local printer capabilites to CDD format to unify with cloud printers and PDF printer. This … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix clang reported errors. Created 6 years, 6 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/local_parsers.js
diff --git a/chrome/browser/resources/print_preview/data/local_parsers.js b/chrome/browser/resources/print_preview/data/local_parsers.js
index 22cfded94f78f6929862ecbdec7acd4719a7f6db..c15fb59349086dfe0c30aa3f586b468b7a495386 100644
--- a/chrome/browser/resources/print_preview/data/local_parsers.js
+++ b/chrome/browser/resources/print_preview/data/local_parsers.js
@@ -32,64 +32,6 @@ cr.define('print_preview', function() {
options);
};
- /** Namespace that contains a method to parse local print capabilities. */
- function LocalCapabilitiesParser() {};
-
- /**
- * Parses local print capabilities.
- * @param {!Object} settingsInfo Object that describes local print
- * capabilities.
- * @return {!print_preview.Cdd} Parsed local print capabilities.
- */
- LocalCapabilitiesParser.parse = function(settingsInfo) {
- var cdd = {
- version: '1.0',
- printer: {
- collate: {'default': true}
- }
- };
-
- if (!settingsInfo['disableColorOption']) {
- cdd.printer.color = {
- option: [
- {
- type: 'STANDARD_COLOR',
- is_default: !!settingsInfo['setColorAsDefault']
- },
- {
- type: 'STANDARD_MONOCHROME',
- is_default: !settingsInfo['setColorAsDefault']
- }
- ]
- };
- }
-
- if (!settingsInfo['disableCopiesOption']) {
- cdd.printer.copies = {'default': 1};
- }
-
- if (settingsInfo['printerDefaultDuplexValue'] !=
- print_preview.NativeLayer.DuplexMode.UNKNOWN_DUPLEX_MODE) {
- cdd.printer.duplex = {
- option: [
- {type: 'NO_DUPLEX', is_default: !settingsInfo['setDuplexAsDefault']},
- {type: 'LONG_EDGE', is_default: !!settingsInfo['setDuplexAsDefault']}
- ]
- };
- }
-
- if (!settingsInfo['disableLandscapeOption']) {
- cdd.printer.page_orientation = {
- option: [
- {type: 'PORTRAIT', is_default: true},
- {type: 'LANDSCAPE'}
- ]
- };
- }
-
- return cdd;
- };
-
function PrivetDestinationParser() {}
/**
@@ -126,7 +68,6 @@ cr.define('print_preview', function() {
// Export
return {
- LocalCapabilitiesParser: LocalCapabilitiesParser,
LocalDestinationParser: LocalDestinationParser,
PrivetDestinationParser: PrivetDestinationParser
};

Powered by Google App Engine
This is Rietveld 408576698