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() { ...@@ -24,8 +24,8 @@ cr.define('options', function() {
'hotword-confirm-overlay', // pageDivName 'hotword-confirm-overlay', // pageDivName
$('hotword-confirm-ok'), // okButton $('hotword-confirm-ok'), // okButton
$('hotword-confirm-cancel'), // cancelButton $('hotword-confirm-cancel'), // cancelButton
$('hotword-search-enable').pref, // pref $('hotword-search-enable')['pref'], // pref
$('hotword-search-enable').metric); // metric $('hotword-search-enable')['metric']); // metric
this.indicator = $('hotword-search-setting-indicator'); this.indicator = $('hotword-search-setting-indicator');
} }
......
...@@ -93,8 +93,8 @@ function load() { ...@@ -93,8 +93,8 @@ function load() {
'do-not-track-confirm-overlay', 'do-not-track-confirm-overlay',
/** @type {HTMLInputElement} */($('do-not-track-confirm-ok')), /** @type {HTMLInputElement} */($('do-not-track-confirm-ok')),
/** @type {HTMLInputElement} */($('do-not-track-confirm-cancel')), /** @type {HTMLInputElement} */($('do-not-track-confirm-cancel')),
$('do-not-track-enabled').pref, $('do-not-track-enabled')['pref'],
$('do-not-track-enabled').metric), $('do-not-track-enabled')['metric']),
BrowserOptions.getInstance()); BrowserOptions.getInstance());
// 'spelling-enabled-control' element is only present on Chrome branded // 'spelling-enabled-control' element is only present on Chrome branded
// builds. // builds.
...@@ -106,8 +106,8 @@ function load() { ...@@ -106,8 +106,8 @@ function load() {
'spelling-confirm-overlay', 'spelling-confirm-overlay',
/** @type {HTMLInputElement} */($('spelling-confirm-ok')), /** @type {HTMLInputElement} */($('spelling-confirm-ok')),
/** @type {HTMLInputElement} */($('spelling-confirm-cancel')), /** @type {HTMLInputElement} */($('spelling-confirm-cancel')),
$('spelling-enabled-control').pref, $('spelling-enabled-control')['pref'],
$('spelling-enabled-control').metric), $('spelling-enabled-control')['metric']),
BrowserOptions.getInstance()); BrowserOptions.getInstance());
} }
PageManager.registerOverlay(new HotwordConfirmDialog(), PageManager.registerOverlay(new HotwordConfirmDialog(),
......
...@@ -178,7 +178,7 @@ cr.define('options', function() { ...@@ -178,7 +178,7 @@ cr.define('options', function() {
/** /**
* Updates the data model for the password exceptions list with the values * Updates the data model for the password exceptions list with the values
* from |entries|. * from |entries|.
* @param {Array} entries The list of password exception data. * @param {!Array} entries The list of password exception data.
*/ */
setPasswordExceptionsList_: function(entries) { setPasswordExceptionsList_: function(entries) {
this.passwordExceptionsList_.dataModel = new ArrayDataModel(entries); this.passwordExceptionsList_.dataModel = new ArrayDataModel(entries);
......
...@@ -17,7 +17,7 @@ cr.define('options.passwordManager', function() { ...@@ -17,7 +17,7 @@ cr.define('options.passwordManager', function() {
* @param {boolean} showPasswords If true, add a button to the element to * @param {boolean} showPasswords If true, add a button to the element to
* allow the user to reveal the saved password. * allow the user to reveal the saved password.
* @constructor * @constructor
* @extends {cr.ui.ListItem} * @extends {options.DeletableItem}
*/ */
function PasswordListItem(dataModel, entry, showPasswords) { function PasswordListItem(dataModel, entry, showPasswords) {
var el = cr.doc.createElement('div'); var el = cr.doc.createElement('div');
...@@ -195,7 +195,7 @@ cr.define('options.passwordManager', function() { ...@@ -195,7 +195,7 @@ cr.define('options.passwordManager', function() {
* Creates a new PasswordExceptions list item. * Creates a new PasswordExceptions list item.
* @param {Array} entry A pair of the form [url, username]. * @param {Array} entry A pair of the form [url, username].
* @constructor * @constructor
* @extends {options.DeletableListItem} * @extends {options.DeletableItem}
*/ */
function PasswordExceptionsListItem(entry) { function PasswordExceptionsListItem(entry) {
var el = cr.doc.createElement('div'); var el = cr.doc.createElement('div');
......
...@@ -62,7 +62,7 @@ cr.define('options', function() { ...@@ -62,7 +62,7 @@ cr.define('options', function() {
/** /**
* Sets up the given list as a search engine list * 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 * @private
*/ */
setUpList_: function(list) { setUpList_: function(list) {
...@@ -73,9 +73,9 @@ cr.define('options', function() { ...@@ -73,9 +73,9 @@ cr.define('options', function() {
/** /**
* Updates the search engine list with the given entries. * Updates the search engine list with the given entries.
* @private * @private
* @param {Array} defaultEngines List of possible default search engines. * @param {!Array} defaultEngines List of possible default search engines.
* @param {Array} otherEngines List of other search engines. * @param {!Array} otherEngines List of other search engines.
* @param {Array} keywords List of keywords from extensions. * @param {!Array} keywords List of keywords from extensions.
*/ */
updateSearchEngineList_: function(defaultEngines, otherEngines, keywords) { updateSearchEngineList_: function(defaultEngines, otherEngines, keywords) {
this.defaultsList_.dataModel = new ArrayDataModel(defaultEngines); this.defaultsList_.dataModel = new ArrayDataModel(defaultEngines);
......
...@@ -2,6 +2,24 @@ ...@@ -2,6 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // 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() { cr.define('options.search_engines', function() {
/** @const */ var ControlledSettingIndicator = /** @const */ var ControlledSettingIndicator =
options.ControlledSettingIndicator; options.ControlledSettingIndicator;
...@@ -11,9 +29,9 @@ cr.define('options.search_engines', function() { ...@@ -11,9 +29,9 @@ cr.define('options.search_engines', function() {
/** /**
* Creates a new search engine list item. * Creates a new search engine list item.
* @param {Object} searchEngine The search engine this represents. * @param {SearchEngine} searchEngine The search engine this represents.
* @constructor * @constructor
* @extends {cr.ui.ListItem} * @extends {options.InlineEditableItem}
*/ */
function SearchEngineListItem(searchEngine) { function SearchEngineListItem(searchEngine) {
var el = cr.doc.createElement('div'); var el = cr.doc.createElement('div');
...@@ -69,6 +87,11 @@ cr.define('options.search_engines', function() { ...@@ -69,6 +87,11 @@ cr.define('options.search_engines', function() {
*/ */
currentlyValid_: false, currentlyValid_: false,
/**
* @type {?SearchEngine}
*/
searchEngine_: null,
/** @override */ /** @override */
decorate: function() { decorate: function() {
InlineEditableItem.prototype.decorate.call(this); InlineEditableItem.prototype.decorate.call(this);
...@@ -146,11 +169,13 @@ cr.define('options.search_engines', function() { ...@@ -146,11 +169,13 @@ cr.define('options.search_engines', function() {
} }
// Do final adjustment to the input fields. // 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. // The editable field uses the raw name, not the display name.
this.nameField_.value = engine.name; this.nameField_.value = engine.name;
this.keywordField_ = keywordEl.querySelector('input'); this.keywordField_ = /** @type {HTMLElement} */(
this.urlField_ = urlEl.querySelector('input'); keywordEl.querySelector('input'));
this.urlField_ = /** @type {HTMLElement} */(urlEl.querySelector('input'));
if (engine.urlLocked) if (engine.urlLocked)
this.urlField_.disabled = true; this.urlField_.disabled = true;
...@@ -300,12 +325,19 @@ cr.define('options.search_engines', function() { ...@@ -300,12 +325,19 @@ cr.define('options.search_engines', function() {
}, },
}; };
/**
* @constructor
* @extends {options.InlineEditableItemList}
*/
var SearchEngineList = cr.ui.define('list'); var SearchEngineList = cr.ui.define('list');
SearchEngineList.prototype = { SearchEngineList.prototype = {
__proto__: InlineEditableItemList.prototype, __proto__: InlineEditableItemList.prototype,
/** @override */ /**
* @override
* @param {SearchEngine} searchEngine
*/
createItem: function(searchEngine) { createItem: function(searchEngine) {
return new SearchEngineListItem(searchEngine); return new SearchEngineListItem(searchEngine);
}, },
......
...@@ -551,7 +551,7 @@ cr.define('options', function() { ...@@ -551,7 +551,7 @@ cr.define('options', function() {
/** /**
* A function to handle key press events. * A function to handle key press events.
* @return {Event} a keydown event. * @param {Event} event A keydown event.
* @private * @private
*/ */
keyDownEventHandler_: function(event) { keyDownEventHandler_: function(event) {
......
...@@ -17,8 +17,8 @@ cr.define('options', function() { ...@@ -17,8 +17,8 @@ cr.define('options', function() {
* @param {string} name See Page constructor. * @param {string} name See Page constructor.
* @param {string} title See Page constructor. * @param {string} title See Page constructor.
* @param {string} pageDivName See Page constructor. * @param {string} pageDivName See Page constructor.
* @param {HTMLInputElement} okButton The confirmation button element. * @param {HTMLButtonElement} okButton The confirmation button element.
* @param {HTMLInputElement} cancelButton The cancellation button element. * @param {HTMLButtonElement} cancelButton The cancellation button element.
* @extends {cr.ui.pageManager.Page} * @extends {cr.ui.pageManager.Page}
*/ */
function SettingsDialog(name, title, pageDivName, okButton, cancelButton) { function SettingsDialog(name, title, pageDivName, okButton, cancelButton) {
......
...@@ -14,10 +14,10 @@ cr.define('options', function() { ...@@ -14,10 +14,10 @@ cr.define('options', function() {
*/ */
function StartupOverlay() { function StartupOverlay() {
SettingsDialog.call(this, 'startup', SettingsDialog.call(this, 'startup',
loadTimeData.getString('startupPagesOverlayTabTitle'), loadTimeData.getString('startupPagesOverlayTabTitle'),
'startup-overlay', 'startup-overlay',
$('startup-overlay-confirm'), assertInstanceof($('startup-overlay-confirm'), HTMLButtonElement),
$('startup-overlay-cancel')); assertInstanceof($('startup-overlay-cancel'), HTMLButtonElement));
}; };
cr.addSingletonGetter(StartupOverlay); cr.addSingletonGetter(StartupOverlay);
......
...@@ -172,6 +172,10 @@ base::DictionaryValue* SearchEngineManagerHandler::CreateDictionaryForEngine( ...@@ -172,6 +172,10 @@ base::DictionaryValue* SearchEngineManagerHandler::CreateDictionaryForEngine(
TemplateURLTableModel* table_model = list_controller_->table_model(); TemplateURLTableModel* table_model = list_controller_->table_model();
const TemplateURL* template_url = list_controller_->GetTemplateURL(index); 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(); base::DictionaryValue* dict = new base::DictionaryValue();
dict->SetString("name", template_url->short_name()); dict->SetString("name", template_url->short_name());
dict->SetString("displayName", table_model->GetText( 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