Skip to content

Commit

Permalink
Add learn more link for WebRTC policy setting
Browse files Browse the repository at this point in the history
  • Loading branch information
yrliou committed Oct 2, 2018
1 parent b93f93e commit 3a33d4e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/brave_generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U
<message name="IDS_SETTINGS_WEBRTC_POLICY_LABEL" desc="WebRTC policy setting label">
WebRTC IP Handling Policy
</message>
<message name="IDS_SETTINGS_WEBRTC_POLICY_SUB_LABEL" desc="WebRTC policy setting sub-label">
Learn more
</message>
<message name="IDS_SETTINGS_WEBRTC_POLICY_DEFAULT" desc="Select value">
Default
</message>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@
<dom-module id="settings-brave-personalization-options">
<template>
<style include="settings-shared md-select iron-flex">
.settings-box {
display: flex;
justify-content: space-between;
}
</style>
<div class="settings-box">
<div class="start">$i18n{webRTCPolicyLabel}</div>
<div calss="start" id="labelWrapper">
<div class="label">$i18n{webRTCPolicyLabel}</div>
<a id="learnMore" href="$i18n{webRTCLearnMoreURL}" target="_blank">
$i18n{webRTCPolicySubLabel}
</a>
</div>
<select id="webRTCPolicy" class="md-select"
on-change="onWebRTCPolicyChange_">
<template is="dom-repeat" items="[[webRTCPolicies_]]">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ void BraveAddImportDataStrings(content::WebUIDataSource* html_source) {
}
#endif

const char kWebRTCLearnMoreURL[] =
"https://github.com/brave/brave-browser/wiki/WebRTC-Custom-Settings";

void BraveAddCommonStrings(content::WebUIDataSource* html_source, Profile* profile) {
LocalizedString localized_strings[] = {
{"siteSettingsAutoplay",
Expand Down Expand Up @@ -61,6 +64,8 @@ void BraveAddCommonStrings(content::WebUIDataSource* html_source, Profile* profi
IDS_SETTINGS_BLOCK_FINGERPRINTING},
{"webRTCPolicyLabel",
IDS_SETTINGS_WEBRTC_POLICY_LABEL},
{"webRTCPolicySubLabel",
IDS_SETTINGS_WEBRTC_POLICY_SUB_LABEL},
{"webRTCDefault",
IDS_SETTINGS_WEBRTC_POLICY_DEFAULT},
{"defaultPublicAndPrivateInterfaces",
Expand All @@ -72,6 +77,8 @@ void BraveAddCommonStrings(content::WebUIDataSource* html_source, Profile* profi
};
AddLocalizedStringsBulk(html_source, localized_strings,
arraysize(localized_strings));
html_source->AddString("webRTCLearnMoreURL",
base::ASCIIToUTF16(kWebRTCLearnMoreURL));
}

void BraveAddLocalizedStrings(content::WebUIDataSource* html_source,
Expand Down

0 comments on commit 3a33d4e

Please sign in to comment.