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

Unified Diff: chrome/browser/resources/options/search_engine_manager.js

Issue 7104121: Add (uneditable) display of extension keywords to the search engine manager. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Catch up with base namespace for values. Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
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..15d930572381e09ca25205db18ce26f845be7548 100644
--- a/chrome/browser/resources/options/search_engine_manager.js
+++ b/chrome/browser/resources/options/search_engine_manager.js
@@ -23,19 +23,22 @@ cr.define('options', function() {
__proto__: OptionsPage.prototype,
/**
- * List for default search engine options
- * @type {boolean}
+ * List for default search engine options.
* @private
*/
defaultsList_: null,
/**
- * List for other search engine options
- * @type {boolean}
+ * List for other search engine options.
* @private
*/
othersList_: null,
+ /**
+ * List for extension keywords.
+ * @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').hidden = false;
+ $('extensionKeywordList').hidden = false;
+ $('manageExtensionLink').hidden = false;
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698