From 11829ce95d5349f9c84f44a33bda83caa95165a7 Mon Sep 17 00:00:00 2001 From: Emerick Rogul Date: Thu, 2 Jan 2025 10:16:55 -0500 Subject: [PATCH 1/3] Cosmetic formatting and lint changes --- ...ave_clear_browsing_data_dialog_behavior.ts | 38 ++++++------- .../brave_clear_browsing_data_dialog_proxy.ts | 14 ++--- .../brave_clear_browsing_data_on_exit_page.ts | 6 +- .../settings/brave_overrides/about_page.ts | 7 ++- .../brave_overrides/import_data_dialog.ts | 3 +- .../brave_overrides/page_visibility.ts | 7 ++- .../settings/brave_overrides/settings_menu.ts | 4 +- .../settings/brave_overrides/settings_ui.ts | 10 ++-- .../settings/brave_overrides/site_details.ts | 56 ++++++++++--------- .../brave_overrides/site_settings_page.ts | 10 ++-- .../brave_reset_profile_dialog_behavior.ts | 4 +- browser/resources/settings/brave_routes.ts | 29 ++++++---- .../brave_sync_browser_proxy.ts | 9 +++ .../brave_sync_page/brave_sync_subpage.ts | 2 +- .../brave_tor_page/brave_tor_browser_proxy.ts | 21 +++---- .../brave_wallet_browser_proxy.ts | 47 ++++++++-------- .../brave_wallet_page/brave_wallet_page.ts | 14 ++--- .../brave_wallet_page/wallet_networks_list.ts | 12 ++-- .../default_brave_shields_browser_proxy.ts | 2 - .../default_brave_shields_page.ts | 45 +++++++++++---- .../pin_shortcut_page/pin_shortcut_page.ts | 2 +- .../pin_shortcut_page_browser_proxy.ts | 2 - 22 files changed, 194 insertions(+), 150 deletions(-) diff --git a/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_behavior.ts b/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_behavior.ts index 04e125e7c0c3..3508c4278592 100644 --- a/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_behavior.ts +++ b/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_behavior.ts @@ -33,34 +33,34 @@ export class BraveSettingsClearBrowsingDataDialogElement extends BaseElement { this.tabsNames_.push(loadTimeData.getString('onExitPageTitle')); this.addWebUiListener( - 'update-counter-text', this.updateOnExitCountersText.bind(this)); + 'update-counter-text', this.updateOnExitCountersText.bind(this)) this.addWebUiListener( - 'brave-rewards-enabled-changed', (enabled: Boolean) => { - this.braveRewardsEnabled_ = enabled; + 'brave-rewards-enabled-changed', (enabled: boolean) => { + this.braveRewardsEnabled_ = enabled }) this.clearDataBrowserProxy_.getBraveRewardsEnabled().then((enabled) => { - this.braveRewardsEnabled_ = enabled; + this.braveRewardsEnabled_ = enabled }) } override connectedCallback() { - super.connectedCallback(); + super.connectedCallback() - this.onSelectedPageChangedCallback_ = this.onSelectedPageChanged_.bind(this); + this.onSelectedPageChangedCallback_ = this.onSelectedPageChanged_.bind(this) this.$.pages.addEventListener('iron-select', - this.onSelectedPageChangedCallback_); + this.onSelectedPageChangedCallback_) - this.updateSaveButtonStateCallback_ = this.updateSaveButtonState_.bind(this); - this.shadowRoot.querySelector('#on-exit-tab').addEventListener( - 'clear-data-on-exit-page-change', this.updateSaveButtonStateCallback_); + this.updateSaveButtonStateCallback_ = this.updateSaveButtonState_.bind(this) + this.shadowRoot!.querySelector('#on-exit-tab')!.addEventListener( + 'clear-data-on-exit-page-change', this.updateSaveButtonStateCallback_) this.saveOnExitSettingsCallback_ = this.saveOnExitSettings_.bind(this); this.shadowRoot.querySelector('#saveOnExitSettingsConfirm').addEventListener( 'click', this.saveOnExitSettingsCallback_); - this.onClearBraveAdsDataClickHandler_ = this.clearBraveAdsData_.bind(this); + this.onClearBraveAdsDataClickHandler_ = this.clearBraveAdsData_.bind(this) } override disconnectedCallback() { @@ -68,8 +68,8 @@ export class BraveSettingsClearBrowsingDataDialogElement extends BaseElement { if (this.onSelectedPageChangedCallback_) { this.$.pages.removeEventListener('selected-item-changed', - this.onSelectedPageChangedCallback_); - this.onSelectedPageChangedCallback_ = null; + this.onSelectedPageChangedCallback_) + this.onSelectedPageChangedCallback_ = null } if (this.saveOnExitSettingsCallback_) { @@ -84,7 +84,7 @@ export class BraveSettingsClearBrowsingDataDialogElement extends BaseElement { this.saveOnExitSettingsCallback_ = null; } - this.onClearBraveAdsDataClickHandler_ = () => {}; + this.onClearBraveAdsDataClickHandler_ = () => {} } /** @@ -108,7 +108,7 @@ export class BraveSettingsClearBrowsingDataDialogElement extends BaseElement { onSelectedPageChanged_() { const page = this.$.pages.selectedItem; if (!page) { - return; + return } const isOnExitPage = (page.id === 'on-exit-tab'); this.$.clearButton.hidden = isOnExitPage; @@ -131,11 +131,11 @@ export class BraveSettingsClearBrowsingDataDialogElement extends BaseElement { saveOnExitSettings_() { const changed = this.shadowRoot.querySelector('#on-exit-tab').getChangedSettings(); changed.forEach((change) => { - this.set('prefs.' + change.key + '.value', change.value); - }); - this.updateSaveButtonState_(); + this.set('prefs.' + change.key + '.value', change.value) + }) + this.updateSaveButtonState_() if (!this.clearingInProgress_) { - this.$.clearBrowsingDataDialog.close(); + this.$.clearBrowsingDataDialog.close() } } diff --git a/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_proxy.ts b/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_proxy.ts index 5c04abd8ee57..b9440ddbcaf8 100644 --- a/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_proxy.ts +++ b/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_proxy.ts @@ -3,28 +3,28 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ - import {sendWithPromise} from 'chrome://resources/js/cr.js'; + import {sendWithPromise} from 'chrome://resources/js/cr.js' export interface BraveClearBrowsingDataDialogBrowserProxy { - getBraveRewardsEnabled(): Promise; - clearBraveAdsData(): void; + getBraveRewardsEnabled: () => Promise + clearBraveAdsData: () => void } export class BraveClearBrowsingDataDialogBrowserProxyImpl implements BraveClearBrowsingDataDialogBrowserProxy { getBraveRewardsEnabled() { - return sendWithPromise('getBraveRewardsEnabled'); + return sendWithPromise('getBraveRewardsEnabled') } clearBraveAdsData() { - chrome.send('clearBraveAdsData'); + chrome.send('clearBraveAdsData') } static getInstance(): BraveClearBrowsingDataDialogBrowserProxyImpl { return instance || - (instance = new BraveClearBrowsingDataDialogBrowserProxyImpl()); + (instance = new BraveClearBrowsingDataDialogBrowserProxyImpl()) } } -let instance: BraveClearBrowsingDataDialogBrowserProxyImpl|null = null; +let instance: BraveClearBrowsingDataDialogBrowserProxyImpl|null = null diff --git a/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_on_exit_page.ts b/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_on_exit_page.ts index 15c2172e4b0d..586007df111e 100644 --- a/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_on_exit_page.ts +++ b/browser/resources/settings/brave_clear_browsing_data_dialog/brave_clear_browsing_data_on_exit_page.ts @@ -65,9 +65,9 @@ Polymer({ if (checkbox.checked != this.get(checkbox.pref.key, this.prefs).value) { changed.push({key:checkbox.pref.key, value:checkbox.checked}); } - }); - return changed; - }, + }) + return changed + } updateModified_: function () { let modified = false; diff --git a/browser/resources/settings/brave_overrides/about_page.ts b/browser/resources/settings/brave_overrides/about_page.ts index 74ba939a555a..20cd5f0bc9f4 100644 --- a/browser/resources/settings/brave_overrides/about_page.ts +++ b/browser/resources/settings/brave_overrides/about_page.ts @@ -29,6 +29,7 @@ RegisterPolymerTemplateModifications({ if (!version) { console.error('[Brave Settings Overrides] Could not find version div') } + // Remove the class from the version, so we take the link styling. version.removeAttribute('class') @@ -46,11 +47,13 @@ RegisterPolymerTemplateModifications({ const updateStatusMessageLink = section.querySelector('#updateStatusMessage a') if (updateStatusMessageLink) { // - updateStatusMessageLink.href = 'https://support.brave.com/hc/en-us/articles/360042816611-Why-isn-t-Brave-updating-automatically-on-Windows-' + updateStatusMessageLink.href = + 'https://support.brave.com/hc/en-us/articles/360042816611-Why-isn-t-Brave-updating-automatically-on-Windows-' // // - updateStatusMessageLink.href = 'https://community.brave.com?p=update_error' + updateStatusMessageLink.href = + 'https://community.brave.com?p=update_error' // } } diff --git a/browser/resources/settings/brave_overrides/import_data_dialog.ts b/browser/resources/settings/brave_overrides/import_data_dialog.ts index f911783cafe4..9e98854d4fa1 100644 --- a/browser/resources/settings/brave_overrides/import_data_dialog.ts +++ b/browser/resources/settings/brave_overrides/import_data_dialog.ts @@ -10,7 +10,8 @@ import {loadTimeData} from 'chrome://resources/js/load_time_data.js' RegisterPolymerTemplateModifications({ 'settings-import-data-dialog': (templateContent) => { - let checkBoxesParent = templateContent.querySelector('#browserSelect').parentElement; + let checkBoxesParent = + templateContent.querySelector('#browserSelect').parentElement checkBoxesParent.appendChild(html`