-
Notifications
You must be signed in to change notification settings - Fork 1.3k
For #514 & #5742: Updates "launch links in private tab" functionality #5721
For #514 & #5742: Updates "launch links in private tab" functionality #5721
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5721 +/- ##
=========================================
Coverage ? 14.43%
Complexity ? 322
=========================================
Files ? 256
Lines ? 10500
Branches ? 1530
=========================================
Hits ? 1516
Misses ? 8858
Partials ? 126
Continue to review full report at Codecov.
|
f1b6c16
to
ec84796
Compare
ec84796
to
2795a32
Compare
2795a32
to
b1d65f3
Compare
…n private tab" functionality
b1d65f3
to
ae9e2ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heading to a meeting, I'll review more later today.
@@ -123,6 +123,54 @@ | |||
android:resource="@mipmap/ic_launcher" /> | |||
</activity> | |||
|
|||
<activity-alias |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this would be a good place for a small comment explaining why we need this alias.
if (didLaunchPrivateLink && Browsers.all(this).isDefaultBrowser) { | ||
this.settings().openLinksInAPrivateTab = true | ||
} else if (!Browsers.all(this).isDefaultBrowser) { | ||
/* If the user has unset us as the default browser, unset alwaysOpenInPrivateMode */ | ||
this.settings().openLinksInAPrivateTab = false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double checking because I'm not sure: would this properly handle the following case?
- User launches app in normal mode
- App is default browser
- User toggles openLinksInAPrivateTab
- App is backgrounded (but not destroyed)
- A third party link is opened
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested and it opens the link in private mode as expected :)
app/src/main/java/org/mozilla/fenix/settings/DefaultBrowserFragment.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not particularly familiar with the Preference
API, but this seems good to me.
android:paddingEnd="?android:attr/scrollbarSize"> | ||
|
||
<LinearLayout | ||
android:id="@android:id/widget_frame" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not clear on exactly how this works, would it still function as a FrameLayout
? They're somewhat less expensive to inflate.
0a74773
to
3a73344
Compare
Pull Request checklist
After merge
To download an APK when reviewing a PR: