In Android, "privacy.trackingprotection.state" is not a "real" pref name, but it's used in the setting menu and browser.js.
"privacy.trackingprotection.state" and "privacy.trackingprotection.pbmode.enabled"(deleted) in Android is init in Helper.getPrefs and passed to browser.js when changed.
The real pref for tacking protection are two Gecko pref in browser.js. They are:
"privacy.trackingprotection.pbmode.enabled"
"privacy.trackingprotection.enabled"
All prefs in Android are delegated to them. The Android setting UI simply reflects the single source of truth (Gecko pref).
That's the reason why the two Android perfs use android:persistent="false"
MozReview-Commit-ID: 5ehBhtNM2Tx
Our user-facing builds crash if we manage to slip in some main thread network access by mistake (which is the default Android StrictMode policy since Honeycomb), so our developer builds shouldn't be more forgiving here.
MozReview-Commit-ID: 6bZwwwrSb3q
We would like to change the status bar color based on different situation:
- For mobile, the status bar color is
#F7FAFC in normal mode,
#38383D in private mode, and
#272727 in tabs tray page
- For tablet, the status bar color is always #272727
MozReview-Commit-ID: Ala5ZOYJ8Ad
This is part 1 of the good-enough approach: see the MAX_SCALE_FACTOR comment
as to what we're aiming for. The next changeset will discard any icons that
do not look good being scaled so much.
The MAX_SCALE_FACTOR field is non-private because it's used in the next
changeset.
MozReview-Commit-ID: HGzdQBEuMAy
Call `onBackPressed()` when `android.R.id.home` is selected to make sure the same click behavior between
HomeAsUpIndicator and back button.
MozReview-Commit-ID: 3tTKtbDTugg
Due to how we access our prefs files (read: all over the place), the idea here is to perform the migration whenever
some component actually attempts to get the prefs. This guarantees that every consumer of prefs will receive the
correct version, and we won't accidentally duplicate our shared prefs either.
I would have preferred to just perform this migration at a set point.
We have a "services upgrade point" - FxAccountUpgradeReceiver - which receives a "package upgraded" intent and kicks
off some async work. Unfortunately, we can't guarantee that its tasks won't overlap with our uses of prefs
(either in the background or foreground code).
MozReview-Commit-ID: AWQ4IY7i32F
This is part 1 of the good-enough approach: see the MAX_SCALE_FACTOR comment
as to what we're aiming for. The next changeset will discard any icons that
do not look good being scaled so much.
The MAX_SCALE_FACTOR field is non-private because it's used in the next
changeset.
MozReview-Commit-ID: HGzdQBEuMAy
This is the desired behavior but as per comment 8, it breaks a few existing
distributions' titles so we'll display two lines for those distributions in
the upcoming changesets.
MozReview-Commit-ID: CKFbHXbs3HT
I tested this through the unit tests I added.
In theory, we could also validate URLs to make sure they're valid but users
should see 404s if they're not valid so this seems like unnecessary code.
MozReview-Commit-ID: 3XqsMawLabj
This ensures that `intl.locale.os` is always set, even if the system locale changes
while Fennec is in the background.
This commit also restores `Strings.flush()` calls that are necessary to have Fennec's
non-Java UI reflect locale changes.
With this commit, the geolocation popup still doesn't behave correctly: when the
locale system is set to match OS locale, although the pref is set the locale doesn't
change. This applies in two scenarios: on first run (the popup is always English)
and when the locale changes at runtime (the popup uses an earlier OS locale).
Bug 1397925 should complete the fix.
MozReview-Commit-ID: 8zeZuYXFYdy
The util PackageUtil helps to get ResolveInfo of default browser, then
we can use it in CustomTabs menu. If user hasn't set any default
browser, instead we display "..." for browser name.
MozReview-Commit-ID: 6DkFkZ8Ovzq
Originally, the listeners that trigger editing mode and the URL bar's context menu were attached to the BrowserToolbar itself. As this doesn't work properly in conjunction with wrapping the URL TextView into a ScrollView, the listeners were moved onto the TextView itself.
Bug 1389164 reduced the height of the TextView in order to better support lightweight themes with the new toolbar design, which in conjunction with the changes to support the ScrollView has the unfortunate side effect of also reducing the URL bar's hit target area.
Therefore, we increase it back to its old levels by using a TouchDelegate on the ScrollView. Because Android's ScrollView implementation doesn't support TouchDelegates, we have to add the missing bits of logic back in from the default View implementation.
MozReview-Commit-ID: 1nTrrNGvBza
Limited space for URLs on mobile browsers has given rise to a class of phishing attacks that rely on a carefully crafted URL with a long subdomain being cut off such as to give the impression of another, legitimate URL [1]. We've experimented in the past with avoiding this by showing only the base domain or the EV certificate owner, but had to revert to the old behaviour because of users complaining about not being able to see as much of the URL as formerly possible.
Making the displayed URL scrollable is therefore a nice solution: It allows us to choose the initial scroll position such as to put the focus on the base domain, while giving users the freedom to easily view all the rest of the URL without having to enter editing mode.
To make the URL scrollable, we wrap the TextView with a HorizontalScrollView. Alternatively, it would have been possible to use a ScrollingMovementMethod with the TextView, however that way
- flinging the text doesn't work out of the box
- dragging the text around is still detected as a normal long-press as well and triggers the context menu
[1]. E.g. https://manage-myaccount.paypal.com-webapps.verifcheck.com/signin/ (see https://twitter.com/ericlaw/status/900429796240277504 for an example screenshot).
MozReview-Commit-ID: LPEXQA2kBvD
Our previous iteration of a more efficient fadingEdge implementation in FadedMultiColorTextView works by blending the text with a chosen colour. By choosing the same colour as the parent view onto which the TextView is placed, it was thus possible to achieve the impression of fading.
With our new URL bar design this is no longer possible quite as easily, since the image used for a lightweight theme will now be displayed behind the URL itself as well. Since the implementation would have also needed more work to make it compatible with scrolling text or being placed in a ScrollView anyway, the fading effect is now achieved directly via the ScrollView instead.
Android's built-in fadingEdge implementation calls Canvas.saveLayer (with CLIP_TO_LAYER_SAVE_FLAG omitted!) during a View's onDraw in order to fade out the contents of its children while preserving the background provided by its parents. This saveLayer call is rather expensive and is quite noticeable on a GPU profile even today.
Therefore, we implement a more efficient variety of fadingEdges that paints over its children's content in onDrawForeground. To avoid any background content from being faded out, the whole view then has to be placed on a separate layer, however this is still much more efficient than calling Canvas.saveLayer and doesn't show up noticeably in a GPU profile.
Prior to Marshmallow, onDrawForeground is not available, so we have to override draw instead in order to be able to paint over the content drawn by the ScrollView's descendants. This means that e.g. scrollbars would be faded out as well, but as we don't intend on showing a scrollbar within the context of this bug, it is an acceptable compromise.
MozReview-Commit-ID: DCDPt6ogs0h
Our new animated progress bar follows the logic to hide itself:
1. When its progress value reaches 100, it disappears gracefully(with animation), otherwise,
2. It just disappears directly.
To make sure the progress bar always looked like fully loaded, we have to set its progress value to 100 before hiding it.
MozReview-Commit-ID: JSYEPYEhG4A
Unlike the previous changeset, we don't strip common subdomains because
"m.youtube.com" and "www.mozilla.org" can be informative and don't look bad
when you have a tld.
MozReview-Commit-ID: BOPH73pzAfh
Exception handling upstream is already in place, and will ensure that we degrade gracefully.
Push won't work, but we won't crash either.
MozReview-Commit-ID: EfDNoJu46zg