| 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 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 $('font-settings-confirm').onclick = function() { | 60 $('font-settings-confirm').onclick = function() { |
| 61 PageManager.closeOverlay(); | 61 PageManager.closeOverlay(); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 $('advanced-font-settings-options').onclick = function() { | 64 $('advanced-font-settings-options').onclick = function() { |
| 65 chrome.send('openAdvancedFontSettingsOptions'); | 65 chrome.send('openAdvancedFontSettingsOptions'); |
| 66 }; | 66 }; |
| 67 }, | 67 }, |
| 68 | 68 |
| 69 /** | 69 /** @override */ |
| 70 * Called by the options page when this page has been shown. | |
| 71 */ | |
| 72 didShowPage: function() { | 70 didShowPage: function() { |
| 73 // The fonts list may be large so we only load it when this page is | 71 // The fonts list may be large so we only load it when this page is |
| 74 // loaded for the first time. This makes opening the options window | 72 // loaded for the first time. This makes opening the options window |
| 75 // faster and consume less memory if the user never opens the fonts | 73 // faster and consume less memory if the user never opens the fonts |
| 76 // dialog. | 74 // dialog. |
| 77 if (!this.hasShown) { | 75 if (!this.hasShown) { |
| 78 chrome.send('fetchFontsData'); | 76 chrome.send('fetchFontsData'); |
| 79 this.hasShown = true; | 77 this.hasShown = true; |
| 80 } | 78 } |
| 81 }, | 79 }, |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 $('advanced-font-settings-install').hidden = available; | 247 $('advanced-font-settings-install').hidden = available; |
| 250 $('advanced-font-settings-options').hidden = !available; | 248 $('advanced-font-settings-options').hidden = !available; |
| 251 }; | 249 }; |
| 252 | 250 |
| 253 // Export | 251 // Export |
| 254 return { | 252 return { |
| 255 FontSettings: FontSettings | 253 FontSettings: FontSettings |
| 256 }; | 254 }; |
| 257 }); | 255 }); |
| 258 | 256 |
| OLD | NEW |