Dan Ballard pushed to branch firefox-android-115.2.1-13.0-1 at The Tor Project / Applications / firefox-android
Commits:
-
8456bbb8
by clairehurst at 2023-09-21T16:13:32+00:00
13 changed files:
- android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/cookiebanners/GeckoCookieBannersStorage.kt
- android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/cookiebanners/ReportSiteDomainsRepository.kt
- android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/cookiehandling/CookieBannersStorage.kt
- fenix/app/metrics.yaml
- fenix/app/pings.yaml
- fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt
- fenix/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/ProtectionsView.kt
- fenix/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/CookieBannerDetailsController.kt
- fenix/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/CookieBannerDetailsInteractor.kt
- fenix/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/CookieBannerHandlingDetailsView.kt
- fenix/app/src/main/java/org/mozilla/fenix/settings/quicksettings/protections/cookiebanners/CookieBannersStorageExt.kt
- fenix/app/src/main/java/org/mozilla/fenix/trackingprotection/ProtectionsStore.kt
- fenix/app/src/main/res/layout/component_cookie_banner_details_panel.xml
Changes:
| ... | ... | @@ -21,7 +21,7 @@ import org.mozilla.geckoview.StorageController |
| 21 | 21 | */
|
| 22 | 22 | class GeckoCookieBannersStorage(
|
| 23 | 23 | runtime: GeckoRuntime,
|
| 24 | - private val reportSiteDomainsRepository: ReportSiteDomainsRepository,
|
|
| 24 | +// private val reportSiteDomainsRepository: ReportSiteDomainsRepository,
|
|
| 25 | 25 | ) : CookieBannersStorage {
|
| 26 | 26 | |
| 27 | 27 | private val geckoStorage: StorageController = runtime.storageController
|
| ... | ... | @@ -34,13 +34,13 @@ class GeckoCookieBannersStorage( |
| 34 | 34 | setGeckoException(uri, DISABLED, privateBrowsing)
|
| 35 | 35 | }
|
| 36 | 36 | |
| 37 | - override suspend fun isSiteDomainReported(siteDomain: String): Boolean {
|
|
| 38 | - return reportSiteDomainsRepository.isSiteDomainReported(siteDomain)
|
|
| 39 | - }
|
|
| 40 | - |
|
| 41 | - override suspend fun saveSiteDomain(siteDomain: String) {
|
|
| 42 | - reportSiteDomainsRepository.saveSiteDomain(siteDomain)
|
|
| 43 | - }
|
|
| 37 | +// override suspend fun isSiteDomainReported(siteDomain: String): Boolean {
|
|
| 38 | +// return reportSiteDomainsRepository.isSiteDomainReported(siteDomain)
|
|
| 39 | +// }
|
|
| 40 | +//
|
|
| 41 | +// override suspend fun saveSiteDomain(siteDomain: String) {
|
|
| 42 | +// reportSiteDomainsRepository.saveSiteDomain(siteDomain)
|
|
| 43 | +// }
|
|
| 44 | 44 | |
| 45 | 45 | override suspend fun addPersistentExceptionInPrivateMode(uri: String) {
|
| 46 | 46 | setPersistentPrivateGeckoException(uri, DISABLED)
|
| ... | ... | @@ -12,64 +12,64 @@ import androidx.datastore.preferences.core.stringPreferencesKey |
| 12 | 12 | import kotlinx.coroutines.flow.catch
|
| 13 | 13 | import kotlinx.coroutines.flow.first
|
| 14 | 14 | import kotlinx.coroutines.flow.map
|
| 15 | -import mozilla.components.browser.engine.gecko.cookiebanners.ReportSiteDomainsRepository.PreferencesKeys.REPORT_SITE_DOMAINS
|
|
| 15 | +//import mozilla.components.browser.engine.gecko.cookiebanners.ReportSiteDomainsRepository.PreferencesKeys.REPORT_SITE_DOMAINS
|
|
| 16 | 16 | import mozilla.components.support.base.log.logger.Logger
|
| 17 | 17 | import java.io.IOException
|
| 18 | 18 | |
| 19 | 19 | /**
|
| 20 | 20 | * A repository to save reported site domains with the datastore API.
|
| 21 | 21 | */
|
| 22 | -class ReportSiteDomainsRepository(
|
|
| 23 | - private val dataStore: DataStore<Preferences>,
|
|
| 24 | -) {
|
|
| 25 | - |
|
| 26 | - companion object {
|
|
| 27 | - const val SEPARATOR = "@<;>@"
|
|
| 28 | - const val REPORT_SITE_DOMAINS_REPOSITORY_NAME = "report_site_domains_preferences"
|
|
| 29 | - const val PREFERENCE_KEY_NAME = "report_site_domains"
|
|
| 30 | - }
|
|
| 31 | - |
|
| 32 | - private object PreferencesKeys {
|
|
| 33 | - val REPORT_SITE_DOMAINS = stringPreferencesKey(PREFERENCE_KEY_NAME)
|
|
| 34 | - }
|
|
| 35 | - |
|
| 36 | - /**
|
|
| 37 | - * Check if the given site's domain url is saved locally.
|
|
| 38 | - * @param siteDomain the [siteDomain] that will be checked.
|
|
| 39 | - */
|
|
| 40 | - suspend fun isSiteDomainReported(siteDomain: String): Boolean {
|
|
| 41 | - return dataStore.data
|
|
| 42 | - .catch { exception ->
|
|
| 43 | - if (exception is IOException) {
|
|
| 44 | - Logger.error("Error reading preferences.", exception)
|
|
| 45 | - emit(emptyPreferences())
|
|
| 46 | - } else {
|
|
| 47 | - throw exception
|
|
| 48 | - }
|
|
| 49 | - }.map { preferences ->
|
|
| 50 | - val reportSiteDomainsString = preferences[REPORT_SITE_DOMAINS] ?: ""
|
|
| 51 | - val reportSiteDomainsList =
|
|
| 52 | - reportSiteDomainsString.split(SEPARATOR).filter { it.isNotEmpty() }
|
|
| 53 | - reportSiteDomainsList.contains(siteDomain)
|
|
| 54 | - }.first()
|
|
| 55 | - }
|
|
| 56 | - |
|
| 57 | - /**
|
|
| 58 | - * Save the given site's domain url in datastore to keep it persistent locally.
|
|
| 59 | - * This method gets called after the site domain was reported with Nimbus.
|
|
| 60 | - * @param siteDomain the [siteDomain] that will be saved.
|
|
| 61 | - */
|
|
| 62 | - suspend fun saveSiteDomain(siteDomain: String) {
|
|
| 63 | - dataStore.edit { preferences ->
|
|
| 64 | - val siteDomainsPreferences = preferences[REPORT_SITE_DOMAINS] ?: ""
|
|
| 65 | - val siteDomainsList = siteDomainsPreferences.split(SEPARATOR).filter { it.isNotEmpty() }
|
|
| 66 | - if (siteDomainsList.contains(siteDomain)) {
|
|
| 67 | - return@edit
|
|
| 68 | - }
|
|
| 69 | - val domains = mutableListOf<String>()
|
|
| 70 | - domains.addAll(siteDomainsList)
|
|
| 71 | - domains.add(siteDomain)
|
|
| 72 | - preferences[REPORT_SITE_DOMAINS] = domains.joinToString(SEPARATOR)
|
|
| 73 | - }
|
|
| 74 | - }
|
|
| 75 | -} |
|
| 22 | +//class ReportSiteDomainsRepository(
|
|
| 23 | +// private val dataStore: DataStore<Preferences>,
|
|
| 24 | +//) {
|
|
| 25 | +//
|
|
| 26 | +// companion object {
|
|
| 27 | +// const val SEPARATOR = "@<;>@"
|
|
| 28 | +// const val REPORT_SITE_DOMAINS_REPOSITORY_NAME = "report_site_domains_preferences"
|
|
| 29 | +// const val PREFERENCE_KEY_NAME = "report_site_domains"
|
|
| 30 | +// }
|
|
| 31 | +//
|
|
| 32 | +// private object PreferencesKeys {
|
|
| 33 | +// val REPORT_SITE_DOMAINS = stringPreferencesKey(PREFERENCE_KEY_NAME)
|
|
| 34 | +// }
|
|
| 35 | +//
|
|
| 36 | +// /**
|
|
| 37 | +// * Check if the given site's domain url is saved locally.
|
|
| 38 | +// * @param siteDomain the [siteDomain] that will be checked.
|
|
| 39 | +// */
|
|
| 40 | +// suspend fun isSiteDomainReported(siteDomain: String): Boolean {
|
|
| 41 | +// return dataStore.data
|
|
| 42 | +// .catch { exception ->
|
|
| 43 | +// if (exception is IOException) {
|
|
| 44 | +// Logger.error("Error reading preferences.", exception)
|
|
| 45 | +// emit(emptyPreferences())
|
|
| 46 | +// } else {
|
|
| 47 | +// throw exception
|
|
| 48 | +// }
|
|
| 49 | +// }.map { preferences ->
|
|
| 50 | +// val reportSiteDomainsString = preferences[REPORT_SITE_DOMAINS] ?: ""
|
|
| 51 | +// val reportSiteDomainsList =
|
|
| 52 | +// reportSiteDomainsString.split(SEPARATOR).filter { it.isNotEmpty() }
|
|
| 53 | +// reportSiteDomainsList.contains(siteDomain)
|
|
| 54 | +// }.first()
|
|
| 55 | +// }
|
|
| 56 | +//
|
|
| 57 | +// /**
|
|
| 58 | +// * Save the given site's domain url in datastore to keep it persistent locally.
|
|
| 59 | +// * This method gets called after the site domain was reported with Nimbus.
|
|
| 60 | +// * @param siteDomain the [siteDomain] that will be saved.
|
|
| 61 | +// */
|
|
| 62 | +// suspend fun saveSiteDomain(siteDomain: String) {
|
|
| 63 | +// dataStore.edit { preferences ->
|
|
| 64 | +// val siteDomainsPreferences = preferences[REPORT_SITE_DOMAINS] ?: ""
|
|
| 65 | +// val siteDomainsList = siteDomainsPreferences.split(SEPARATOR).filter { it.isNotEmpty() }
|
|
| 66 | +// if (siteDomainsList.contains(siteDomain)) {
|
|
| 67 | +// return@edit
|
|
| 68 | +// }
|
|
| 69 | +// val domains = mutableListOf<String>()
|
|
| 70 | +// domains.addAll(siteDomainsList)
|
|
| 71 | +// domains.add(siteDomain)
|
|
| 72 | +// preferences[REPORT_SITE_DOMAINS] = domains.joinToString(SEPARATOR)
|
|
| 73 | +// }
|
|
| 74 | +// }
|
|
| 75 | +//} |
| ... | ... | @@ -24,14 +24,14 @@ interface CookieBannersStorage { |
| 24 | 24 | * Check if the given site's domain url is saved locally.
|
| 25 | 25 | * @param siteDomain the [siteDomain] that will be checked.
|
| 26 | 26 | */
|
| 27 | - suspend fun isSiteDomainReported(siteDomain: String): Boolean
|
|
| 27 | +// suspend fun isSiteDomainReported(siteDomain: String): Boolean
|
|
| 28 | 28 | |
| 29 | 29 | /**
|
| 30 | 30 | * Save the given site's domain url in datastore to keep it persistent locally.
|
| 31 | 31 | * This method gets called after the site domain was reported with Nimbus.
|
| 32 | 32 | * @param siteDomain the [siteDomain] that will be saved.
|
| 33 | 33 | */
|
| 34 | - suspend fun saveSiteDomain(siteDomain: String)
|
|
| 34 | +// suspend fun saveSiteDomain(siteDomain: String)
|
|
| 35 | 35 | |
| 36 | 36 | /**
|
| 37 | 37 | * Set persistently the [CookieBannerHandlingMode.DISABLED] mode for the given [uri] in
|
| ... | ... | @@ -7738,62 +7738,62 @@ cookie_banners: |
| 7738 | 7738 | metadata:
|
| 7739 | 7739 | tags:
|
| 7740 | 7740 | - Privacy&Security
|
| 7741 | - report_site_domain:
|
|
| 7742 | - type: url
|
|
| 7743 | - description: |
|
|
| 7744 | - A user can report a site domain(Ex. for https://edition.cnn.com/
|
|
| 7745 | - site domain will be cnn.com) when the cookie banner reducer is not
|
|
| 7746 | - working from the cookie banner details panel.
|
|
| 7747 | - lifetime: ping
|
|
| 7748 | - send_in_pings:
|
|
| 7749 | - - cookie-banner-report-site
|
|
| 7750 | - bugs:
|
|
| 7751 | - - https://bugzilla.mozilla.org/show_bug.cgi?id=1805450
|
|
| 7752 | - data_reviews:
|
|
| 7753 | - - https://github.com/mozilla-mobile/firefox-android/pull/1298#pullrequestreview-1350344223
|
|
| 7754 | - data_sensitivity:
|
|
| 7755 | - - technical
|
|
| 7756 | - - interaction
|
|
| 7757 | - notification_emails:
|
|
| 7758 | - - android-probes@xxxxxxxxxxx
|
|
| 7759 | - expires: 119
|
|
| 7760 | - metadata:
|
|
| 7761 | - tags:
|
|
| 7762 | - - Privacy&Security
|
|
| 7763 | - report_site_cancel_button:
|
|
| 7764 | - type: event
|
|
| 7765 | - description: |
|
|
| 7766 | - The user has pressed the report site domain cancel button
|
|
| 7767 | - from the cookie banner reducer details panel.
|
|
| 7768 | - bugs:
|
|
| 7769 | - - https://bugzilla.mozilla.org/show_bug.cgi?id=1805450
|
|
| 7770 | - data_reviews:
|
|
| 7771 | - - https://github.com/mozilla-mobile/firefox-android/pull/1298#pullrequestreview-1350344223
|
|
| 7772 | - data_sensitivity:
|
|
| 7773 | - - interaction
|
|
| 7774 | - notification_emails:
|
|
| 7775 | - - android-probes@xxxxxxxxxxx
|
|
| 7776 | - expires: 119
|
|
| 7777 | - metadata:
|
|
| 7778 | - tags:
|
|
| 7779 | - - Privacy&Security
|
|
| 7780 | - report_domain_site_button:
|
|
| 7781 | - type: event
|
|
| 7782 | - description: |
|
|
| 7783 | - The user has pressed the report site domain button
|
|
| 7784 | - from the cookie banner reducer details panel.
|
|
| 7785 | - bugs:
|
|
| 7786 | - - https://bugzilla.mozilla.org/show_bug.cgi?id=1805450
|
|
| 7787 | - data_reviews:
|
|
| 7788 | - - https://github.com/mozilla-mobile/firefox-android/pull/1298#pullrequestreview-1350344223
|
|
| 7789 | - data_sensitivity:
|
|
| 7790 | - - interaction
|
|
| 7791 | - notification_emails:
|
|
| 7792 | - - android-probes@xxxxxxxxxxx
|
|
| 7793 | - expires: 119
|
|
| 7794 | - metadata:
|
|
| 7795 | - tags:
|
|
| 7796 | - - Privacy&Security
|
|
| 7741 | +# report_site_domain:
|
|
| 7742 | +# type: url
|
|
| 7743 | +# description: |
|
|
| 7744 | +# A user can report a site domain(Ex. for https://edition.cnn.com/
|
|
| 7745 | +# site domain will be cnn.com) when the cookie banner reducer is not
|
|
| 7746 | +# working from the cookie banner details panel.
|
|
| 7747 | +# lifetime: ping
|
|
| 7748 | +# send_in_pings:
|
|
| 7749 | +# - cookie-banner-report-site
|
|
| 7750 | +# bugs:
|
|
| 7751 | +# - https://bugzilla.mozilla.org/show_bug.cgi?id=1805450
|
|
| 7752 | +# data_reviews:
|
|
| 7753 | +# - https://github.com/mozilla-mobile/firefox-android/pull/1298#pullrequestreview-1350344223
|
|
| 7754 | +# data_sensitivity:
|
|
| 7755 | +# - technical
|
|
| 7756 | +# - interaction
|
|
| 7757 | +# notification_emails:
|
|
| 7758 | +# - android-probes@xxxxxxxxxxx
|
|
| 7759 | +# expires: 119
|
|
| 7760 | +# metadata:
|
|
| 7761 | +# tags:
|
|
| 7762 | +# - Privacy&Security
|
|
| 7763 | +# report_site_cancel_button:
|
|
| 7764 | +# type: event
|
|
| 7765 | +# description: |
|
|
| 7766 | +# The user has pressed the report site domain cancel button
|
|
| 7767 | +# from the cookie banner reducer details panel.
|
|
| 7768 | +# bugs:
|
|
| 7769 | +# - https://bugzilla.mozilla.org/show_bug.cgi?id=1805450
|
|
| 7770 | +# data_reviews:
|
|
| 7771 | +# - https://github.com/mozilla-mobile/firefox-android/pull/1298#pullrequestreview-1350344223
|
|
| 7772 | +# data_sensitivity:
|
|
| 7773 | +# - interaction
|
|
| 7774 | +# notification_emails:
|
|
| 7775 | +# - android-probes@xxxxxxxxxxx
|
|
| 7776 | +# expires: 119
|
|
| 7777 | +# metadata:
|
|
| 7778 | +# tags:
|
|
| 7779 | +# - Privacy&Security
|
|
| 7780 | +# report_domain_site_button:
|
|
| 7781 | +# type: event
|
|
| 7782 | +# description: |
|
|
| 7783 | +# The user has pressed the report site domain button
|
|
| 7784 | +# from the cookie banner reducer details panel.
|
|
| 7785 | +# bugs:
|
|
| 7786 | +# - https://bugzilla.mozilla.org/show_bug.cgi?id=1805450
|
|
| 7787 | +# data_reviews:
|
|
| 7788 | +# - https://github.com/mozilla-mobile/firefox-android/pull/1298#pullrequestreview-1350344223
|
|
| 7789 | +# data_sensitivity:
|
|
| 7790 | +# - interaction
|
|
| 7791 | +# notification_emails:
|
|
| 7792 | +# - android-probes@xxxxxxxxxxx
|
|
| 7793 | +# expires: 119
|
|
| 7794 | +# metadata:
|
|
| 7795 | +# tags:
|
|
| 7796 | +# - Privacy&Security
|
|
| 7797 | 7797 | |
| 7798 | 7798 | site_permissions:
|
| 7799 | 7799 | prompt_shown:
|
| ... | ... | @@ -65,15 +65,15 @@ spoc: |
| 65 | 65 | notification_emails:
|
| 66 | 66 | - android-probes@xxxxxxxxxxx
|
| 67 | 67 | |
| 68 | -cookie-banner-report-site:
|
|
| 69 | - description: |
|
|
| 70 | - This ping is needed when the cookie banner reducer doesn't work on
|
|
| 71 | - a website, and the user wants to report the site.
|
|
| 72 | - This ping doesn't include a client id.
|
|
| 73 | - include_client_id: false
|
|
| 74 | - bugs:
|
|
| 75 | - - https://bugzilla.mozilla.org/show_bug.cgi?id=1805450
|
|
| 76 | - data_reviews:
|
|
| 77 | - - https://github.com/mozilla-mobile/firefox-android/pull/1298#pullrequestreview-1350344223
|
|
| 78 | - notification_emails:
|
|
| 79 | - - android-probes@xxxxxxxxxxx |
|
| 68 | +#cookie-banner-report-site:
|
|
| 69 | +# description: |
|
|
| 70 | +# This ping is needed when the cookie banner reducer doesn't work on
|
|
| 71 | +# a website, and the user wants to report the site.
|
|
| 72 | +# This ping doesn't include a client id.
|
|
| 73 | +# include_client_id: false
|
|
| 74 | +# bugs:
|
|
| 75 | +# - https://bugzilla.mozilla.org/show_bug.cgi?id=1805450
|
|
| 76 | +# data_reviews:
|
|
| 77 | +# - https://github.com/mozilla-mobile/firefox-android/pull/1298#pullrequestreview-1350344223
|
|
| 78 | +# notification_emails:
|
|
| 79 | +# - android-probes@xxxxxxxxxxx |
| ... | ... | @@ -16,7 +16,7 @@ import mozilla.components.browser.domains.autocomplete.BaseDomainAutocompletePro |
| 16 | 16 | import mozilla.components.browser.domains.autocomplete.ShippedDomainsProvider
|
| 17 | 17 | import mozilla.components.browser.engine.gecko.GeckoEngine
|
| 18 | 18 | import mozilla.components.browser.engine.gecko.cookiebanners.GeckoCookieBannersStorage
|
| 19 | -import mozilla.components.browser.engine.gecko.cookiebanners.ReportSiteDomainsRepository
|
|
| 19 | +//import mozilla.components.browser.engine.gecko.cookiebanners.ReportSiteDomainsRepository
|
|
| 20 | 20 | import mozilla.components.browser.engine.gecko.fetch.GeckoViewFetchClient
|
| 21 | 21 | import mozilla.components.browser.engine.gecko.permission.GeckoSitePermissionsStorage
|
| 22 | 22 | import mozilla.components.browser.icons.BrowserIcons
|
| ... | ... | @@ -197,14 +197,14 @@ class Core( |
| 197 | 197 | )
|
| 198 | 198 | }
|
| 199 | 199 | |
| 200 | - private val Context.dataStore by preferencesDataStore(
|
|
| 201 | - name = ReportSiteDomainsRepository.REPORT_SITE_DOMAINS_REPOSITORY_NAME,
|
|
| 202 | - )
|
|
| 200 | +// private val Context.dataStore by preferencesDataStore(
|
|
| 201 | +// name = ReportSiteDomainsRepository.REPORT_SITE_DOMAINS_REPOSITORY_NAME,
|
|
| 202 | +// )
|
|
| 203 | 203 | |
| 204 | 204 | val cookieBannersStorage by lazyMonitored {
|
| 205 | 205 | GeckoCookieBannersStorage(
|
| 206 | 206 | geckoRuntime,
|
| 207 | - ReportSiteDomainsRepository(context.dataStore),
|
|
| 207 | +// ReportSiteDomainsRepository(context.dataStore),
|
|
| 208 | 208 | )
|
| 209 | 209 | }
|
| 210 | 210 |
| ... | ... | @@ -94,7 +94,7 @@ class ProtectionsView( |
| 94 | 94 | binding.cookieBannerItem.apply {
|
| 95 | 95 | setContent {
|
| 96 | 96 | FirefoxTheme {
|
| 97 | - if (cookieBannerMode == CookieBannerUIMode.REQUEST_UNSUPPORTED_SITE_SUBMITTED) {
|
|
| 97 | + if (cookieBannerMode == CookieBannerUIMode.SITE_NOT_SUPPORTED) {
|
|
| 98 | 98 | CookieBannerItem(
|
| 99 | 99 | label = label,
|
| 100 | 100 | cookieBannerUIMode = cookieBannerMode,
|
| ... | ... | @@ -55,7 +55,7 @@ interface CookieBannerDetailsController { |
| 55 | 55 | /**
|
| 56 | 56 | * @see [CookieBannerDetailsInteractor.handleRequestSiteSupportPressed]
|
| 57 | 57 | */
|
| 58 | - fun handleRequestSiteSupportPressed()
|
|
| 58 | +// fun handleRequestSiteSupportPressed()
|
|
| 59 | 59 | }
|
| 60 | 60 | |
| 61 | 61 | /**
|
| ... | ... | @@ -144,37 +144,37 @@ class DefaultCookieBannerDetailsController( |
| 144 | 144 | }
|
| 145 | 145 | }
|
| 146 | 146 | |
| 147 | - override fun handleRequestSiteSupportPressed() {
|
|
| 148 | - val tab = requireNotNull(browserStore.state.findTabOrCustomTab(sessionId)) {
|
|
| 149 | - "A session is required to report site domain"
|
|
| 150 | - }
|
|
| 151 | - CookieBanners.reportDomainSiteButton.record(NoExtras())
|
|
| 152 | - ioScope.launch {
|
|
| 153 | - val siteDomain = getTabDomain(tab)
|
|
| 154 | - siteDomain?.let { domain ->
|
|
| 155 | - withContext(Dispatchers.Main) {
|
|
| 156 | - protectionsStore.dispatch(ProtectionsAction.RequestReportSiteDomain(domain))
|
|
| 157 | - CookieBanners.reportSiteDomain.set(domain)
|
|
| 158 | - Pings.cookieBannerReportSite.submit()
|
|
| 159 | - protectionsStore.dispatch(
|
|
| 160 | - ProtectionsAction.UpdateCookieBannerMode(
|
|
| 161 | - cookieBannerUIMode = CookieBannerUIMode.REQUEST_UNSUPPORTED_SITE_SUBMITTED,
|
|
| 162 | - ),
|
|
| 163 | - )
|
|
| 164 | - fragment.activity?.getRootView()?.let { view ->
|
|
| 165 | - showSnackBar(
|
|
| 166 | - view,
|
|
| 167 | - context.getString(R.string.cookie_banner_handling_report_site_snack_bar_text_2),
|
|
| 168 | - FenixSnackbar.LENGTH_LONG,
|
|
| 169 | - )
|
|
| 170 | - }
|
|
| 171 | - withContext(Dispatchers.IO) {
|
|
| 172 | - cookieBannersStorage.saveSiteDomain(domain)
|
|
| 173 | - }
|
|
| 174 | - }
|
|
| 175 | - }
|
|
| 176 | - }
|
|
| 177 | - }
|
|
| 147 | +// override fun handleRequestSiteSupportPressed() {
|
|
| 148 | +// val tab = requireNotNull(browserStore.state.findTabOrCustomTab(sessionId)) {
|
|
| 149 | +// "A session is required to report site domain"
|
|
| 150 | +// }
|
|
| 151 | +// CookieBanners.reportDomainSiteButton.record(NoExtras())
|
|
| 152 | +// ioScope.launch {
|
|
| 153 | +// val siteDomain = getTabDomain(tab)
|
|
| 154 | +// siteDomain?.let { domain ->
|
|
| 155 | +// withContext(Dispatchers.Main) {
|
|
| 156 | +// protectionsStore.dispatch(ProtectionsAction.RequestReportSiteDomain(domain))
|
|
| 157 | +// CookieBanners.reportSiteDomain.set(domain)
|
|
| 158 | +// Pings.cookieBannerReportSite.submit()
|
|
| 159 | +// protectionsStore.dispatch(
|
|
| 160 | +// ProtectionsAction.UpdateCookieBannerMode(
|
|
| 161 | +// cookieBannerUIMode = CookieBannerUIMode.REQUEST_UNSUPPORTED_SITE_SUBMITTED,
|
|
| 162 | +// ),
|
|
| 163 | +// )
|
|
| 164 | +// fragment.activity?.getRootView()?.let { view ->
|
|
| 165 | +// showSnackBar(
|
|
| 166 | +// view,
|
|
| 167 | +// context.getString(R.string.cookie_banner_handling_report_site_snack_bar_text_2),
|
|
| 168 | +// FenixSnackbar.LENGTH_LONG,
|
|
| 169 | +// )
|
|
| 170 | +// }
|
|
| 171 | +// withContext(Dispatchers.IO) {
|
|
| 172 | +// cookieBannersStorage.saveSiteDomain(domain)
|
|
| 173 | +// }
|
|
| 174 | +// }
|
|
| 175 | +// }
|
|
| 176 | +// }
|
|
| 177 | +// }
|
|
| 178 | 178 | |
| 179 | 179 | @VisibleForTesting
|
| 180 | 180 | internal suspend fun clearSiteData(tab: SessionState) {
|
| ... | ... | @@ -21,7 +21,7 @@ interface CookieBannerDetailsInteractor { |
| 21 | 21 | /**
|
| 22 | 22 | * Called whenever the user press request support site domain.
|
| 23 | 23 | */
|
| 24 | - fun handleRequestSiteSupportPressed()
|
|
| 24 | +// fun handleRequestSiteSupportPressed()
|
|
| 25 | 25 | }
|
| 26 | 26 | |
| 27 | 27 | /**
|
| ... | ... | @@ -45,7 +45,7 @@ class DefaultCookieBannerDetailsInteractor( |
| 45 | 45 | controller.handleTogglePressed(vale)
|
| 46 | 46 | }
|
| 47 | 47 | |
| 48 | - override fun handleRequestSiteSupportPressed() {
|
|
| 49 | - controller.handleRequestSiteSupportPressed()
|
|
| 50 | - }
|
|
| 48 | +// override fun handleRequestSiteSupportPressed() {
|
|
| 49 | +// controller.handleRequestSiteSupportPressed()
|
|
| 50 | +// }
|
|
| 51 | 51 | } |
| ... | ... | @@ -57,7 +57,7 @@ class CookieBannerHandlingDetailsView( |
| 57 | 57 | when (state.cookieBannerUIMode) {
|
| 58 | 58 | CookieBannerUIMode.ENABLE -> setUiForExceptionMode(state)
|
| 59 | 59 | CookieBannerUIMode.DISABLE -> setUiForExceptionMode(state)
|
| 60 | - CookieBannerUIMode.SITE_NOT_SUPPORTED -> setUiForReportSiteMode()
|
|
| 60 | +// CookieBannerUIMode.SITE_NOT_SUPPORTED -> setUiForReportSiteMode()
|
|
| 61 | 61 | else -> {}
|
| 62 | 62 | }
|
| 63 | 63 | }
|
| ... | ... | @@ -67,19 +67,19 @@ class CookieBannerHandlingDetailsView( |
| 67 | 67 | bindSwitch(state.cookieBannerUIMode)
|
| 68 | 68 | }
|
| 69 | 69 | |
| 70 | - private fun setUiForReportSiteMode() {
|
|
| 71 | - binding.cancelButton.visibility = View.VISIBLE
|
|
| 72 | - binding.requestSupport.visibility = View.VISIBLE
|
|
| 73 | - binding.cookieBannerSwitch.visibility = View.GONE
|
|
| 74 | - binding.requestSupport.setOnClickListener {
|
|
| 75 | - interactor.handleRequestSiteSupportPressed()
|
|
| 76 | - onDismiss.invoke()
|
|
| 77 | - }
|
|
| 78 | - binding.cancelButton.setOnClickListener {
|
|
| 79 | - CookieBanners.reportSiteCancelButton.record(NoExtras())
|
|
| 80 | - interactor.onBackPressed()
|
|
| 81 | - }
|
|
| 82 | - }
|
|
| 70 | +// private fun setUiForReportSiteMode() {
|
|
| 71 | +// binding.cancelButton.visibility = View.VISIBLE
|
|
| 72 | +// binding.requestSupport.visibility = View.VISIBLE
|
|
| 73 | +// binding.cookieBannerSwitch.visibility = View.GONE
|
|
| 74 | +// binding.requestSupport.setOnClickListener {
|
|
| 75 | +// interactor.handleRequestSiteSupportPressed()
|
|
| 76 | +// onDismiss.invoke()
|
|
| 77 | +// }
|
|
| 78 | +// binding.cancelButton.setOnClickListener {
|
|
| 79 | +// CookieBanners.reportSiteCancelButton.record(NoExtras())
|
|
| 80 | +// interactor.onBackPressed()
|
|
| 81 | +// }
|
|
| 82 | +// }
|
|
| 83 | 83 | |
| 84 | 84 | @VisibleForTesting
|
| 85 | 85 | internal fun bindTitle(url: String, state: CookieBannerUIMode) {
|
| ... | ... | @@ -24,15 +24,15 @@ suspend fun CookieBannersStorage.getCookieBannerUIMode( |
| 24 | 24 | tab: SessionState,
|
| 25 | 25 | ): CookieBannerUIMode {
|
| 26 | 26 | return if (context.settings().shouldUseCookieBanner) {
|
| 27 | - val isSiteDomainReported = withContext(Dispatchers.IO) {
|
|
| 28 | - val host = tab.content.url.toUri().host.orEmpty()
|
|
| 29 | - val siteDomain = context.components.publicSuffixList.getPublicSuffixPlusOne(host).await()
|
|
| 30 | - siteDomain?.let { isSiteDomainReported(it) }
|
|
| 31 | - }
|
|
| 32 | - |
|
| 33 | - if (isSiteDomainReported == true) {
|
|
| 34 | - return CookieBannerUIMode.REQUEST_UNSUPPORTED_SITE_SUBMITTED
|
|
| 35 | - }
|
|
| 27 | +// val isSiteDomainReported = withContext(Dispatchers.IO) {
|
|
| 28 | +// val host = tab.content.url.toUri().host.orEmpty()
|
|
| 29 | +// val siteDomain = context.components.publicSuffixList.getPublicSuffixPlusOne(host).await()
|
|
| 30 | +// siteDomain?.let { isSiteDomainReported(it) }
|
|
| 31 | +// }
|
|
| 32 | +//
|
|
| 33 | +// if (isSiteDomainReported == true) {
|
|
| 34 | +// return CookieBannerUIMode.REQUEST_UNSUPPORTED_SITE_SUBMITTED
|
|
| 35 | +// }
|
|
| 36 | 36 | |
| 37 | 37 | val hasException = withContext(Dispatchers.IO) {
|
| 38 | 38 | hasException(tab.content.url, tab.content.private)
|
| ... | ... | @@ -52,9 +52,9 @@ sealed class ProtectionsAction : Action { |
| 52 | 52 | *
|
| 53 | 53 | * @param url to report.
|
| 54 | 54 | */
|
| 55 | - data class RequestReportSiteDomain(
|
|
| 56 | - val url: String,
|
|
| 57 | - ) : ProtectionsAction()
|
|
| 55 | +// data class RequestReportSiteDomain(
|
|
| 56 | +// val url: String,
|
|
| 57 | +// ) : ProtectionsAction()
|
|
| 58 | 58 | |
| 59 | 59 | /**
|
| 60 | 60 | * Indicates that cookie banner handling mode has been updated.
|
| ... | ... | @@ -167,10 +167,10 @@ enum class CookieBannerUIMode( |
| 167 | 167 | * REQUEST_UNSUPPORTED_SITE_SUBMITTED - The user submitted a request
|
| 168 | 168 | * for adding support for cookie banner handling for the domain.
|
| 169 | 169 | */
|
| 170 | - REQUEST_UNSUPPORTED_SITE_SUBMITTED(
|
|
| 171 | - R.string.reduce_cookie_banner_unsupported_site_request_submitted_2,
|
|
| 172 | - R.drawable.ic_cookies_disabled,
|
|
| 173 | - ),
|
|
| 170 | +// REQUEST_UNSUPPORTED_SITE_SUBMITTED(
|
|
| 171 | +// R.string.reduce_cookie_banner_unsupported_site_request_submitted_2,
|
|
| 172 | +// R.drawable.ic_cookies_disabled,
|
|
| 173 | +// ),
|
|
| 174 | 174 | |
| 175 | 175 | /**
|
| 176 | 176 | HIDE - All the cookie banner handling in the tracking panel is hidden.
|
| ... | ... | @@ -243,9 +243,9 @@ fun protectionsStateReducer( |
| 243 | 243 | is ProtectionsAction.ToggleCookieBannerHandlingProtectionEnabled -> state.copy(
|
| 244 | 244 | cookieBannerUIMode = action.cookieBannerUIMode,
|
| 245 | 245 | )
|
| 246 | - is ProtectionsAction.RequestReportSiteDomain -> state.copy(
|
|
| 247 | - url = action.url,
|
|
| 248 | - )
|
|
| 246 | +// is ProtectionsAction.RequestReportSiteDomain -> state.copy(
|
|
| 247 | +// url = "">
|
|
| 248 | +// )
|
|
| 249 | 249 | is ProtectionsAction.UpdateCookieBannerMode -> state.copy(
|
| 250 | 250 | cookieBannerUIMode = action.cookieBannerUIMode,
|
| 251 | 251 | )
|
| ... | ... | @@ -64,40 +64,40 @@ |
| 64 | 64 | app:switchShowIcon="false"
|
| 65 | 65 | app:switchTitle="@string/preferences_cookie_banner_reduction" />
|
| 66 | 66 | |
| 67 | - <androidx.appcompat.widget.AppCompatButton
|
|
| 68 | - android:id="@+id/cancel_button"
|
|
| 69 | - android:layout_width="wrap_content"
|
|
| 70 | - android:layout_height="wrap_content"
|
|
| 71 | - android:visibility="gone"
|
|
| 72 | - android:layout_marginTop="16dp"
|
|
| 73 | - android:background="">"@android:color/transparent"
|
|
| 74 | - android:gravity="center"
|
|
| 75 | - android:minHeight="48dp"
|
|
| 76 | - android:text="@string/cookie_banner_handling_details_site_is_not_supported_cancel_button"
|
|
| 77 | - android:layout_marginEnd="16dp"
|
|
| 78 | - android:textAllCaps="true"
|
|
| 79 | - android:textColor="@color/fx_mobile_text_color_accent"
|
|
| 80 | - android:textSize="14sp"
|
|
| 81 | - app:layout_constraintEnd_toEndOf="parent"
|
|
| 82 | - app:layout_constraintStart_toStartOf="parent"
|
|
| 83 | - app:layout_constraintTop_toBottomOf="@id/details" />
|
|
| 67 | +<!-- <androidx.appcompat.widget.AppCompatButton-->
|
|
| 68 | +<!-- android:id="@+id/cancel_button"-->
|
|
| 69 | +<!-- android:layout_width="wrap_content"-->
|
|
| 70 | +<!-- android:layout_height="wrap_content"-->
|
|
| 71 | +<!-- android:visibility="gone"-->
|
|
| 72 | +<!-- android:layout_marginTop="16dp"-->
|
|
| 73 | +<!-- android:background=""-->
|
|
| 74 | +<!-- android:gravity="center"-->
|
|
| 75 | +<!-- android:minHeight="48dp"-->
|
|
| 76 | +<!-- android:text="@string/cookie_banner_handling_details_site_is_not_supported_cancel_button"-->
|
|
| 77 | +<!-- android:layout_marginEnd="16dp"-->
|
|
| 78 | +<!-- android:textAllCaps="true"-->
|
|
| 79 | +<!-- android:textColor="@color/fx_mobile_text_color_accent"-->
|
|
| 80 | +<!-- android:textSize="14sp"-->
|
|
| 81 | +<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
|
| 82 | +<!-- app:layout_constraintStart_toStartOf="parent"-->
|
|
| 83 | +<!-- app:layout_constraintTop_toBottomOf="@id/details" />-->
|
|
| 84 | 84 | |
| 85 | - <androidx.appcompat.widget.AppCompatButton
|
|
| 86 | - android:id="@+id/request_support"
|
|
| 87 | - android:layout_width="wrap_content"
|
|
| 88 | - android:layout_height="wrap_content"
|
|
| 89 | - android:visibility="gone"
|
|
| 90 | - android:layout_marginTop="16dp"
|
|
| 91 | - android:background="">"@android:color/transparent"
|
|
| 92 | - android:gravity="center"
|
|
| 93 | - android:minHeight="48dp"
|
|
| 94 | - android:layout_marginEnd="16dp"
|
|
| 95 | - android:text="@string/cookie_banner_handling_details_site_is_not_supported_request_support_button_2"
|
|
| 96 | - android:textAllCaps="true"
|
|
| 97 | - android:textColor="@color/fx_mobile_text_color_accent"
|
|
| 98 | - android:textSize="14sp"
|
|
| 99 | - app:layout_constraintEnd_toEndOf="parent"
|
|
| 100 | - app:layout_constraintLeft_toLeftOf="parent"
|
|
| 101 | - app:layout_constraintStart_toEndOf="@+id/cancel_button"
|
|
| 102 | - app:layout_constraintTop_toBottomOf="@id/details" />
|
|
| 85 | +<!-- <androidx.appcompat.widget.AppCompatButton-->
|
|
| 86 | +<!-- android:id="@+id/request_support"-->
|
|
| 87 | +<!-- android:layout_width="wrap_content"-->
|
|
| 88 | +<!-- android:layout_height="wrap_content"-->
|
|
| 89 | +<!-- android:visibility="gone"-->
|
|
| 90 | +<!-- android:layout_marginTop="16dp"-->
|
|
| 91 | +<!-- android:background=""-->
|
|
| 92 | +<!-- android:gravity="center"-->
|
|
| 93 | +<!-- android:minHeight="48dp"-->
|
|
| 94 | +<!-- android:layout_marginEnd="16dp"-->
|
|
| 95 | +<!-- android:text="@string/cookie_banner_handling_details_site_is_not_supported_request_support_button_2"-->
|
|
| 96 | +<!-- android:textAllCaps="true"-->
|
|
| 97 | +<!-- android:textColor="@color/fx_mobile_text_color_accent"-->
|
|
| 98 | +<!-- android:textSize="14sp"-->
|
|
| 99 | +<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
|
| 100 | +<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
|
| 101 | +<!-- app:layout_constraintStart_toEndOf="@+id/cancel_button"-->
|
|
| 102 | +<!-- app:layout_constraintTop_toBottomOf="@id/details" />-->
|
|
| 103 | 103 | </androidx.constraintlayout.widget.ConstraintLayout> |