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

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

Issue 900503002: List printers managed by extensions in print preview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 10 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 c15fb59349086dfe0c30aa3f586b468b7a495386..c7c3e19989478ff356bfd055afa10b49da761063 100644
--- a/chrome/browser/resources/print_preview/data/local_parsers.js
+++ b/chrome/browser/resources/print_preview/data/local_parsers.js
@@ -66,9 +66,30 @@ cr.define('print_preview', function() {
return returnedPrinters;
};
+ function ExtensionDestinationParser() {}
+
+ /**
+ * Parses an extension destination from an extension supplied printer
+ * description.
+ * @param {!Object} destinationInfo Object describing an extension printer.
+ * @return {!print_preview.Destination} Parsed destination.
+ */
+ ExtensionDestinationParser.parse = function(destinationInfo) {
+ return new print_preview.Destination(
+ destinationInfo.id,
+ print_preview.Destination.Type.LOCAL,
+ print_preview.Destination.Origin.EXTENSION,
+ destinationInfo.name,
+ false /* isRecent */,
+ print_preview.Destination.ConnectionStatus.ONLINE,
+ {description: destinationInfo.description || '',
+ extensionId: destinationInfo.extensionId});
+ };
+
// Export
return {
LocalDestinationParser: LocalDestinationParser,
- PrivetDestinationParser: PrivetDestinationParser
+ PrivetDestinationParser: PrivetDestinationParser,
+ ExtensionDestinationParser: ExtensionDestinationParser
};
});

Powered by Google App Engine
This is Rietveld 408576698