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

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

Issue 535073005: Convert Print Preview layout and color radio buttons to select elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adapt browser_tests to the controls change. Created 6 years, 3 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 // TODO(rltoscano): Move data/* into print_preview.data namespace 5 // TODO(rltoscano): Move data/* into print_preview.data namespace
6 6
7 var localStrings = new LocalStrings(templateData); 7 var localStrings = new LocalStrings(templateData);
8 8
9 <include src="component.js"/> 9 <include src="component.js"/>
10 <include src="print_preview_focus_manager.js"/> 10 <include src="print_preview_focus_manager.js"/>
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1021 }, 1021 },
1022 1022
1023 /** 1023 /**
1024 * Called by onManipulateSettingsForTest_(). Sets the layout settings to 1024 * Called by onManipulateSettingsForTest_(). Sets the layout settings to
1025 * either portrait or landscape. 1025 * either portrait or landscape.
1026 * @param {boolean} portrait Whether to use portrait page layout; 1026 * @param {boolean} portrait Whether to use portrait page layout;
1027 * if false: landscape. 1027 * if false: landscape.
1028 * @private 1028 * @private
1029 */ 1029 */
1030 setLayoutSettingsForTest_: function(portrait) { 1030 setLayoutSettingsForTest_: function(portrait) {
1031 var element = document.querySelector(portrait ? 1031 var combobox = document.querySelector('.layout-settings-select');
1032 '.layout-settings-portrait-radio' : 1032 if (combobox.value == 'portrait') {
1033 '.layout-settings-landscape-radio');
1034 if (element.checked)
1035 this.nativeLayer_.previewReadyForTest(); 1033 this.nativeLayer_.previewReadyForTest();
1036 else 1034 } else {
1037 element.click(); 1035 combobox.value = 'landscape';
1036 this.layoutSettings_.onSelectChange_();
1037 }
1038 }, 1038 },
1039 1039
1040 /** 1040 /**
1041 * Called by onManipulateSettingsForTest_(). Sets the page range for 1041 * Called by onManipulateSettingsForTest_(). Sets the page range for
1042 * for the print preview settings. 1042 * for the print preview settings.
1043 * @param {string} pageRange Sets the page range to the desired value(s). 1043 * @param {string} pageRange Sets the page range to the desired value(s).
1044 * Ex: "1-5,9" means pages 1 through 5 and page 9 will be printed. 1044 * Ex: "1-5,9" means pages 1 through 5 and page 9 will be printed.
1045 * @private 1045 * @private
1046 */ 1046 */
1047 setPageRangeForTest_: function(pageRange) { 1047 setPageRangeForTest_: function(pageRange) {
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 <include src="search/cloud_destination_list.js"/> 1277 <include src="search/cloud_destination_list.js"/>
1278 <include src="search/recent_destination_list.js"/> 1278 <include src="search/recent_destination_list.js"/>
1279 <include src="search/destination_list_item.js"/> 1279 <include src="search/destination_list_item.js"/>
1280 <include src="search/destination_search.js"/> 1280 <include src="search/destination_search.js"/>
1281 <include src="search/fedex_tos.js"/> 1281 <include src="search/fedex_tos.js"/>
1282 1282
1283 window.addEventListener('DOMContentLoaded', function() { 1283 window.addEventListener('DOMContentLoaded', function() {
1284 printPreview = new print_preview.PrintPreview(); 1284 printPreview = new print_preview.PrintPreview();
1285 printPreview.initialize(); 1285 printPreview.initialize();
1286 }); 1286 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698