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('options', function() { | 5 cr.define('options', function() { |
6 | 6 |
7 var OptionsPage = options.OptionsPage; | 7 var OptionsPage = options.OptionsPage; |
8 | 8 |
9 /** | 9 /** |
10 * FontSettings class | 10 * FontSettings class |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 $('sans-serif-font-family'), $('fixed-font-family'), | 50 $('sans-serif-font-family'), $('fixed-font-family'), |
51 $('font-encoding')]; | 51 $('font-encoding')]; |
52 elements.forEach(function(el) { | 52 elements.forEach(function(el) { |
53 el.appendChild(new Option(placeholder)); | 53 el.appendChild(new Option(placeholder)); |
54 el.setDisabled('noFontsAvailable', true); | 54 el.setDisabled('noFontsAvailable', true); |
55 }); | 55 }); |
56 | 56 |
57 $('font-settings-confirm').onclick = function() { | 57 $('font-settings-confirm').onclick = function() { |
58 OptionsPage.closeOverlay(); | 58 OptionsPage.closeOverlay(); |
59 }; | 59 }; |
| 60 |
| 61 $('advanced-font-settings-options').onclick = function() { |
| 62 chrome.send('openAdvancedFontSettingsOptions'); |
| 63 }; |
60 }, | 64 }, |
61 | 65 |
62 /** | 66 /** |
63 * Called by the options page when this page has been shown. | 67 * Called by the options page when this page has been shown. |
64 */ | 68 */ |
65 didShowPage: function() { | 69 didShowPage: function() { |
66 // The fonts list may be large so we only load it when this page is | 70 // The fonts list may be large so we only load it when this page is |
67 // loaded for the first time. This makes opening the options window | 71 // loaded for the first time. This makes opening the options window |
68 // faster and consume less memory if the user never opens the fonts | 72 // faster and consume less memory if the user never opens the fonts |
69 // dialog. | 73 // dialog. |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 231 |
228 FontSettings.setUpMinimumFontSample = function(size) { | 232 FontSettings.setUpMinimumFontSample = function(size) { |
229 // If size is less than 6, represent it as six in the sample to account | 233 // If size is less than 6, represent it as six in the sample to account |
230 // for the minimum logical font size. | 234 // for the minimum logical font size. |
231 if (size < 6) | 235 if (size < 6) |
232 size = 6; | 236 size = 6; |
233 FontSettings.getInstance().setUpFontSample_($('minimum-font-sample'), size, | 237 FontSettings.getInstance().setUpFontSample_($('minimum-font-sample'), size, |
234 null, true); | 238 null, true); |
235 }; | 239 }; |
236 | 240 |
| 241 /** |
| 242 * @param {boolean} available Whether the Advanced Font Settings Extension |
| 243 * is installed and enabled. |
| 244 */ |
| 245 FontSettings.notifyAdvancedFontSettingsAvailability = function(available) { |
| 246 $('advanced-font-settings-install').hidden = available; |
| 247 $('advanced-font-settings-options').hidden = !available; |
| 248 }; |
| 249 |
237 // Export | 250 // Export |
238 return { | 251 return { |
239 FontSettings: FontSettings | 252 FontSettings: FontSettings |
240 }; | 253 }; |
241 }); | 254 }); |
242 | 255 |
OLD | NEW |