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

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

Issue 552883002: Compile chrome://settings, part 4: 149 proper errors left (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@H_options_errors_2
Patch Set: reannotate createItem() Created 6 years, 3 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_engine_list.js
diff --git a/chrome/browser/resources/options/search_engine_manager_engine_list.js b/chrome/browser/resources/options/search_engine_manager_engine_list.js
index 04a6eeee90278ba6c759f200004aec3a24b2ee4b..480ab8aed25d8527d99e58c54f6762bcc8180b34 100644
--- a/chrome/browser/resources/options/search_engine_manager_engine_list.js
+++ b/chrome/browser/resources/options/search_engine_manager_engine_list.js
@@ -2,6 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+/**
+ * @typedef {{
+ * canBeDefault: boolean,
+ * canBeEdited: boolean,
+ * canBeRemoved: boolean,
+ * default: boolean,
+ * displayName: string,
+ * extension: (Object|undefined),
+ * iconURL: (string|undefined),
+ * isExtension: boolean,
+ * keyword: string,
+ * modelIndex: string,
+ * name: string,
+ * url: string,
+ * urlLocked: boolean
Dan Beam 2014/09/12 23:29:09 nit: indent keys
Vitaly Pavlenko 2014/09/12 23:51:59 Done.
+ * }}
+ * @see chrome/browser/ui/webui/options/search_engine_manager_handler.cc
+ */
+var SearchEngine;
+
cr.define('options.search_engines', function() {
/** @const */ var ControlledSettingIndicator =
options.ControlledSettingIndicator;
@@ -11,9 +31,9 @@ cr.define('options.search_engines', function() {
/**
* Creates a new search engine list item.
- * @param {Object} searchEngine The search engine this represents.
+ * @param {SearchEngine} searchEngine The search engine this represents.
* @constructor
- * @extends {cr.ui.ListItem}
+ * @extends {options.InlineEditableItem}
*/
function SearchEngineListItem(searchEngine) {
var el = cr.doc.createElement('div');
@@ -69,6 +89,11 @@ cr.define('options.search_engines', function() {
*/
currentlyValid_: false,
+ /**
+ * @type {?SearchEngine}
+ */
+ searchEngine_: null,
+
/** @override */
decorate: function() {
InlineEditableItem.prototype.decorate.call(this);
@@ -146,11 +171,13 @@ cr.define('options.search_engines', function() {
}
// Do final adjustment to the input fields.
- this.nameField_ = nameEl.querySelector('input');
+ this.nameField_ = /** @type {HTMLElement} */(
+ nameEl.querySelector('input'));
// The editable field uses the raw name, not the display name.
this.nameField_.value = engine.name;
- this.keywordField_ = keywordEl.querySelector('input');
- this.urlField_ = urlEl.querySelector('input');
+ this.keywordField_ = /** @type {HTMLElement} */(
+ keywordEl.querySelector('input'));
+ this.urlField_ = /** @type {HTMLElement} */(urlEl.querySelector('input'));
if (engine.urlLocked)
this.urlField_.disabled = true;
@@ -300,12 +327,19 @@ cr.define('options.search_engines', function() {
},
};
+ /**
+ * @constructor
+ * @extends {options.InlineEditableItemList}
+ */
var SearchEngineList = cr.ui.define('list');
SearchEngineList.prototype = {
__proto__: InlineEditableItemList.prototype,
- /** @override */
+ /**
+ * @override
+ * @param {SearchEngine} searchEngine
+ */
createItem: function(searchEngine) {
return new SearchEngineListItem(searchEngine);
},
« no previous file with comments | « chrome/browser/resources/options/search_engine_manager.js ('k') | chrome/browser/resources/options/search_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698