Chromium Code Reviews| 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 ebc8815a50ce1378021d89eaa7e2a7b25520b47b..621f527aeed6c7082c60de57ebe484a747fbe3df 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 |
| @@ -19,6 +19,7 @@ import org.chromium.chrome.browser.preferences.ButtonPreference; |
| import org.chromium.chrome.browser.preferences.ClearBrowsingDataCheckBoxPreference; |
| import org.chromium.chrome.browser.preferences.PrefServiceBridge; |
| import org.chromium.chrome.browser.preferences.SpinnerPreference; |
| +import org.chromium.chrome.browser.preferences.TextMessageWithLinkAndIconPreference; |
| import org.chromium.chrome.browser.preferences.privacy.BrowsingDataCounterBridge.BrowsingDataCounterCallback; |
| import org.chromium.sync.signin.ChromeSigninController; |
| @@ -109,15 +110,24 @@ public class ClearBrowsingDataPreferences extends PreferenceFragment |
| private static final String PREF_PASSWORDS = "clear_passwords_checkbox"; |
| private static final String PREF_FORM_DATA = "clear_form_data_checkbox"; |
| - private static final String PREF_SUMMARY = "summary"; |
| + @VisibleForTesting |
| + public static final String PREF_GOOGLE_SUMMARY = "google_summary"; |
| + @VisibleForTesting |
| + public static final String PREF_GENERAL_SUMMARY = "general_summary"; |
| private static final String PREF_TIME_RANGE = "time_period_spinner"; |
| - /** The "Clear" button preference. Referenced in tests. */ |
| + /** The "Clear" button preference. */ |
| + @VisibleForTesting |
| public static final String PREF_CLEAR_BUTTON = "clear_button"; |
| /** The tag used for logging. */ |
| public static final String TAG = "ClearBrowsingDataPreferences"; |
| + /** URLs linked from the footer */ |
| + private static final String URL_MY_ACTIVITY = "https://history.google.com"; |
| + private static final String URL_HELP_CENTER = |
|
newt (away)
2016/04/02 01:26:15
"Learn more" used to open in the Help & Feedback A
msramek
2016/04/04 16:23:12
Done. I actually cannot remember why I originally
|
| + "https://support.google.com/chrome/answer/2392709?p=preferences_clear_browsing_data"; |
| + |
| /** |
| * The various data types that can be cleared via this screen. |
| */ |
| @@ -362,13 +372,23 @@ public class ClearBrowsingDataPreferences extends PreferenceFragment |
| clearButton.setOnPreferenceClickListener(this); |
| clearButton.setShouldDisableView(true); |
| - // Only one footnote should be shown, the unsynced or synced version, depending on whether |
| - // the user is signed in. |
| - Preference summary = findPreference(PREF_SUMMARY); |
| + // The general information footnote informs users about data that will not be deleted. |
| + // If the user is signed in, it also informs users about the behavior of synced deletions. |
| + // and we show an additional Google-specific footnote. This footnote informs users that they |
| + // will not be signed out of their Google account, and if the web history service indicates |
| + // that they have other forms of browsing history, then also about that. |
| + TextMessageWithLinkAndIconPreference google_summary = |
| + (TextMessageWithLinkAndIconPreference) findPreference(PREF_GOOGLE_SUMMARY); |
| + TextMessageWithLinkAndIconPreference general_summary = |
| + (TextMessageWithLinkAndIconPreference) findPreference(PREF_GENERAL_SUMMARY); |
| + google_summary.setUrl(URL_MY_ACTIVITY); |
| + general_summary.setUrl(URL_HELP_CENTER); |
| if (ChromeSigninController.get(getActivity()).isSignedIn()) { |
| - summary.setSummary(R.string.clear_browsing_data_footnote_signed); |
| + general_summary.setSummary( |
| + R.string.clear_browsing_data_footnote_sync_and_site_settings); |
| } else { |
| - summary.setSummary(R.string.clear_browsing_data_footnote); |
| + getPreferenceScreen().removePreference(google_summary); |
| + general_summary.setSummary(R.string.clear_browsing_data_footnote_site_settings); |
| } |
| } |
| @@ -404,4 +424,15 @@ public class ClearBrowsingDataPreferences extends PreferenceFragment |
| ProgressDialog getProgressDialog() { |
| return mProgressDialog; |
| } |
| + |
| + /** |
| + * Shows a notice about other forms of browsing history. To be called by the web history |
| + * service when it discovers that they exist. |
| + */ |
| + public void showNoticeAboutOtherFormsOfBrowsingHistory() { |
|
newt (away)
2016/04/02 01:24:03
This is going to be used in the (near) future, rig
msramek
2016/04/04 16:23:12
Yes, sorry, I forgot to mention that :) More or le
|
| + TextMessageWithLinkAndIconPreference google_summary = |
| + (TextMessageWithLinkAndIconPreference) findPreference(PREF_GOOGLE_SUMMARY); |
| + google_summary.setSummary( |
|
newt (away)
2016/04/02 01:24:03
google_summary could be null if the google_summary
msramek
2016/04/04 16:23:12
Done.
|
| + R.string.clear_browsing_data_footnote_signed_and_other_forms_of_history); |
| + } |
| } |