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

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

Issue 2450163002: Print Preview: Handle printer media without name fields. (Closed)
Patch Set: Created 4 years, 1 month 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
« 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', function() { 5 cr.define('print_preview', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * A data store that stores destinations and dispatches events when the data 9 * A data store that stores destinations and dispatches events when the data
10 * store changes. 10 * store changes.
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 // - Japanese 557 // - Japanese
558 // - Other metric 558 // - Other metric
559 // Otherwise, assume they are custom sizes. 559 // Otherwise, assume they are custom sizes.
560 var categoryStandardNA = []; 560 var categoryStandardNA = [];
561 var categoryStandardCN = []; 561 var categoryStandardCN = [];
562 var categoryStandardISO = []; 562 var categoryStandardISO = [];
563 var categoryStandardJP = []; 563 var categoryStandardJP = [];
564 var categoryStandardMisc = []; 564 var categoryStandardMisc = [];
565 var categoryCustom = []; 565 var categoryCustom = [];
566 for (var i = 0, media; media = mediaSize.option[i]; i++) { 566 for (var i = 0, media; media = mediaSize.option[i]; i++) {
567 var name = media.name; 567 var name = media.name || 'CUSTOM';
568 var category; 568 var category;
569 if (name.startsWith('NA_')) { 569 if (name.startsWith('NA_')) {
570 category = categoryStandardNA; 570 category = categoryStandardNA;
571 } else if (name.startsWith('PRC_') || name.startsWith('ROC_') || 571 } else if (name.startsWith('PRC_') || name.startsWith('ROC_') ||
572 name == 'OM_DAI_PA_KAI' || name == 'OM_JUURO_KU_KAI' || 572 name == 'OM_DAI_PA_KAI' || name == 'OM_JUURO_KU_KAI' ||
573 name == 'OM_PA_KAI') { 573 name == 'OM_PA_KAI') {
574 category = categoryStandardCN; 574 category = categoryStandardCN;
575 } else if (name.startsWith('ISO_')) { 575 } else if (name.startsWith('ISO_')) {
576 category = categoryStandardISO; 576 category = categoryStandardISO;
577 } else if (name.startsWith('JIS_') || name.startsWith('JPN_')) { 577 } else if (name.startsWith('JIS_') || name.startsWith('JPN_')) {
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 return this.getDestinationKey_( 1738 return this.getDestinationKey_(
1739 destination.origin, destination.id, destination.account); 1739 destination.origin, destination.id, destination.account);
1740 } 1740 }
1741 }; 1741 };
1742 1742
1743 // Export 1743 // Export
1744 return { 1744 return {
1745 DestinationStore: DestinationStore 1745 DestinationStore: DestinationStore
1746 }; 1746 };
1747 }); 1747 });
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