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

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

Issue 10255017: Fixed failure to add language in language settings page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options2/language_options_handler2.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cr.define('options', function() { 5 cr.define('options', function() {
6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel;
7 /** @const */ var DeletableItem = options.DeletableItem; 7 /** @const */ var DeletableItem = options.DeletableItem;
8 /** @const */ var DeletableItemList = options.DeletableItemList; 8 /** @const */ var DeletableItemList = options.DeletableItemList;
9 /** @const */ var List = cr.ui.List; 9 /** @const */ var List = cr.ui.List;
10 /** @const */ var ListItem = cr.ui.ListItem; 10 /** @const */ var ListItem = cr.ui.ListItem;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 /** 63 /**
64 * Gets information of a language from the given language code. 64 * Gets information of a language from the given language code.
65 * @param {string} languageCode Language code (ex. "fr"). 65 * @param {string} languageCode Language code (ex. "fr").
66 */ 66 */
67 LanguageList.getLanguageInfoFromLanguageCode = function(languageCode) { 67 LanguageList.getLanguageInfoFromLanguageCode = function(languageCode) {
68 // Build the language code to language info dictionary at first time. 68 // Build the language code to language info dictionary at first time.
69 if (!this.languageCodeToLanguageInfo_) { 69 if (!this.languageCodeToLanguageInfo_) {
70 this.languageCodeToLanguageInfo_ = {}; 70 this.languageCodeToLanguageInfo_ = {};
71 var languageList = templateData.languageList; 71 var languageList = templateData.languageList;
72 for (var i = 0; i < languageList.length; i++) { 72 for (var i = 0; i < languageList.length; i++) {
73 this.languageCodeToLanguageInfo_[languageCode] = languageList[i]; 73 this.languageCodeToLanguageInfo_[language.code] = languageList[i];
csilv 2012/04/27 21:29:48 I'm confused by this change, can you explain it?
Danh Nguyen 2012/04/27 21:38:52 The parameter languageCode is a language code of t
74 } 74 }
75 } 75 }
76 76
77 return this.languageCodeToLanguageInfo_[languageCode]; 77 return this.languageCodeToLanguageInfo_[languageCode];
78 } 78 }
79 79
80 /** 80 /**
81 * Returns true if the given language code is valid. 81 * Returns true if the given language code is valid.
82 * @param {string} languageCode Language code (ex. "fr"). 82 * @param {string} languageCode Language code (ex. "fr").
83 */ 83 */
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 } 458 }
459 return filteredLanguageCodes; 459 return filteredLanguageCodes;
460 }, 460 },
461 }; 461 };
462 462
463 return { 463 return {
464 LanguageList: LanguageList, 464 LanguageList: LanguageList,
465 LanguageListItem: LanguageListItem 465 LanguageListItem: LanguageListItem
466 }; 466 };
467 }); 467 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options2/language_options_handler2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698