Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java |
index 381b475c7c400a90417dee405a9d81ab8f441937..85d5ee165f23e93c3f0c6caea6a765bb0ca52e07 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java |
@@ -730,6 +730,55 @@ public final class PrefServiceBridge { |
} |
} |
+ /** |
+ * Interface to a class that receives callbacks instructing it to inform the user about other |
+ * forms of browsing history. |
+ */ |
+ public interface OtherFormsOfBrowsingHistoryListener { |
gone
2016/04/07 22:27:55
public inner classes go at the top of the class.
msramek
2016/04/08 16:03:17
Done. I also moved the existing OnClearBrowsingDat
|
+ public abstract void enableDialogAboutOtherFormsOfBrowsingHistory(); |
+ public abstract void showNoticeAboutOtherFormsOfBrowsingHistory(); |
+ } |
+ |
+ private OtherFormsOfBrowsingHistoryListener mShowNoticeListener; |
+ private OtherFormsOfBrowsingHistoryListener mEnableDialogListener; |
gone
2016/04/07 22:27:55
Same comment as the other CL: don't randomly put m
msramek
2016/04/08 16:03:18
Acknowledged. This was removed, as per the other c
|
+ |
+ @CalledByNative |
+ private void showNoticeAboutOtherFormsOfBrowsingHistory(boolean show) { |
+ if (mShowNoticeListener != null) { |
+ if (show) { |
+ mShowNoticeListener.showNoticeAboutOtherFormsOfBrowsingHistory(); |
+ } |
+ |
+ // Null the listener so that ClearBrowsingDataPreferences can be garbage-collected. |
gone
2016/04/07 22:27:55
This would happen regardless, so the comment isn't
msramek
2016/04/08 16:03:18
Acknowledged. This part is now removed.
|
+ mShowNoticeListener = null; |
+ } |
+ } |
+ |
+ @CalledByNative |
+ private void enableDialogAboutOtherFormsOfBrowsingHistory(boolean enable) { |
gone
2016/04/07 22:27:55
I don't understand why you grouped those functions
msramek
2016/04/08 16:03:18
I kept two separate references, because I don't kn
|
+ if (mEnableDialogListener != null) { |
+ if (enable) { |
+ mEnableDialogListener.enableDialogAboutOtherFormsOfBrowsingHistory(); |
+ } |
+ |
+ // Null the listener so that ClearBrowsingDataPreferences can be garbage-collected. |
+ mEnableDialogListener = null; |
+ } |
+ } |
+ |
+ /** |
+ * Requests that the web history service finds out if we should inform the user about the |
+ * existence of other forms of browsing history. The response will be asynchronous, through |
+ * {@link PrefServiceBridge#enableDialogAboutOtherFormsOfBrowsingHistory} and |
+ * {@link PrefServiceBridge#showNoticeAboutOtherFormsOfBrowsingHistory}. |
+ */ |
+ public void requestInfoAboutOtherFormsOfBrowsingHistory( |
+ OtherFormsOfBrowsingHistoryListener listener) { |
+ mShowNoticeListener = listener; |
+ mEnableDialogListener = listener; |
+ nativeRequestInfoAboutOtherFormsOfBrowsingHistory(); |
gone
2016/04/07 22:27:55
Instead of storing the listeners, you should pass
msramek
2016/04/08 16:03:18
Done. That was actually my first idea, but then I
|
+ } |
+ |
public void setAllowCookiesEnabled(boolean allow) { |
nativeSetAllowCookiesEnabled(allow); |
} |
@@ -1021,6 +1070,7 @@ public final class PrefServiceBridge { |
private native int nativeGetBrowsingDataDeletionTimePeriod(); |
private native void nativeSetBrowsingDataDeletionTimePeriod(int timePeriod); |
private native void nativeClearBrowsingData(int[] dataTypes, int timePeriod); |
+ private native void nativeRequestInfoAboutOtherFormsOfBrowsingHistory(); |
private native boolean nativeCanDeleteBrowsingHistory(); |
private native void nativeSetAllowCookiesEnabled(boolean allow); |
private native void nativeSetBackgroundSyncEnabled(boolean allow); |