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

Side by Side Diff: chrome/browser/resources/options/font_settings.js

Issue 543493002: Compile chrome://settings, part 2: reduce from 950 to 400 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@F_settings
Patch Set: rebase? rebase! 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 cr.define('options', function() { 5 cr.define('options', function() {
6 6
7 var OptionsPage = options.OptionsPage; 7 var OptionsPage = options.OptionsPage;
8 var Page = cr.ui.pageManager.Page; 8 var Page = cr.ui.pageManager.Page;
9 var PageManager = cr.ui.pageManager.PageManager; 9 var PageManager = cr.ui.pageManager.PageManager;
10 10
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 Preferences.setIntegerPref( 148 Preferences.setIntegerPref(
149 'webkit.webprefs.minimum_logical_font_size', size, true); 149 'webkit.webprefs.minimum_logical_font_size', size, true);
150 return false; 150 return false;
151 }, 151 },
152 152
153 /** 153 /**
154 * Sets the text, font size and font family of the sample text. 154 * Sets the text, font size and font family of the sample text.
155 * @param {Element} el The div containing the sample text. 155 * @param {Element} el The div containing the sample text.
156 * @param {number} size The font size of the sample text. 156 * @param {number} size The font size of the sample text.
157 * @param {string} font The font family of the sample text. 157 * @param {string} font The font family of the sample text.
158 * @param {bool} showSize True if the font size should appear in the sample. 158 * @param {boolean} showSize True if the font size should appear in the
159 * sample.
159 * @private 160 * @private
160 */ 161 */
161 setUpFontSample_: function(el, size, font, showSize) { 162 setUpFontSample_: function(el, size, font, showSize) {
162 var prefix = showSize ? (size + ': ') : ''; 163 var prefix = showSize ? (size + ': ') : '';
163 el.textContent = prefix + 164 el.textContent = prefix +
164 loadTimeData.getString('fontSettingsLoremIpsum'); 165 loadTimeData.getString('fontSettingsLoremIpsum');
165 el.style.fontSize = size + 'px'; 166 el.style.fontSize = size + 'px';
166 if (font) 167 if (font)
167 el.style.fontFamily = font; 168 el.style.fontFamily = font;
168 }, 169 },
169 170
170 /** 171 /**
171 * Populates a select list and selects the specified item. 172 * Populates a select list and selects the specified item.
172 * @param {Element} element The select element to populate. 173 * @param {Element} element The select element to populate.
173 * @param {Array} items The array of items from which to populate. 174 * @param {Array} items The array of items from which to populate.
174 * @param {string} selectedValue The selected item. 175 * @param {string} selectedValue The selected item.
175 * @private 176 * @private
176 */ 177 */
177 populateSelect_: function(element, items, selectedValue) { 178 populateSelect_: function(element, items, selectedValue) {
178 // Remove any existing content. 179 // Remove any existing content.
179 element.textContent = ''; 180 element.textContent = '';
180 181
181 // Insert new child nodes into select element. 182 // Insert new child nodes into select element.
182 var value, text, selected, option;
183 for (var i = 0; i < items.length; i++) { 183 for (var i = 0; i < items.length; i++) {
184 value = items[i][0]; 184 var value = items[i][0];
185 text = items[i][1]; 185 var text = items[i][1];
186 dir = items[i][2]; 186 var dir = items[i][2];
187 if (text) { 187 if (text) {
188 selected = value == selectedValue; 188 var selected = value == selectedValue;
189 var option = new Option(text, value, false, selected); 189 var option = new Option(text, value, false, selected);
190 option.dir = dir; 190 option.dir = dir;
191 element.appendChild(option); 191 element.appendChild(option);
192 } else { 192 } else {
193 element.appendChild(document.createElement('hr')); 193 element.appendChild(document.createElement('hr'));
194 } 194 }
195 } 195 }
196 196
197 element.setDisabled('noFontsAvailable', false); 197 element.setDisabled('noFontsAvailable', false);
198 } 198 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 $('advanced-font-settings-install').hidden = available; 249 $('advanced-font-settings-install').hidden = available;
250 $('advanced-font-settings-options').hidden = !available; 250 $('advanced-font-settings-options').hidden = !available;
251 }; 251 };
252 252
253 // Export 253 // Export
254 return { 254 return {
255 FontSettings: FontSettings 255 FontSettings: FontSettings
256 }; 256 };
257 }); 257 });
258 258
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/editable_text_field.js ('k') | chrome/browser/resources/options/geolocation_options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698