Chromium Code Reviews| Index: chrome/browser/resources/options/search_engine_manager.js |
| diff --git a/chrome/browser/resources/options/search_engine_manager.js b/chrome/browser/resources/options/search_engine_manager.js |
| index a7f80bea7e46a5262fb40b77ac939ab1f0f62c29..44cbca76edf19e72e579c9e82390939f2fc80e45 100644 |
| --- a/chrome/browser/resources/options/search_engine_manager.js |
| +++ b/chrome/browser/resources/options/search_engine_manager.js |
| @@ -24,18 +24,21 @@ cr.define('options', function() { |
| /** |
| * List for default search engine options |
| - * @type {boolean} |
|
James Hawkins
2011/07/11 04:04:33
Why did you remove the type?
Greg Billock
2011/07/11 21:24:25
It's not accurate. I'd guess it got copy-pasted fr
|
| * @private |
| */ |
| defaultsList_: null, |
| /** |
| * List for other search engine options |
| - * @type {boolean} |
| * @private |
| */ |
| othersList_: null, |
| + /** |
| + * List for extension keywords |
|
James Hawkins
2011/07/11 04:04:33
Missing period at end of sentence.
Greg Billock
2011/07/11 21:24:25
Done. (and above)
|
| + * @private |
| + extensionList_ : null, |
| + |
| /** inheritDoc */ |
| initializePage: function() { |
| OptionsPage.prototype.initializePage.call(this); |
| @@ -45,6 +48,9 @@ cr.define('options', function() { |
| this.othersList_ = $('otherSearchEngineList'); |
| this.setUpList_(this.othersList_); |
| + |
| + this.extensionList_ = $('extensionKeywordList'); |
| + this.setUpList_(this.extensionList_); |
| }, |
| /** |
| @@ -62,8 +68,9 @@ cr.define('options', function() { |
| * @private |
| * @param {Array} defaultEngines List of possible default search engines. |
| * @param {Array} otherEngines List of other search engines. |
| + * @param {Array} keywords List of keywords from extensions. |
| */ |
| - updateSearchEngineList_: function(defaultEngines, otherEngines) { |
| + updateSearchEngineList_: function(defaultEngines, otherEngines, keywords) { |
| this.defaultsList_.dataModel = new ArrayDataModel(defaultEngines); |
| otherEngines = otherEngines.map(function(x) { |
| @@ -80,13 +87,23 @@ cr.define('options', function() { |
| 'modelIndex': '-1' |
| }); |
| this.othersList_.dataModel = othersModel; |
| + |
| + if (keywords.length > 0) { |
| + $('extensionKeywordListTitle').style.visibility = 'visible'; |
|
James Hawkins
2011/07/11 04:04:33
Use hidden attribute.
Greg Billock
2011/07/11 21:24:25
Done.
|
| + $('extensionKeywordList').style.visibility = 'visible'; |
| + $('manageExtensionLink').style.visibility = 'visible'; |
|
Evan Stade
2011/07/11 20:12:01
I would wrap the whole extension section in a div
Greg Billock
2011/07/11 21:24:25
That makes sense. The reason I didn't do it is bas
|
| + var extensionsModel = new ArrayDataModel(keywords); |
| + this.extensionList_.dataModel = extensionsModel; |
| + } |
| }, |
| }; |
| SearchEngineManager.updateSearchEngineList = function(defaultEngines, |
| - otherEngines) { |
| + otherEngines, |
| + keywords) { |
| SearchEngineManager.getInstance().updateSearchEngineList_(defaultEngines, |
| - otherEngines); |
| + otherEngines, |
| + keywords); |
| }; |
| SearchEngineManager.validityCheckCallback = function(validity, modelIndex) { |