Skip to content

Commit

Permalink
Remove Remote Debugging preference
Browse files Browse the repository at this point in the history
- Removes the preference
- Removes from Settings page
- This is on by default and proxied now, thanks to brave/brave-browser#7645

Fixes brave/brave-browser#9715
  • Loading branch information
bsclifton committed Jun 29, 2020
1 parent b6a0e62 commit d250534
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 133 deletions.
4 changes: 0 additions & 4 deletions app/brave_generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,6 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U
<message name="IDS_SETTINGS_PUSH_MESSAGING" desc="Select value">
Use Google Services for Push Messaging
</message>
<!-- Remote Debugging -->
<message name="IDS_SETTINGS_REMOTE_DEBUGGING_TITLE" desc="Select value">
Remote debugging
</message>
<!-- Brave Sync Settings -->
<message name="IDS_SETTINGS_BRAVE_SYNC_TITLE" desc="The title for Brave Sync in settings">
Sync
Expand Down
1 change: 0 additions & 1 deletion browser/brave_local_state_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ namespace brave {
void RegisterLocalStatePrefs(PrefRegistrySimple* registry) {
brave_shields::RegisterPrefsForAdBlockService(registry);
RegisterPrefsForBraveStatsUpdater(registry);
registry->RegisterBooleanPref(kRemoteDebuggingEnabled, true);
ntp_background_images::NTPBackgroundImagesService::RegisterLocalStatePrefs(
registry);
#if BUILDFLAG(ENABLE_BRAVE_REFERRALS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@
</cr-button>
</template>
</settings-toggle-button>
<settings-toggle-button id="remoteDebuggingEnabled"
pref=""
checked="[[remoteDebuggingEnabled_]]"
label="$i18n{remoteDebuggingEnabledTitle}"
on-settings-boolean-control-change="onRemoteDebuggingEnabledChange_">
</settings-toggle-button>
</template>
<script src="brave_personalization_options.js"></script>
</dom-module>
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ Polymer({
},

webRTCPolicy_: String,
p3aEnabled_: Boolean,
remoteDebuggingEnabled_: Boolean
p3aEnabled_: Boolean
},

/** @private {?settings.BravePrivacyBrowserProxy} */
Expand All @@ -51,12 +50,6 @@ Polymer({
this.browserProxy_.getP3AEnabled().then(enabled => {
this.p3aEnabled_ = enabled;
});
this.browserProxy_.getRemoteDebuggingEnabled().then(enabled => {
this.remoteDebuggingEnabled_ = enabled;
});
this.addWebUIListener('remote-debugging-enabled-changed', (enabled) => {
this.remoteDebuggingEnabled_ = enabled
})
this.addWebUIListener('p3a-enabled-changed', (enabled) => {
this.p3aEnabled_ = enabled
})
Expand All @@ -80,10 +73,6 @@ Polymer({
this.browserProxy_.setP3AEnabled(this.$.p3aEnabled.checked);
},

onRemoteDebuggingEnabledChange_: function() {
this.browserProxy_.setRemoteDebuggingEnabled(this.$.remoteDebuggingEnabled.checked);
},

shouldShowRestart_: function(enabled) {
return enabled != this.browserProxy_.wasPushMessagingEnabledAtStartup();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ cr.define('settings', function() {
* @param {boolean} enabled (true/false).
*/
setP3AEnabled(value) {}
/**
* @return {!Promise<string>}
*/
getRemoteDebuggingEnabled() {}
/**
* @param {boolean} enabled (true/false).
*/
setRemoteDebuggingEnabled(value) {}
/**
* @return {boolean}
*/
Expand Down Expand Up @@ -56,14 +48,6 @@ cr.define('settings', function() {
chrome.send('setP3AEnabled', [value])
}

getRemoteDebuggingEnabled() {
return cr.sendWithPromise('getRemoteDebuggingEnabled');
}

setRemoteDebuggingEnabled(value) {
chrome.send('setRemoteDebuggingEnabled', [value])
}

wasPushMessagingEnabledAtStartup() {
return loadTimeData.getBoolean('pushMessagingEnabledAtStartup');
}
Expand Down
45 changes: 0 additions & 45 deletions browser/ui/webui/settings/brave_privacy_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@

BravePrivacyHandler::BravePrivacyHandler() {
local_state_change_registrar_.Init(g_browser_process->local_state());
local_state_change_registrar_.Add(
kRemoteDebuggingEnabled,
base::Bind(&BravePrivacyHandler::OnRemoteDebuggingEnabledChanged,
base::Unretained(this)));

#if BUILDFLAG(BRAVE_P3A_ENABLED)
local_state_change_registrar_.Add(
brave::kP3AEnabled,
Expand Down Expand Up @@ -66,15 +61,6 @@ void BravePrivacyHandler::RegisterMessages() {
"getP3AEnabled", base::BindRepeating(&BravePrivacyHandler::GetP3AEnabled,
base::Unretained(this)));
#endif

web_ui()->RegisterMessageCallback(
"setRemoteDebuggingEnabled",
base::BindRepeating(&BravePrivacyHandler::SetRemoteDebuggingEnabled,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
"getRemoteDebuggingEnabled",
base::BindRepeating(&BravePrivacyHandler::GetRemoteDebuggingEnabled,
base::Unretained(this)));
}

// static
Expand Down Expand Up @@ -143,34 +129,3 @@ void BravePrivacyHandler::OnP3AEnabledChanged() {
}
}
#endif

void BravePrivacyHandler::SetRemoteDebuggingEnabled(
const base::ListValue* args) {
CHECK_EQ(args->GetSize(), 1U);

bool enabled;
args->GetBoolean(0, &enabled);

PrefService* local_state = g_browser_process->local_state();
local_state->SetBoolean(kRemoteDebuggingEnabled, enabled);
}

void BravePrivacyHandler::GetRemoteDebuggingEnabled(
const base::ListValue* args) {
CHECK_EQ(args->GetSize(), 1U);

PrefService* local_state = g_browser_process->local_state();
bool enabled = local_state->GetBoolean(kRemoteDebuggingEnabled);

AllowJavascript();
ResolveJavascriptCallback(args->GetList()[0].Clone(), base::Value(enabled));
}

void BravePrivacyHandler::OnRemoteDebuggingEnabledChanged() {
if (IsJavascriptAllowed()) {
PrefService* local_state = g_browser_process->local_state();
bool enabled = local_state->GetBoolean(kRemoteDebuggingEnabled);

FireWebUIListener("remote-debugging-enabled-changed", base::Value(enabled));
}
}
4 changes: 0 additions & 4 deletions browser/ui/webui/settings/brave_privacy_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ class BravePrivacyHandler : public settings::SettingsPageUIHandler {
void OnP3AEnabledChanged();
#endif

void SetRemoteDebuggingEnabled(const base::ListValue* args);
void GetRemoteDebuggingEnabled(const base::ListValue* args);
void OnRemoteDebuggingEnabledChanged();

Profile* profile_ = nullptr;
PrefChangeRegistrar local_state_change_registrar_;

Expand Down
26 changes: 0 additions & 26 deletions chromium_src/chrome/browser/devtools/devtools_ui_bindings.cc

This file was deleted.

15 changes: 0 additions & 15 deletions chromium_src/chrome/browser/devtools/devtools_ui_bindings.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,6 @@ void BraveAddCommonStrings(content::WebUIDataSource* html_source,
IDS_BRAVE_P3A_ENABLE_SETTING},
{"p3aEnabledDesc",
IDS_BRAVE_P3A_ENABLE_SETTING_SUBITEM},
{"remoteDebuggingEnabledTitle",
IDS_SETTINGS_REMOTE_DEBUGGING_TITLE},
{"siteSettings",
IDS_SETTINGS_SITE_AND_SHIELDS_SETTINGS},
};
Expand Down
1 change: 0 additions & 1 deletion common/pref_names.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ const char kBinanceAccessToken[] = "brave.binance.access_token";
const char kBinanceRefreshToken[] = "brave.binance.refresh_token";
const char kAlwaysShowBookmarkBarOnNTP[] =
"brave.always_show_bookmark_bar_on_ntp";
const char kRemoteDebuggingEnabled[] = "brave.remote_debugging_enabled";
const char kAutocompleteEnabled[] = "brave.autocomplete_enabled";
const char kTopSiteSuggestionsEnabled[] = "brave.top_site_suggestions_enabled";
const char kBraveSuggestedSiteSuggestionsEnabled[] =
Expand Down
1 change: 0 additions & 1 deletion common/pref_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ extern const char kBraveWalletWeb3Provider[];
extern const char kLoadCryptoWalletsOnStartup[];
extern const char kOptedIntoCryptoWallets[];
extern const char kAlwaysShowBookmarkBarOnNTP[];
extern const char kRemoteDebuggingEnabled[];
extern const char kAutocompleteEnabled[];
extern const char kTopSiteSuggestionsEnabled[];
extern const char kBraveSuggestedSiteSuggestionsEnabled[];
Expand Down

0 comments on commit d250534

Please sign in to comment.