OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 text = items[i][1]; | 146 text = items[i][1]; |
147 if (text) { | 147 if (text) { |
148 selected = value == selectedValue; | 148 selected = value == selectedValue; |
149 element.appendChild(new Option(text, value, false, selected)); | 149 element.appendChild(new Option(text, value, false, selected)); |
150 } else { | 150 } else { |
151 element.appendChild(document.createElement('hr')); | 151 element.appendChild(document.createElement('hr')); |
152 } | 152 } |
153 } | 153 } |
154 | 154 |
155 // Enable if not a managed pref. | 155 // Enable if not a managed pref. |
156 if (!element.managed) | 156 if (!element.controlledBy) |
157 element.disabled = false; | 157 element.disabled = false; |
158 } | 158 } |
159 }; | 159 }; |
160 | 160 |
161 // Chrome callbacks | 161 // Chrome callbacks |
162 FontSettings.setFontsData = function(fonts, encodings, selectedValues) { | 162 FontSettings.setFontsData = function(fonts, encodings, selectedValues) { |
163 FontSettings.getInstance().populateSelect_($('standard-font-family'), fonts, | 163 FontSettings.getInstance().populateSelect_($('standard-font-family'), fonts, |
164 selectedValues[0]); | 164 selectedValues[0]); |
165 FontSettings.getInstance().populateSelect_($('serif-font-family'), fonts, | 165 FontSettings.getInstance().populateSelect_($('serif-font-family'), fonts, |
166 selectedValues[1]); | 166 selectedValues[1]); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 FontSettings.getInstance().setUpFontSample_($('minimum-font-sample'), size, | 200 FontSettings.getInstance().setUpFontSample_($('minimum-font-sample'), size, |
201 null, true); | 201 null, true); |
202 }; | 202 }; |
203 | 203 |
204 // Export | 204 // Export |
205 return { | 205 return { |
206 FontSettings: FontSettings | 206 FontSettings: FontSettings |
207 }; | 207 }; |
208 }); | 208 }); |
209 | 209 |
OLD | NEW |