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 /////////////////////////////////////////////////////////////////////////////// | 5 /////////////////////////////////////////////////////////////////////////////// |
6 // AddLanguageOverlay class: | 6 // AddLanguageOverlay class: |
7 | 7 |
8 cr.define('options', function() { | 8 cr.define('options', function() { |
9 /** @const */ var OptionsPage = options.OptionsPage; | 9 /** @const */ var OptionsPage = options.OptionsPage; |
10 | 10 |
11 /** | 11 /** |
12 * Encapsulated handling of ChromeOS add language overlay page. | 12 * Encapsulated handling of ChromeOS add language overlay page. |
13 * @constructor | 13 * @constructor |
14 */ | 14 */ |
15 function AddLanguageOverlay() { | 15 function AddLanguageOverlay() { |
16 OptionsPage.call(this, 'addLanguage', | 16 OptionsPage.call(this, 'addLanguage', |
17 loadTimeData.getString('addButton'), | 17 loadTimeData.getString('addButton'), |
18 'add-language-overlay-page'); | 18 'add-language-overlay-page'); |
19 } | 19 } |
20 | 20 |
21 cr.addSingletonGetter(AddLanguageOverlay); | 21 cr.addSingletonGetter(AddLanguageOverlay); |
22 | 22 |
23 AddLanguageOverlay.prototype = { | 23 AddLanguageOverlay.prototype = { |
24 // Inherit AddLanguageOverlay from OptionsPage. | 24 // Inherit AddLanguageOverlay from OptionsPage. |
25 __proto__: OptionsPage.prototype, | 25 __proto__: OptionsPage.prototype, |
26 | 26 |
27 /** | 27 /** @override */ |
28 * Initializes AddLanguageOverlay page. | |
29 * Calls base class implementation to starts preference initialization. | |
30 */ | |
31 initializePage: function() { | 28 initializePage: function() { |
32 // Call base class implementation to starts preference initialization. | 29 // Call base class implementation to starts preference initialization. |
33 OptionsPage.prototype.initializePage.call(this); | 30 OptionsPage.prototype.initializePage.call(this); |
34 | 31 |
35 // Set up the cancel button. | 32 // Set up the cancel button. |
36 $('add-language-overlay-cancel-button').onclick = function(e) { | 33 $('add-language-overlay-cancel-button').onclick = function(e) { |
37 OptionsPage.closeOverlay(); | 34 OptionsPage.closeOverlay(); |
38 }; | 35 }; |
39 | 36 |
40 // Create the language list with which users can add a language. | 37 // Create the language list with which users can add a language. |
(...skipping 11 matching lines...) Expand all Loading... |
52 option.textContent = displayText; | 49 option.textContent = displayText; |
53 addLanguageList.appendChild(option); | 50 addLanguageList.appendChild(option); |
54 } | 51 } |
55 }, | 52 }, |
56 }; | 53 }; |
57 | 54 |
58 return { | 55 return { |
59 AddLanguageOverlay: AddLanguageOverlay | 56 AddLanguageOverlay: AddLanguageOverlay |
60 }; | 57 }; |
61 }); | 58 }); |
OLD | NEW |