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

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

Issue 144483010: Default copies value should be '1'. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.ticket_items', function() { 5 cr.define('print_preview.ticket_items', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Copies ticket item whose value is a {@code string} that indicates how many 9 * Copies ticket item whose value is a {@code string} that indicates how many
10 * copies of the document should be printed. The ticket item is backed by a 10 * copies of the document should be printed. The ticket item is backed by a
(...skipping 29 matching lines...) Expand all
40 }, 40 },
41 41
42 /** @return {number} The number of copies indicated by the ticket item. */ 42 /** @return {number} The number of copies indicated by the ticket item. */
43 getValueAsNumber: function() { 43 getValueAsNumber: function() {
44 return parseInt(this.getValue()); 44 return parseInt(this.getValue());
45 }, 45 },
46 46
47 /** @override */ 47 /** @override */
48 getDefaultValueInternal: function() { 48 getDefaultValueInternal: function() {
49 var cap = this.getCopiesCapability_(); 49 var cap = this.getCopiesCapability_();
50 return cap.hasOwnProperty('default') ? cap.default : ''; 50 return cap.hasOwnProperty('default') ? cap.default : '1';
51 }, 51 },
52 52
53 /** @override */ 53 /** @override */
54 getCapabilityNotAvailableValueInternal: function() { 54 getCapabilityNotAvailableValueInternal: function() {
55 return '1'; 55 return '1';
56 }, 56 },
57 57
58 /** 58 /**
59 * @return {Object} Copies capability of the selected destination. 59 * @return {Object} Copies capability of the selected destination.
60 * @private 60 * @private
61 */ 61 */
62 getCopiesCapability_: function() { 62 getCopiesCapability_: function() {
63 var dest = this.getSelectedDestInternal(); 63 var dest = this.getSelectedDestInternal();
64 return (dest && 64 return (dest &&
65 dest.capabilities && 65 dest.capabilities &&
66 dest.capabilities.printer && 66 dest.capabilities.printer &&
67 dest.capabilities.printer.copies) || 67 dest.capabilities.printer.copies) ||
68 null; 68 null;
69 } 69 }
70 }; 70 };
71 71
72 // Export 72 // Export
73 return { 73 return {
74 Copies: Copies 74 Copies: Copies
75 }; 75 };
76 }); 76 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698