1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 cr.define('print_preview', function() {
9 * Encapsulates all settings and logic related to the DPI selection UI.
10 * @param {!print_preview.ticket_items.Dpi} ticketItem Used to read and write
11 * the DPI ticket item.
13 * @extends {print_preview.SettingsSectionSelect}
15 function DpiSettings(ticketItem) {
16 print_preview.SettingsSectionSelect.call(this, ticketItem);
19 DpiSettings.prototype = {
20 __proto__: print_preview.SettingsSectionSelect.prototype,
23 getDefaultDisplayName_: function(option) {
24 var hDpi = option.horizontal_dpi || 0;
25 var vDpi = option.vertical_dpi || 0;
26 if (hDpi > 0 && vDpi > 0 && hDpi != vDpi)
27 return loadTimeData.getStringF('nonIsotropicDpiItemLabel', hDpi, vDpi);
28 return loadTimeData.getStringF('dpiItemLabel', hDpi || vDpi);
34 DpiSettings: DpiSettings