Bug 1651454 - Add strictSocialTrackingProtection to ContentBlocking.Settings.Builder and getStrictSocialTrackingProtection to ContentBlocking.Settings r=esawin,geckoview-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D82796
This commit is contained in:
Dylan Roeh 2020-07-14 16:38:18 +00:00
Родитель 94d53dfdef
Коммит 94d069f381
3 изменённых файлов: 33 добавлений и 1 удалений

Просмотреть файл

@ -347,6 +347,7 @@ package org.mozilla.geckoview {
method public int getCookieLifetime();
method public int getEnhancedTrackingProtectionLevel();
method public int getSafeBrowsingCategories();
method public boolean getStrictSocialTrackingProtection();
method @NonNull public ContentBlocking.Settings setAntiTracking(int);
method @NonNull public ContentBlocking.Settings setCookieBehavior(int);
method @NonNull public ContentBlocking.Settings setCookieLifetime(int);
@ -363,6 +364,7 @@ package org.mozilla.geckoview {
method @NonNull public ContentBlocking.Settings.Builder cookieLifetime(int);
method @NonNull public ContentBlocking.Settings.Builder enhancedTrackingProtectionLevel(int);
method @NonNull public ContentBlocking.Settings.Builder safeBrowsing(int);
method @NonNull public ContentBlocking.Settings.Builder strictSocialTrackingProtection(boolean);
method @NonNull protected ContentBlocking.Settings newSettings(@Nullable ContentBlocking.Settings);
}

Просмотреть файл

@ -99,6 +99,21 @@ public class ContentBlocking {
getSettings().setEnhancedTrackingProtectionLevel(level);
return this;
}
/**
* Set whether or not strict social tracking protection is enabled. This will block
* resources from loading if they are on the social tracking protection list, rather
* than just blocking cookies as with normal social tracking protection.
*
* @param enabled A boolean indicating whether or not strict social tracking protection
* should be enabled.
*
* @return The builder instance.
*/
public @NonNull Builder strictSocialTrackingProtection(final boolean enabled) {
getSettings().setStrictSocialTrackingProtection(enabled);
return this;
}
}
/* package */ final Pref<String> mAt = new Pref<String>(
@ -265,6 +280,16 @@ public class ContentBlocking {
return ContentBlocking.EtpLevel.NONE;
}
/**
* Get whether or not strict social tracking protection is enabled.
*
* @return A boolean indicating whether or not strict social tracking protection
* is enabled.
*/
public boolean getStrictSocialTrackingProtection() {
return mStStrict.get();
}
/**
* Get the set safe browsing categories.
*

Просмотреть файл

@ -16,6 +16,11 @@ exclude: true
## v80
- Removed `GeckoSession.hashCode` and `GeckoSession.equals` overrides in favor
of the default implementations. ([bug 1647883]({{bugzilla}}1647883))
- Added `strictSocialTrackingProtection` to [`ContentBlocking.Settings.Builder`][80.1] and `getStrictSocialTrackingProtection`
to [`ContentBlocking.Settings`][80.2].
[80.1]: {{javadoc_uri}}/ContentBlocking.Settings.Builder.html
[80.2]: {{javadoc_uri}}/ContentBlocking.Settings.html
## v79
- Added `runtime.openOptionsPage` support. For `options_ui.open_in_new_tab` ==
@ -747,4 +752,4 @@ to allow adding gecko profiler markers.
[65.24]: {{javadoc_uri}}/CrashReporter.html#sendCrashReport-android.content.Context-android.os.Bundle-java.lang.String-
[65.25]: {{javadoc_uri}}/GeckoResult.html
[api-version]: 41921b808dd64b6d85929aa7f52031cc762605f9
[api-version]: c86252550df86d5790603805a43ad5a313c20dc0