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

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: 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) 2011 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.
11 * @constructor 11 * @constructor
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 * @private 68 * @private
69 * @param {Array} defaultEngines List of possible default search engines. 69 * @param {Array} defaultEngines List of possible default search engines.
70 * @param {Array} otherEngines List of other search engines. 70 * @param {Array} otherEngines List of other search engines.
71 * @param {Array} keywords List of keywords from extensions. 71 * @param {Array} keywords List of keywords from extensions.
72 */ 72 */
73 updateSearchEngineList_: function(defaultEngines, otherEngines, keywords) { 73 updateSearchEngineList_: function(defaultEngines, otherEngines, keywords) {
74 this.defaultsList_.dataModel = new ArrayDataModel(defaultEngines); 74 this.defaultsList_.dataModel = new ArrayDataModel(defaultEngines);
75 75
76 otherEngines = otherEngines.map(function(x) { 76 otherEngines = otherEngines.map(function(x) {
77 return [x, x['name'].toLocaleLowerCase()]; 77 return [x, x['name'].toLocaleLowerCase()];
78 }).sort(function(a,b){ 78 }).sort(function(a, b) {
79 return a[1].localeCompare(b[1]); 79 return a[1].localeCompare(b[1]);
80 }).map(function(x){ 80 }).map(function(x) {
81 return x[0]; 81 return x[0];
82 }); 82 });
83 83
84 var othersModel = new ArrayDataModel(otherEngines); 84 var othersModel = new ArrayDataModel(otherEngines);
85 // Add a "new engine" row. 85 // Add a "new engine" row.
86 othersModel.push({ 86 othersModel.push({
87 'modelIndex': '-1', 87 'modelIndex': '-1',
88 'canBeEdited': true 88 'canBeEdited': true
89 }); 89 });
90 this.othersList_.dataModel = othersModel; 90 this.othersList_.dataModel = othersModel;
(...skipping 25 matching lines...) Expand all
116 validity, modelIndex); 116 validity, modelIndex);
117 }; 117 };
118 118
119 // Export 119 // Export
120 return { 120 return {
121 SearchEngineManager: SearchEngineManager 121 SearchEngineManager: SearchEngineManager
122 }; 122 };
123 123
124 }); 124 });
125 125
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698