Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java

Issue 2841193002: Implement privacy disclosure for an unbound webapk. (Closed)
Patch Set: nit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
index c8dae5ee46e1273bc391671faffb611ca713418c..d54dbf0ddfa043cdce632558730632fa75f2203e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
@@ -66,6 +66,9 @@ public class WebappDataStorage {
// The shell Apk version requested in the last update.
static final String KEY_LAST_REQUESTED_SHELL_APK_VERSION = "last_requested_shell_apk_version";
+ // Whether the user has dismissed the disclosure UI.
+ static final String KEY_DISMISSED_DISCLOSURE = "dismissed_dislosure";
+
// Number of milliseconds between checks for whether the WebAPK's Web Manifest has changed.
public static final long UPDATE_INTERVAL = TimeUnit.DAYS.toMillis(3L);
@@ -323,6 +326,7 @@ public class WebappDataStorage {
editor.remove(KEY_DID_LAST_UPDATE_REQUEST_SUCCEED);
editor.remove(KEY_UPDATE_REQUESTED);
editor.remove(KEY_RELAX_UPDATES);
+ editor.remove(KEY_DISMISSED_DISCLOSURE);
editor.apply();
}
@@ -420,6 +424,14 @@ public class WebappDataStorage {
return mPreferences.getBoolean(KEY_DID_LAST_UPDATE_REQUEST_SUCCEED, false);
}
+ void setDismissedDisclosure() {
+ mPreferences.edit().putBoolean(KEY_DISMISSED_DISCLOSURE, true).apply();
+ }
+
+ boolean hasDismissedDisclosure() {
+ return mPreferences.getBoolean(KEY_DISMISSED_DISCLOSURE, false);
+ }
+
/**
* Increases the number of times that update has been requested for the WebAPK by 1.
*/

Powered by Google App Engine
This is Rietveld 408576698