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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java

Issue 1859373002: Add a one-time notice about other forms of browsing history. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Static inner classes. Created 4 years, 8 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/preferences/privacy/ClearBrowsingDataPreferences.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java
index 138850528e849021be56a42698744cfef6088bea..009c32111a052ee82010f27d47236bf2242826fc 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java
@@ -274,14 +274,30 @@ public class ClearBrowsingDataPreferences extends PreferenceFragment
option.getDataType());
}
- // Called when "clear browsing data" completes.
- // Implements the ChromePreferences.OnClearBrowsingDataListener interface.
+ private OtherFormsOfHistoryDialogFragment mDialogAboutOtherFormsOfBrowsingHistory;
+ private boolean mDialogAboutOtherFormsOfBrowsingHistoryEnabled;
gone 2016/04/07 21:05:26 Group these new member fields with the other ones
msramek 2016/04/08 11:20:42 Done.
+
+ /**
+ * Called when clearing browsing data completes.
+ * Implements the ChromePreferences.OnClearBrowsingDataListener interface.
+ */
@Override
public void onBrowsingDataCleared() {
if (getActivity() == null) return;
- dismissProgressDialog();
- getActivity().finish();
+ // If the user deleted their browsing history, the dialog about other forms of history
+ // is enabled, and it has never been shown before, show it. Otherwise, just close this
+ // preference screen.
+ if (getSelectedOptions().contains(DialogOption.CLEAR_HISTORY)
+ && mDialogAboutOtherFormsOfBrowsingHistoryEnabled
+ && !OtherFormsOfHistoryDialogFragment.wasDialogShown(getActivity())) {
+ mDialogAboutOtherFormsOfBrowsingHistory =
+ OtherFormsOfHistoryDialogFragment.show(getActivity());
+ dismissProgressDialog();
+ } else {
+ dismissProgressDialog();
+ getActivity().finish();
+ }
}
@Override
@@ -455,4 +471,22 @@ public class ClearBrowsingDataPreferences extends PreferenceFragment
google_summary.setSummary(
R.string.clear_browsing_data_footnote_signed_and_other_forms_of_history);
}
+
+ /**
+ * Enables the dialog about other forms of browsing history that will be shown to the user
+ * after deleting their Chrome history. To be called by the web history service when the
+ * conditions for showing the dialog are met.
+ */
+ @VisibleForTesting
+ public void enableDialogAboutOtherFormsOfBrowsingHistory() {
gone 2016/04/07 21:05:26 ...BrowsingHistoryForTests() to make it explicit.
msramek 2016/04/08 11:20:42 They are currently used only in tests, because the
+ mDialogAboutOtherFormsOfBrowsingHistoryEnabled = true;
gone 2016/04/07 21:05:26 mIsDialogAboutOtherFormsOfBrowsingHistoryEnabled?
msramek 2016/04/08 11:20:42 Done.
+ }
+
+ /**
+ * Used only to access the dialog about other forms of browsing history from tests.
+ */
+ @VisibleForTesting
+ OtherFormsOfHistoryDialogFragment getDialogAboutOtherFormsOfBrowsingHistory() {
gone 2016/04/07 21:05:26 ...BrowsingHistoryForTests()
msramek 2016/04/08 11:20:42 Ditto as above.
+ return mDialogAboutOtherFormsOfBrowsingHistory;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698