Skip to content

Commit

Permalink
Integrate privacy dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
CrisBarreiro committed Feb 4, 2025
1 parent 397271f commit 44269fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class PrivacyDashboardHybridViewModel @Inject constructor(
val protectionStatus: ProtectionStatusViewState,
val cookiePromptManagementStatus: CookiePromptManagementState,
val remoteFeatureSettings: RemoteFeatureSettingsViewState,
val maliciousSiteStatus: String? = null,
)

data class ProtectionStatusViewState(
Expand Down Expand Up @@ -289,6 +290,7 @@ class PrivacyDashboardHybridViewModel @Inject constructor(
protectionStatus = protectionStatusViewStateMapper.mapFromSite(site),
cookiePromptManagementStatus = autoconsentStatusViewStateMapper.mapFromSite(site),
remoteFeatureSettings = createRemoteFeatureSettings(),
maliciousSiteStatus = site.maliciousSiteStatus?.name?.lowercase(),
),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ class PrivacyDashboardRenderer(
val cookiePromptManagementStatusJson = cookiePromptManagementStatusAdapter.toJson(viewState.cookiePromptManagementStatus)
webView.evaluateJavascript("javascript:onChangeConsentManaged($cookiePromptManagementStatusJson);", null)

val maliciousStateJson = """{"kind": "${viewState.maliciousSiteStatus}"}"""
webView.evaluateJavascript("javascript:onChangeMaliciousSiteStatus($maliciousStateJson);", null)

// remote feature settings
val remoteFeatureSettingsAdapter = moshi.adapter(RemoteFeatureSettingsViewState::class.java)
val remoteFeatureSettingsJson = remoteFeatureSettingsAdapter.toJson(viewState.remoteFeatureSettings)
Expand Down

0 comments on commit 44269fd

Please sign in to comment.