Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Move webrtc options from advanced to security prefs
Browse files Browse the repository at this point in the history
fix #13805

Test Plan:
1. go to about:preferences > Advanced
2. you shouldn't see webrtc options there
3. go to about:preferences > security
4. you should see the webrtc options
  • Loading branch information
diracdeltas committed Apr 11, 2018
1 parent 0640d1e commit 36edd25
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 33 deletions.
33 changes: 0 additions & 33 deletions app/renderer/components/preferences/advancedTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const locale = require('../../../../js/l10n')

// Actions
const {getSetting} = require('../../../../js/settings')
const aboutActions = require('../../../../js/about/aboutActions')

// Components
const {SettingsList, SettingItem, SettingCheckbox} = require('../common/settings')
Expand All @@ -20,7 +19,6 @@ const {DefaultSectionTitle} = require('../common/sectionTitle')

// Constants
const settings = require('../../../../js/constants/settings')
const webrtcConstants = require('../../../../js/constants/webrtcConstants')
const {scaleSize} = require('../../../common/constants/toolbarUserInterfaceScale')

// Utils
Expand Down Expand Up @@ -155,30 +153,6 @@ class AdvancedTab extends ImmutableComponent {
/>
{this.spellCheckLanguages}
</SettingsList>
<DefaultSectionTitle data-l10n-id='webrtcPolicy' />
<SettingsList>
<SettingDropdown
value={(
getSetting(settings.WEBRTC_POLICY, this.props.settings)
)}
onChange={changeSetting.bind(
null,
this.props.onChangeSetting,
settings.WEBRTC_POLICY
)}>
{
Object.keys(webrtcConstants)
.map((policy) => <option data-l10n-id={policy} value={webrtcConstants[policy]} />)
}
</SettingDropdown>
<div
className={css(styles.link)}
data-l10n-id='webrtcPolicyExplanation'
onClick={aboutActions.createTabRequested.bind(null, {
url: 'https://cs.chromium.org/chromium/src/content/public/common/webrtc_ip_handling_policy.h'
})}
/>
</SettingsList>
</main>
<footer className={css(styles.moreInfo)}>
<div data-l10n-id='requiresRestart' className={css(commonStyles.requiresRestart)} />
Expand All @@ -205,13 +179,6 @@ const styles = StyleSheet.create({
marginLeft: '5px'
},

link: {
cursor: 'pointer',
fontSize: '14px',
lineHeight: '3em',
textDecoration: 'underline'
},

moreInfo: {
display: 'flex',
flex: 1,
Expand Down
32 changes: 32 additions & 0 deletions js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const appConfig = require('../constants/appConfig')
const preferenceTabs = require('../constants/preferenceTabs')
const messages = require('../constants/messages')
const settings = require('../constants/settings')
const webrtcConstants = require('../constants/webrtcConstants')
const {changeSetting} = require('../../app/renderer/lib/settingsUtil')
const {passwordManagers, extensionIds} = require('../constants/passwordManagers')
const {startsWithOption, newTabMode, bookmarksToolbarMode, fullscreenOption, autoplayOption} = require('../../app/common/constants/settingsEnums')
Expand Down Expand Up @@ -414,6 +415,30 @@ class SecurityTab extends ImmutableComponent {
<SettingsList>
<SettingCheckbox dataL10nId='useSiteIsolation' prefKey={settings.SITE_ISOLATION_ENABLED} settings={this.props.settings} onChangeSetting={this.props.onChangeSetting} />
</SettingsList>
<DefaultSectionTitle data-l10n-id='webrtcPolicy' />
<SettingsList>
<SettingDropdown
value={(
getSetting(settings.WEBRTC_POLICY, this.props.settings)
)}
onChange={changeSetting.bind(
null,
this.props.onChangeSetting,
settings.WEBRTC_POLICY
)}>
{
Object.keys(webrtcConstants)
.map((policy) => <option data-l10n-id={policy} value={webrtcConstants[policy]} />)
}
</SettingDropdown>
<div
className={css(styles.link)}
data-l10n-id='webrtcPolicyExplanation'
onClick={aboutActions.createTabRequested.bind(null, {
url: 'https://cs.chromium.org/chromium/src/content/public/common/webrtc_ip_handling_policy.h'
})}
/>
</SettingsList>
<DefaultSectionTitle data-l10n-id='firewall' />
<SettingsList>
<SettingCheckbox dataL10nId='useFirewall' checked={this.props.braveryDefaults.get(firewall)} onChange={this.onToggleFirewall} />
Expand Down Expand Up @@ -765,6 +790,13 @@ const styles = StyleSheet.create({

searchShortcutEntry: {
fontSize: '1rem'
},

link: {
cursor: 'pointer',
fontSize: '14px',
lineHeight: '3em',
textDecoration: 'underline'
}
})

Expand Down

0 comments on commit 36edd25

Please sign in to comment.