Commit 1bbfda5e authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Commit Bot

Fix @protected fields/methods remove trailing _

Follow up of CL:1619584 according to JS style guide [1] private fields
shouldn't have trailing _.

Renamed fields:
* container_
* frame_
* title_
* text_
* closeButton_
* okButton_
* cancelButton_

Renamed methods:
* initDom_
* onCotainerKeyDown_

[1] - https://google.github.io/styleguide/javascriptguide.xml?showone=Naming#Naming

Change-Id: I67b622a6a8f07bfd6a201f4f8bb12f2fc13ab38f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1621774
Commit-Queue: calamity <calamity@chromium.org>
Auto-Submit: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarcalamity <calamity@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662118}
parent fafebc8a
......@@ -15,24 +15,25 @@ class CWSWidgetContainerErrorDialog extends cr.ui.dialogs.BaseDialog {
* @return {boolean}
*/
shown() {
return this.container_.classList.contains('shown');
return this.container.classList.contains('shown');
}
/**
* One-time initialization of DOM.
* @protected
* @override
*/
initDom_() {
super.initDom_();
this.frame_.classList.add('cws-widget-error-dialog-frame');
initDom() {
super.initDom();
this.frame.classList.add('cws-widget-error-dialog-frame');
const img = this.document_.createElement('div');
img.className = 'cws-widget-error-dialog-img';
this.frame_.insertBefore(img, this.text_);
this.frame.insertBefore(img, this.text);
this.title_.hidden = true;
this.closeButton_.hidden = true;
this.cancelButton_.hidden = true;
this.text_.classList.add('cws-widget-error-dialog-text');
this.title.hidden = true;
this.closeButton.hidden = true;
this.cancelButton.hidden = true;
this.text.classList.add('cws-widget-error-dialog-text');
// Don't allow OK button to lose focus, in order to prevent webview content
// from stealing focus.
......@@ -40,7 +41,7 @@ class CWSWidgetContainerErrorDialog extends cr.ui.dialogs.BaseDialog {
// order (by setting their tabIndex to -1). This doesn't work for webviews
// because the webview embedder cannot access the webview DOM tree, and thus
// fails to remove elements in the webview from tab order.
this.okButton_.addEventListener('blur', this.refocusOkButton_.bind(this));
this.okButton.addEventListener('blur', this.refocusOkButton_.bind(this));
}
/**
......@@ -49,7 +50,7 @@ class CWSWidgetContainerErrorDialog extends cr.ui.dialogs.BaseDialog {
*/
refocusOkButton_() {
if (this.shown()) {
this.okButton_.focus();
this.okButton.focus();
}
}
}
......@@ -18,11 +18,11 @@ cr.define('cr.filebrowser', () => {
constructor(parentNode) {
super(parentNode);
this.frame_.id = 'default-task-dialog';
this.frame.id = 'default-task-dialog';
this.list_ = new cr.ui.List();
this.list_.id = 'default-tasks-list';
this.frame_.insertBefore(this.list_, this.text_.nextSibling);
this.frame.insertBefore(this.list_, this.text.nextSibling);
this.selectionModel_ = this.list_.selectionModel =
new cr.ui.ListSingleSelectionModel();
......@@ -101,9 +101,9 @@ cr.define('cr.filebrowser', () => {
}
if (!message) {
this.text_.setAttribute('hidden', 'hidden');
this.text.setAttribute('hidden', 'hidden');
} else {
this.text_.removeAttribute('hidden');
this.text.removeAttribute('hidden');
}
this.list_.startBatchUpdates();
......@@ -151,7 +151,7 @@ cr.define('cr.filebrowser', () => {
/**
* @override
*/
onContainerKeyDown_(event) {
onContainerKeyDown(event) {
// Handle Escape.
if (event.keyCode == 27) {
this.hide();
......
......@@ -17,8 +17,8 @@ class FilesAlertDialog extends cr.ui.dialogs.AlertDialog {
* @protected
* @override
*/
initDom_() {
super.initDom_();
this.frame_.classList.add('files-alert-dialog');
initDom() {
super.initDom();
this.frame.classList.add('files-alert-dialog');
}
}
......@@ -18,7 +18,7 @@ FilesConfirmDialog.prototype.__proto__ = cr.ui.dialogs.ConfirmDialog.prototype;
* @protected
* @override
*/
FilesConfirmDialog.prototype.initDom_ = function() {
cr.ui.dialogs.ConfirmDialog.prototype.initDom_.call(this);
this.frame_.classList.add('files-confirm-dialog');
FilesConfirmDialog.prototype.initDom = function() {
cr.ui.dialogs.ConfirmDialog.prototype.initDom.call(this);
this.frame.classList.add('files-confirm-dialog');
};
......@@ -16,11 +16,11 @@ cr.define('cr.filebrowser', () => {
constructor(parentNode) {
super(parentNode);
this.frame_.id = 'install-linux-package-dialog';
this.frame.id = 'install-linux-package-dialog';
this.details_frame_ = this.document_.createElement('div');
this.details_frame_.className = 'install-linux-package-details-frame';
this.frame_.insertBefore(this.details_frame_, this.buttons);
this.frame.insertBefore(this.details_frame_, this.buttons);
this.details_label_ = this.document_.createElement('div');
this.details_label_.className = 'install-linux-package-details-label';
......@@ -29,12 +29,12 @@ cr.define('cr.filebrowser', () => {
// The OK button normally dismisses the dialog, so add a button we can
// customize.
this.installButton_ = this.okButton_.cloneNode(false /* deep */);
this.installButton_ = this.okButton.cloneNode(false /* deep */);
this.installButton_.textContent =
str('INSTALL_LINUX_PACKAGE_INSTALL_BUTTON');
this.installButton_.addEventListener(
'click', this.onInstallClick_.bind(this));
this.buttons.insertBefore(this.installButton_, this.okButton_);
this.buttons.insertBefore(this.installButton_, this.okButton);
this.initialFocusElement_ = this.installButton_;
/** @private {?Entry} */
......@@ -50,8 +50,8 @@ cr.define('cr.filebrowser', () => {
// We re-use the same object, so reset any visual state that may be
// changed.
this.installButton_.hidden = false;
this.okButton_.hidden = true;
this.cancelButton_.hidden = false;
this.okButton.hidden = true;
this.cancelButton.hidden = false;
this.entry_ = entry;
......@@ -151,10 +151,10 @@ cr.define('cr.filebrowser', () => {
assert(this.entry_), this.onInstallLinuxPackage_.bind(this));
this.installButton_.hidden = true;
this.cancelButton_.hidden = true;
this.cancelButton.hidden = true;
this.okButton_.hidden = false;
this.okButton_.focus();
this.okButton.hidden = false;
this.okButton.focus();
}
/**
......@@ -167,7 +167,7 @@ cr.define('cr.filebrowser', () => {
*/
onInstallLinuxPackage_(response, failure_reason) {
if (response == 'started') {
this.text_.textContent =
this.text.textContent =
str('INSTALL_LINUX_PACKAGE_INSTALLATION_STARTED');
return;
}
......@@ -175,8 +175,8 @@ cr.define('cr.filebrowser', () => {
// Currently we always display a generic error message. Eventually we'll
// want a different message for the 'install_already_active' case, and to
// surface the provided failure reason if one is provided.
this.title_.textContent = str('INSTALL_LINUX_PACKAGE_ERROR_TITLE');
this.text_.textContent = str('INSTALL_LINUX_PACKAGE_ERROR_DESCRIPTION');
this.title.textContent = str('INSTALL_LINUX_PACKAGE_ERROR_TITLE');
this.text.textContent = str('INSTALL_LINUX_PACKAGE_ERROR_DESCRIPTION');
console.error('Failed to begin package installation: ' + failure_reason);
}
}
......
......@@ -39,8 +39,8 @@ class MultiProfileShareDialog extends FileManagerDialogBase {
shareLine.appendChild(this.mailLabel_);
shareLine.appendChild(this.shareTypeSelect_);
this.frame_.insertBefore(shareLine, this.buttons);
this.frame_.id = 'multi-profile-share-dialog';
this.frame.insertBefore(shareLine, this.buttons);
this.frame.id = 'multi-profile-share-dialog';
this.currentProfileId_ = new Promise(callback => {
chrome.fileManagerPrivate.getProfiles(
......
......@@ -27,14 +27,14 @@ class SuggestAppsDialog extends FileManagerDialogBase {
*/
this.providersModel_ = providersModel;
this.frame_.id = 'suggest-app-dialog';
this.frame.id = 'suggest-app-dialog';
/**
* The root element for the Chrome Web Store widget container.
* @const {!HTMLElement}
*/
const widgetRoot = this.document_.createElement('div');
this.frame_.insertBefore(widgetRoot, this.text_.nextSibling);
this.frame.insertBefore(widgetRoot, this.text.nextSibling);
/**
* The wrapper around Chrome Web Store widget.
......@@ -58,8 +58,8 @@ class SuggestAppsDialog extends FileManagerDialogBase {
this.buttons.hidden = true;
// Override default dialog styles.
this.title_.classList.add('suggest-apps-dialog-title');
this.text_.classList.add('suggest-apps-dialog-text');
this.title.classList.add('suggest-apps-dialog-title');
this.text.classList.add('suggest-apps-dialog-text');
/** @private {?string} */
this.installedItemId_ = null;
......@@ -221,7 +221,7 @@ class SuggestAppsDialog extends FileManagerDialogBase {
* @private
*/
showInternal_(options, title, webStoreUrl, onDialogClosed) {
this.text_.hidden = true;
this.text.hidden = true;
this.dialogText_ = '';
if (!this.widget_.isInInitialState()) {
......
This diff is collapsed.
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