Commit ac19d932 authored by vitalyp's avatar vitalyp Committed by Commit bot

Compile chrome://settings, part 4: 149 proper errors left

R=dbeam@chromium.org
BUG=393873
TEST=GYP_GENERATORS=ninja gyp --depth . chrome/browser/resources/options/compiled_resources.gyp && ninja -C out/Default | grep ERROR | wc -l

Review URL: https://codereview.chromium.org/552883002

Cr-Commit-Position: refs/heads/master@{#295126}
parent 89ccc63d
......@@ -24,8 +24,8 @@ cr.define('options', function() {
'hotword-confirm-overlay', // pageDivName
$('hotword-confirm-ok'), // okButton
$('hotword-confirm-cancel'), // cancelButton
$('hotword-search-enable').pref, // pref
$('hotword-search-enable').metric); // metric
$('hotword-search-enable')['pref'], // pref
$('hotword-search-enable')['metric']); // metric
this.indicator = $('hotword-search-setting-indicator');
}
......
......@@ -93,8 +93,8 @@ function load() {
'do-not-track-confirm-overlay',
/** @type {HTMLInputElement} */($('do-not-track-confirm-ok')),
/** @type {HTMLInputElement} */($('do-not-track-confirm-cancel')),
$('do-not-track-enabled').pref,
$('do-not-track-enabled').metric),
$('do-not-track-enabled')['pref'],
$('do-not-track-enabled')['metric']),
BrowserOptions.getInstance());
// 'spelling-enabled-control' element is only present on Chrome branded
// builds.
......@@ -106,8 +106,8 @@ function load() {
'spelling-confirm-overlay',
/** @type {HTMLInputElement} */($('spelling-confirm-ok')),
/** @type {HTMLInputElement} */($('spelling-confirm-cancel')),
$('spelling-enabled-control').pref,
$('spelling-enabled-control').metric),
$('spelling-enabled-control')['pref'],
$('spelling-enabled-control')['metric']),
BrowserOptions.getInstance());
}
PageManager.registerOverlay(new HotwordConfirmDialog(),
......
......@@ -178,7 +178,7 @@ cr.define('options', function() {
/**
* Updates the data model for the password exceptions list with the values
* from |entries|.
* @param {Array} entries The list of password exception data.
* @param {!Array} entries The list of password exception data.
*/
setPasswordExceptionsList_: function(entries) {
this.passwordExceptionsList_.dataModel = new ArrayDataModel(entries);
......
......@@ -17,7 +17,7 @@ cr.define('options.passwordManager', function() {
* @param {boolean} showPasswords If true, add a button to the element to
* allow the user to reveal the saved password.
* @constructor
* @extends {cr.ui.ListItem}
* @extends {options.DeletableItem}
*/
function PasswordListItem(dataModel, entry, showPasswords) {
var el = cr.doc.createElement('div');
......@@ -195,7 +195,7 @@ cr.define('options.passwordManager', function() {
* Creates a new PasswordExceptions list item.
* @param {Array} entry A pair of the form [url, username].
* @constructor
* @extends {options.DeletableListItem}
* @extends {options.DeletableItem}
*/
function PasswordExceptionsListItem(entry) {
var el = cr.doc.createElement('div');
......
......@@ -62,7 +62,7 @@ cr.define('options', function() {
/**
* Sets up the given list as a search engine list
* @param {cr.ui.List} list The list to set up.
* @param {HTMLElement} list The list to set up.
* @private
*/
setUpList_: function(list) {
......@@ -73,9 +73,9 @@ cr.define('options', function() {
/**
* Updates the search engine list with the given entries.
* @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.
* @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, keywords) {
this.defaultsList_.dataModel = new ArrayDataModel(defaultEngines);
......
......@@ -2,6 +2,24 @@
// 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}}
* @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 +29,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 +87,11 @@ cr.define('options.search_engines', function() {
*/
currentlyValid_: false,
/**
* @type {?SearchEngine}
*/
searchEngine_: null,
/** @override */
decorate: function() {
InlineEditableItem.prototype.decorate.call(this);
......@@ -146,11 +169,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 +325,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);
},
......
......@@ -551,7 +551,7 @@ cr.define('options', function() {
/**
* A function to handle key press events.
* @return {Event} a keydown event.
* @param {Event} event A keydown event.
* @private
*/
keyDownEventHandler_: function(event) {
......
......@@ -17,8 +17,8 @@ cr.define('options', function() {
* @param {string} name See Page constructor.
* @param {string} title See Page constructor.
* @param {string} pageDivName See Page constructor.
* @param {HTMLInputElement} okButton The confirmation button element.
* @param {HTMLInputElement} cancelButton The cancellation button element.
* @param {HTMLButtonElement} okButton The confirmation button element.
* @param {HTMLButtonElement} cancelButton The cancellation button element.
* @extends {cr.ui.pageManager.Page}
*/
function SettingsDialog(name, title, pageDivName, okButton, cancelButton) {
......
......@@ -16,8 +16,8 @@ cr.define('options', function() {
SettingsDialog.call(this, 'startup',
loadTimeData.getString('startupPagesOverlayTabTitle'),
'startup-overlay',
$('startup-overlay-confirm'),
$('startup-overlay-cancel'));
assertInstanceof($('startup-overlay-confirm'), HTMLButtonElement),
assertInstanceof($('startup-overlay-cancel'), HTMLButtonElement));
};
cr.addSingletonGetter(StartupOverlay);
......
......@@ -172,6 +172,10 @@ base::DictionaryValue* SearchEngineManagerHandler::CreateDictionaryForEngine(
TemplateURLTableModel* table_model = list_controller_->table_model();
const TemplateURL* template_url = list_controller_->GetTemplateURL(index);
// The items which are to be written into |dict| are also described in
// chrome/browser/resources/options/search_engine_manager_engine_list.js
// in @typedef for SearchEngine. Please update it whenever you add or remove
// any keys here.
base::DictionaryValue* dict = new base::DictionaryValue();
dict->SetString("name", template_url->short_name());
dict->SetString("displayName", table_model->GetText(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment