Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Side by Side Diff: chrome/browser/resources/options2/language_add_language_overlay.js

Issue 10391044: retry 136193 - convert localStrings to loadTimeData for options page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 localStrings.getString('add_button'), 17 loadTimeData.getString('add_button'),
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 /**
28 * Initializes AddLanguageOverlay page. 28 * Initializes AddLanguageOverlay page.
29 * Calls base class implementation to starts preference initialization. 29 * Calls base class implementation to starts preference initialization.
30 */ 30 */
31 initializePage: function() { 31 initializePage: function() {
32 // Call base class implementation to starts preference initialization. 32 // Call base class implementation to starts preference initialization.
33 OptionsPage.prototype.initializePage.call(this); 33 OptionsPage.prototype.initializePage.call(this);
34 34
35 // Set up the cancel button. 35 // Set up the cancel button.
36 $('add-language-overlay-cancel-button').onclick = function(e) { 36 $('add-language-overlay-cancel-button').onclick = function(e) {
37 OptionsPage.closeOverlay(); 37 OptionsPage.closeOverlay();
38 }; 38 };
39 39
40 // Create the language list with which users can add a language. 40 // Create the language list with which users can add a language.
41 var addLanguageList = $('add-language-overlay-language-list'); 41 var addLanguageList = $('add-language-overlay-language-list');
42 var languageListData = templateData.languageList; 42 var languageListData = loadTimeData.getValue('languageList');
43 for (var i = 0; i < languageListData.length; i++) { 43 for (var i = 0; i < languageListData.length; i++) {
44 var language = languageListData[i]; 44 var language = languageListData[i];
45 var displayText = language.displayName; 45 var displayText = language.displayName;
46 // If the native name is different, add it. 46 // If the native name is different, add it.
47 if (language.displayName != language.nativeDisplayName) { 47 if (language.displayName != language.nativeDisplayName) {
48 displayText += ' - ' + language.nativeDisplayName; 48 displayText += ' - ' + language.nativeDisplayName;
49 } 49 }
50 50
51 if (cr.isChromeOS) { 51 if (cr.isChromeOS) {
52 var button = document.createElement('button'); 52 var button = document.createElement('button');
(...skipping 11 matching lines...) Expand all
64 addLanguageList.appendChild(option); 64 addLanguageList.appendChild(option);
65 } 65 }
66 } 66 }
67 }, 67 },
68 }; 68 };
69 69
70 return { 70 return {
71 AddLanguageOverlay: AddLanguageOverlay 71 AddLanguageOverlay: AddLanguageOverlay
72 }; 72 };
73 }); 73 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options2/instant_confirm_overlay.js ('k') | chrome/browser/resources/options2/language_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698