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

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

Issue 9316086: Fix JavaScript errors in options2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: new violations found after rebase Created 8 years, 10 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 cr.define('options', function() { 5 cr.define('options', function() {
6 const OptionsPage = options.OptionsPage; 6 const OptionsPage = options.OptionsPage;
7 const ArrayDataModel = cr.ui.ArrayDataModel; 7 const ArrayDataModel = cr.ui.ArrayDataModel;
8 8
9 /** 9 /**
10 * Encapsulated handling of search engine management page. 10 * Encapsulated handling of search engine management page.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 * @private 72 * @private
73 * @param {Array} defaultEngines List of possible default search engines. 73 * @param {Array} defaultEngines List of possible default search engines.
74 * @param {Array} otherEngines List of other search engines. 74 * @param {Array} otherEngines List of other search engines.
75 * @param {Array} keywords List of keywords from extensions. 75 * @param {Array} keywords List of keywords from extensions.
76 */ 76 */
77 updateSearchEngineList_: function(defaultEngines, otherEngines, keywords) { 77 updateSearchEngineList_: function(defaultEngines, otherEngines, keywords) {
78 this.defaultsList_.dataModel = new ArrayDataModel(defaultEngines); 78 this.defaultsList_.dataModel = new ArrayDataModel(defaultEngines);
79 79
80 otherEngines = otherEngines.map(function(x) { 80 otherEngines = otherEngines.map(function(x) {
81 return [x, x['name'].toLocaleLowerCase()]; 81 return [x, x['name'].toLocaleLowerCase()];
82 }).sort(function(a,b){ 82 }).sort(function(a, b) {
83 return a[1].localeCompare(b[1]); 83 return a[1].localeCompare(b[1]);
84 }).map(function(x){ 84 }).map(function(x) {
85 return x[0]; 85 return x[0];
86 }); 86 });
87 87
88 var othersModel = new ArrayDataModel(otherEngines); 88 var othersModel = new ArrayDataModel(otherEngines);
89 // Add a "new engine" row. 89 // Add a "new engine" row.
90 othersModel.push({ 90 othersModel.push({
91 'modelIndex': '-1', 91 'modelIndex': '-1',
92 'canBeEdited': true 92 'canBeEdited': true
93 }); 93 });
94 this.othersList_.dataModel = othersModel; 94 this.othersList_.dataModel = othersModel;
(...skipping 25 matching lines...) Expand all
120 validity, modelIndex); 120 validity, modelIndex);
121 }; 121 };
122 122
123 // Export 123 // Export
124 return { 124 return {
125 SearchEngineManager: SearchEngineManager 125 SearchEngineManager: SearchEngineManager
126 }; 126 };
127 127
128 }); 128 });
129 129
OLDNEW
« no previous file with comments | « chrome/browser/resources/options2/pref_ui.js ('k') | chrome/browser/resources/options2/search_engine_manager_engine_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698