| OLD | NEW |
| 1 // Copyright (c) 2010 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 ///////////////////////////////////////////////////////////////////////////// | 7 ///////////////////////////////////////////////////////////////////////////// |
| 8 // MinimumFontSizeSelect class: | 8 // MinimumFontSizeSelect class: |
| 9 | 9 |
| 10 // Define a constructor that uses a select element as its underlying element. | 10 // Define a constructor that uses a select element as its underlying element. |
| 11 var MinimumFontSizeSelect = cr.ui.define('select'); | 11 var MinimumFontSizeSelect = cr.ui.define('select'); |
| 12 | 12 |
| 13 MinimumFontSizeSelect.prototype = { | 13 MinimumFontSizeSelect.prototype = { |
| 14 // Set up the prototype chain | |
| 15 __proto__: HTMLSelectElement.prototype, | 14 __proto__: HTMLSelectElement.prototype, |
| 16 | 15 |
| 17 /** | 16 /** @inheritDoc */ |
| 18 * Initialization function for the cr.ui framework. | |
| 19 */ | |
| 20 decorate: function() { | 17 decorate: function() { |
| 21 var self = this; | 18 var self = this; |
| 22 | 19 |
| 23 // Listen to pref changes. | 20 // Listen to pref changes. |
| 24 Preferences.getInstance().addEventListener( | 21 Preferences.getInstance().addEventListener( |
| 25 'webkit.webprefs.minimum_font_size', function(event) { | 22 'webkit.webprefs.minimum_font_size', function(event) { |
| 26 var value = (event.value && event.value['value'] != undefined) | 23 var value = (event.value && event.value['value'] != undefined) |
| 27 ? event.value['value'] : event.value; | 24 ? event.value['value'] : event.value; |
| 28 self.managed = (event.value && event.value['managed'] != undefined) | 25 self.managed = (event.value && event.value['managed'] != undefined) |
| 29 ? event.value['managed'] : false; | 26 ? event.value['managed'] : false; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 60 }, | 57 }, |
| 61 }; | 58 }; |
| 62 | 59 |
| 63 // Export | 60 // Export |
| 64 return { | 61 return { |
| 65 MinimumFontSizeSelect: MinimumFontSizeSelect | 62 MinimumFontSizeSelect: MinimumFontSizeSelect |
| 66 }; | 63 }; |
| 67 | 64 |
| 68 }); | 65 }); |
| 69 | 66 |
| OLD | NEW |