diff --git a/app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt b/app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt index bfbd6e26982e..8118b1449597 100644 --- a/app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt +++ b/app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt @@ -225,6 +225,7 @@ import com.duckduckgo.autofill.api.domain.app.LoginTriggerType import com.duckduckgo.autofill.api.emailprotection.EmailInjector import com.duckduckgo.browser.api.WebViewVersionProvider import com.duckduckgo.browser.api.brokensite.BrokenSiteData +import com.duckduckgo.browser.api.brokensite.BrokenSiteData.ReportFlow.PROMPT import com.duckduckgo.common.ui.DuckDuckGoFragment import com.duckduckgo.common.ui.store.BrowserAppTheme import com.duckduckgo.common.ui.view.DaxDialog @@ -272,6 +273,7 @@ import com.duckduckgo.navigation.api.GlobalActivityStarter import com.duckduckgo.navigation.api.GlobalActivityStarter.DeeplinkActivityParams import com.duckduckgo.privacy.dashboard.api.ui.PrivacyDashboardHybridScreenParams import com.duckduckgo.privacy.dashboard.api.ui.PrivacyDashboardHybridScreenParams.BrokenSiteForm +import com.duckduckgo.privacy.dashboard.api.ui.PrivacyDashboardHybridScreenParams.BrokenSiteForm.BrokenSiteFormReportFlow import com.duckduckgo.privacy.dashboard.api.ui.WebBrokenSiteForm import com.duckduckgo.privacyprotectionspopup.api.PrivacyProtectionsPopup import com.duckduckgo.privacyprotectionspopup.api.PrivacyProtectionsPopupFactory @@ -1906,7 +1908,11 @@ class BrowserTabFragment : val context = context ?: return if (webBrokenSiteForm.shouldUseWebBrokenSiteForm()) { - globalActivityStarter.startIntent(context, BrokenSiteForm(tabId)) + val reportFlow = when (data.reportFlow) { + PROMPT -> BrokenSiteFormReportFlow.PROMPT + else -> BrokenSiteFormReportFlow.MENU + } + globalActivityStarter.startIntent(context, BrokenSiteForm(tabId, reportFlow)) ?.let { startActivity(it) } } else { val options = ActivityOptions.makeSceneTransitionAnimation(browserActivity).toBundle() diff --git a/privacy-dashboard/privacy-dashboard-api/src/main/java/com/duckduckgo/privacy/dashboard/api/ui/PrivacyDashboardHybridScreenParams.kt b/privacy-dashboard/privacy-dashboard-api/src/main/java/com/duckduckgo/privacy/dashboard/api/ui/PrivacyDashboardHybridScreenParams.kt index dbfb8b105167..f559d2ba9341 100644 --- a/privacy-dashboard/privacy-dashboard-api/src/main/java/com/duckduckgo/privacy/dashboard/api/ui/PrivacyDashboardHybridScreenParams.kt +++ b/privacy-dashboard/privacy-dashboard-api/src/main/java/com/duckduckgo/privacy/dashboard/api/ui/PrivacyDashboardHybridScreenParams.kt @@ -32,5 +32,10 @@ sealed class PrivacyDashboardHybridScreenParams : GlobalActivityStarter.Activity * Use this parameter to launch the site breakage reporting form. * @param tabId The tab ID */ - data class BrokenSiteForm(override val tabId: String) : PrivacyDashboardHybridScreenParams() + data class BrokenSiteForm(override val tabId: String, val reportFlow: BrokenSiteFormReportFlow) : PrivacyDashboardHybridScreenParams() { + enum class BrokenSiteFormReportFlow { + MENU, + PROMPT, + } + } } diff --git a/privacy-dashboard/privacy-dashboard-impl/src/main/java/com/duckduckgo/privacy/dashboard/impl/ui/PrivacyDashboardHybridActivity.kt b/privacy-dashboard/privacy-dashboard-impl/src/main/java/com/duckduckgo/privacy/dashboard/impl/ui/PrivacyDashboardHybridActivity.kt index 966abd1e39d4..c9bc0a9859b2 100644 --- a/privacy-dashboard/privacy-dashboard-impl/src/main/java/com/duckduckgo/privacy/dashboard/impl/ui/PrivacyDashboardHybridActivity.kt +++ b/privacy-dashboard/privacy-dashboard-impl/src/main/java/com/duckduckgo/privacy/dashboard/impl/ui/PrivacyDashboardHybridActivity.kt @@ -96,7 +96,13 @@ class PrivacyDashboardHybridActivity : DuckDuckGoActivity() { onSubmitBrokenSiteReport = { payload -> val reportFlow = when (params) { is PrivacyDashboardPrimaryScreen, null -> ReportFlow.DASHBOARD - is BrokenSiteForm -> ReportFlow.MENU + is BrokenSiteForm -> { + if ((params as BrokenSiteForm).reportFlow == BrokenSiteForm.BrokenSiteFormReportFlow.MENU) { + ReportFlow.MENU + } else { + ReportFlow.PROMPT + } + } } viewModel.onSubmitBrokenSiteReport(payload, reportFlow) },