Skip to content

Commit

Permalink
Fixes Reset Profile dialog.
Browse files Browse the repository at this point in the history
Fixes brave/brave-browser#2708

Instead of patching the html/js of the reset_profile_dialog, introduced
Brave behavior that hides/unchecks/disables the checkbox we don't want
seen along with the entire footer of the dialog since it contains
nothing else.
  • Loading branch information
mkarolin committed Apr 2, 2019
1 parent 33c9f85 commit 1bd398b
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<script src="brave_reset_profile_dialog_behavior.js"></script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

BraveResetProfileDialogBehavior = {

ready: function() {
this.fixSendSettingsCheckbox();
},

/**
* Unchecks, disables, and hides sendSettings checkbox.
* Also, hide the entire footer.
* @private
*/
fixSendSettingsCheckbox: function() {
this.$.sendSettings.checked = false;
this.$.sendSettings.hidden = true;
this.$.sendSettings.disabled = true;
this.$.sendSettings.parentNode.hidden = true;
},
};
1 change: 1 addition & 0 deletions browser/resources/settings/brave_settings_overrides.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<link rel="import" href="brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_behavior.html">
<link rel="import" href="brave_reset_page/brave_reset_profile_dialog_behavior.html">
<link rel="import" href="chrome://brave-resources/polymer_overriding.html">
<script src="brave_settings_overrides.js"></script>
3 changes: 3 additions & 0 deletions browser/resources/settings/brave_settings_overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
window.BravePatching.registerPolymerBehaviors({
'settings-clear-browsing-data-dialog': [
BraveClearBrowsingDataOnExitBehavior
],
'settings-reset-profile-dialog': [
BraveResetProfileDialogBehavior
]
})
2 changes: 2 additions & 0 deletions browser/resources/settings/settings_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
<structure name="IDR_SETTINGS_BRAVE_CLEAR_BROWSING_DATA_ON_EXIT_PAGE_JS" file="brave_clear_browsing_data_dialog/brave_clear_browsing_data_on_exit_page.js" type="chrome_html" preprocess="true" />
<structure name="IDR_SETTINGS_BRAVE_CLEAR_BROWSING_DATA_DIALOG_BEHAVIOR_HTML" file="brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_behavior.html" type="chrome_html" preprocess="true" allowexternalscript="true" />
<structure name="IDR_SETTINGS_BRAVE_CLEAR_BROWSING_DATA_DIALOG_BEHAVIOR_JS" file="brave_clear_browsing_data_dialog/brave_clear_browsing_data_dialog_behavior.js" type="chrome_html" preprocess="true" />
<structure name="IDR_SETTINGS_BRAVE_RESET_PROFILE_DIALOG_BEHAVIOR_HTML" file="brave_reset_page/brave_reset_profile_dialog_behavior.html" type="chrome_html" preprocess="true" allowexternalscript="true" />
<structure name="IDR_SETTINGS_BRAVE_RESET_PROFILE_DIALOG_BEHAVIOR_JS" file="brave_reset_page/brave_reset_profile_dialog_behavior.js" type="chrome_html" preprocess="true" />
<!-- brave sync -->
<structure name="IDR_SETTINGS_BRAVE_SYNC_BROWSER_PROXY_HTML" file="brave_sync_page/brave_sync_browser_proxy.html" type="chrome_html" />
<structure name="IDR_SETTINGS_BRAVE_SYNC_BROWSER_PROXY_JS" file="brave_sync_page/brave_sync_browser_proxy.js" type="chrome_html" preprocess="true" />
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 1bd398b

Please sign in to comment.