Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
fenix
Commits
3521e46a
Commit
3521e46a
authored
Sep 28, 2020
by
Matthew Finkel
Browse files
Bug 40026: Integrate Security Level settings
parent
66fca2d6
Changes
6
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlController.kt
View file @
3521e46a
...
...
@@ -367,6 +367,8 @@ class DefaultSessionControlController(
}
override
fun
handleOpenSecurityLevelSettingsClicked
()
{
val
directions
=
HomeFragmentDirections
.
actionGlobalTorSecurityLevelFragment
()
navController
.
nav
(
R
.
id
.
homeFragment
,
directions
)
}
override
fun
handleWhatsNewGetAnswersClicked
()
{
...
...
app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/onboarding/TorOnboardingSecurityLevelViewHolder.kt
View file @
3521e46a
...
...
@@ -11,6 +11,8 @@ import org.mozilla.fenix.R
import
org.mozilla.fenix.ext.components
import
org.mozilla.fenix.home.sessioncontrol.OnboardingInteractor
import
org.mozilla.fenix.onboarding.OnboardingRadioButton
import
org.mozilla.fenix.tor.SecurityLevel
import
org.mozilla.fenix.tor.SecurityLevelUtil
import
org.mozilla.fenix.utils.view.addToRadioGroup
class
TorOnboardingSecurityLevelViewHolder
(
...
...
@@ -57,19 +59,22 @@ class TorOnboardingSecurityLevelViewHolder(
saferSecurityLevel
.
isChecked
=
securityLevel
==
SecurityLevel
.
SAFER
standardSecurityLevel
.
onClickListener
{
updateSecurityLevel
()
updateSecurityLevel
(
SecurityLevel
.
STANDARD
)
}
saferSecurityLevel
.
onClickListener
{
updateSecurityLevel
()
updateSecurityLevel
(
SecurityLevel
.
SAFER
)
}
safestSecurityLevel
.
onClickListener
{
updateSecurityLevel
()
updateSecurityLevel
(
SecurityLevel
.
SAFEST
)
}
}
private
fun
updateSecurityLevel
()
{
private
fun
updateSecurityLevel
(
newLevel
:
SecurityLevel
)
{
itemView
.
context
.
components
.
let
{
it
.
core
.
engine
.
settings
.
torSecurityLevel
=
newLevel
.
intRepresentation
}
}
companion
object
{
...
...
app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
View file @
3521e46a
...
...
@@ -217,6 +217,9 @@ class SettingsFragment : PreferenceFragmentCompat() {
resources
.
getString
(
R
.
string
.
pref_key_tor_network_settings
)
->
{
SettingsFragmentDirections
.
actionSettingsFragmentToTorNetworkSettingsFragment
()
}
resources
.
getString
(
R
.
string
.
pref_key_tor_security_level_settings
)
->
{
SettingsFragmentDirections
.
actionSettingsFragmentToTorSecurityLevelFragment
()
}
resources
.
getString
(
R
.
string
.
pref_key_tracking_protection_settings
)
->
{
requireContext
().
metrics
.
track
(
Event
.
TrackingProtectionSettings
)
SettingsFragmentDirections
.
actionSettingsFragmentToTrackingProtectionFragment
()
...
...
app/src/main/res/navigation/nav_graph.xml
View file @
3521e46a
...
...
@@ -58,6 +58,9 @@
<action
android:id=
"@+id/action_global_syncedTabsFragment"
app:destination=
"@id/syncedTabsFragment"
/>
<action
android:id=
"@+id/action_global_torSecurityLevelFragment"
app:destination=
"@id/torSecurityLevelFragment"
/>
<action
android:id=
"@+id/action_global_privateBrowsingFragment"
app:destination=
"@id/privateBrowsingFragment"
/>
...
...
@@ -496,6 +499,13 @@
app:exitAnim=
"@anim/slide_out_left"
app:popEnterAnim=
"@anim/slide_in_left"
app:popExitAnim=
"@anim/slide_out_right"
/>
<action
android:id=
"@+id/action_settingsFragment_to_torSecurityLevelFragment"
app:destination=
"@id/torSecurityLevelFragment"
app:enterAnim=
"@anim/slide_in_right"
app:exitAnim=
"@anim/slide_out_left"
app:popEnterAnim=
"@anim/slide_in_left"
app:popExitAnim=
"@anim/slide_out_right"
/>
<action
android:id=
"@+id/action_settingsFragment_to_privateBrowsingFragment"
app:destination=
"@id/privateBrowsingFragment"
...
...
app/src/main/res/values/torbrowser_strings.xml
View file @
3521e46a
...
...
@@ -54,6 +54,10 @@
<string
name=
"preferences_tor_network_settings_restarting"
>
Restarting
</string>
<string
name=
"preferences_tor_network_settings_bridges_enabled"
>
Bridges are enabled: %s
</string>
<!-- Preference title for security level settings -->
<string
name=
"preferences_tor_security_level_settings"
>
Security Settings
</string>
<string
name=
"preferences_tor_security_level_options"
>
Security Level
</string>
<!-- Description of security levels -->
<string
name=
"tor_security_level_standard_option"
>
Standard
</string>
<string
name=
"tor_security_level_standard_description"
>
All Tor Browser and website features are enabled.
</string>
...
...
@@ -62,7 +66,4 @@
<string
name=
"tor_security_level_safest_option"
>
Safest
</string>
<string
name=
"tor_security_level_safest_description"
>
Only allow website features required for static sites and basic services. These changes affect images, media, and scripts.
</string>
<!-- Preference title for security level settings -->
<string
name=
"preferences_tor_security_level_settings"
>
Security Settings
</string>
<string
name=
"preferences_tor_security_level_options"
>
Security Level
</string>
</resources>
app/src/main/res/xml/preferences.xml
View file @
3521e46a
...
...
@@ -90,6 +90,11 @@
app:iconSpaceReserved=
"false"
android:layout=
"@layout/preference_category_main_style"
>
<androidx.preference.Preference
android:icon=
"@drawable/ic_tracking_protection_enabled"
android:key=
"@string/pref_key_tor_security_level_settings"
android:title=
"@string/preferences_tor_security_level_settings"
/>
<androidx.preference.Preference
android:icon=
"@drawable/ic_private_browsing"
android:key=
"@string/pref_key_private_browsing"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment