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

Side by Side Diff: chrome/browser/resources/print_preview/data/local_parsers.js

Issue 606213002: Compile print_preview, part 6: reduce down to 48 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@J_print_preview_5
Patch Set: vitalybuka@'s review Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('print_preview', function() { 5 cr.define('print_preview', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** Namespace that contains a method to parse local print destinations. */ 8 /** Namespace that contains a method to parse local print destinations. */
9 function LocalDestinationParser() {}; 9 function LocalDestinationParser() {};
10 10
11 /** 11 /**
12 * Parses a local print destination. 12 * Parses a local print destination.
13 * @param {!Object} destinationInfo Information describing a local print 13 * @param {!{deviceName: string,
14 * destination. 14 * printerDescription: string,
15 * printerName: string,
16 * printerOptions: Array}} destinationInfo Information describing
17 * a local print destination.
15 * @return {!print_preview.Destination} Parsed local print destination. 18 * @return {!print_preview.Destination} Parsed local print destination.
19 * @see chrome/browser/ui/webui/print_preview/print_preview_handler.cc
16 */ 20 */
17 LocalDestinationParser.parse = function(destinationInfo) { 21 LocalDestinationParser.parse = function(destinationInfo) {
18 var options = {'description': destinationInfo.printerDescription}; 22 var options = {'description': destinationInfo.printerDescription};
19 if (destinationInfo.printerOptions) { 23 if (destinationInfo.printerOptions) {
20 // Convert options into cloud print tags format. 24 // Convert options into cloud print tags format.
21 options.tags = Object.keys(destinationInfo.printerOptions).map( 25 options.tags = Object.keys(destinationInfo.printerOptions).map(
22 function(key) {return '__cp__' + key + '=' + this[key];}, 26 function(key) {return '__cp__' + key + '=' + this[key];},
23 destinationInfo.printerOptions); 27 destinationInfo.printerOptions);
24 } 28 }
25 return new print_preview.Destination( 29 return new print_preview.Destination(
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 69
66 return returnedPrinters; 70 return returnedPrinters;
67 }; 71 };
68 72
69 // Export 73 // Export
70 return { 74 return {
71 LocalDestinationParser: LocalDestinationParser, 75 LocalDestinationParser: LocalDestinationParser,
72 PrivetDestinationParser: PrivetDestinationParser 76 PrivetDestinationParser: PrivetDestinationParser
73 }; 77 };
74 }); 78 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698