OLD | NEW |
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 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 var hasDuplexCapability = false; | 43 var hasDuplexCapability = false; |
44 var defaultIsDuplexEnabled = false; | 44 var defaultIsDuplexEnabled = false; |
45 // On Windows, some printers don't specify their duplex values in the | 45 // On Windows, some printers don't specify their duplex values in the |
46 // printer schema. If the printer duplex value is UNKNOWN_DUPLEX_MODE, | 46 // printer schema. If the printer duplex value is UNKNOWN_DUPLEX_MODE, |
47 // hide the two sided option in preview tab UI. | 47 // hide the two sided option in preview tab UI. |
48 // Ref bug: http://crbug.com/89204 | 48 // Ref bug: http://crbug.com/89204 |
49 if (hasDuplexCapability = | 49 if (hasDuplexCapability = |
50 settingsInfo['printerDefaultDuplexValue'] != | 50 settingsInfo['printerDefaultDuplexValue'] != |
51 print_preview.NativeLayer.DuplexMode.UNKNOWN_DUPLEX_MODE) { | 51 print_preview.NativeLayer.DuplexMode.UNKNOWN_DUPLEX_MODE) { |
52 defaultIsDuplexEnabled = | 52 defaultIsDuplexEnabled = settingsInfo['setDuplexAsDefault'] || false; |
53 settingsInfo['printerDefaultDuplexValue'] == | |
54 print_preview.NativeLayer.DuplexMode.LONG_EDGE; | |
55 } | 53 } |
56 | 54 |
57 return new print_preview.ChromiumCapabilities( | 55 return new print_preview.ChromiumCapabilities( |
58 !settingsInfo['disableCopiesOption'] /*hasCopiesCapability*/, | 56 !settingsInfo['disableCopiesOption'] /*hasCopiesCapability*/, |
59 '1' /*defaultCopiesStr*/, | 57 '1' /*defaultCopiesStr*/, |
60 true /*hasCollateCapability*/, | 58 true /*hasCollateCapability*/, |
61 true /*defaultIsCollateEnabled*/, | 59 true /*defaultIsCollateEnabled*/, |
62 hasDuplexCapability, | 60 hasDuplexCapability, |
63 defaultIsDuplexEnabled, | 61 defaultIsDuplexEnabled, |
64 !settingsInfo['disableLandscapeOption'] /*hasOrientationCapability*/, | 62 !settingsInfo['disableLandscapeOption'] /*hasOrientationCapability*/, |
65 false /*defaultIsLandscapeEnabled*/, | 63 false /*defaultIsLandscapeEnabled*/, |
66 hasColorCapability, | 64 hasColorCapability, |
67 defaultIsColorEnabled); | 65 defaultIsColorEnabled); |
68 }; | 66 }; |
69 | 67 |
70 // Export | 68 // Export |
71 return { | 69 return { |
72 LocalCapabilitiesParser: LocalCapabilitiesParser, | 70 LocalCapabilitiesParser: LocalCapabilitiesParser, |
73 LocalDestinationParser: LocalDestinationParser | 71 LocalDestinationParser: LocalDestinationParser |
74 }; | 72 }; |
75 }); | 73 }); |
OLD | NEW |