Chromium Code Reviews| 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 81abafafc0b3adf65fef38cd4d3603fa47fed88c..f112059931439d8efea90335be0498afa4e58435 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 |
| @@ -639,17 +639,38 @@ public final class PrefServiceBridge { |
| } |
| /** |
| + * Checks the state of deletion preference for a certain browsing data type. |
| + * @param dataType the requested browsing data type (from the shared enum |
|
newt (away)
2016/01/13 20:01:49
nit: capitalize the first letter of the descriptio
msramek
2016/01/14 15:45:43
Done. Here and elsewhere. I actually capitalized i
|
| + * {@link org.chromium.chrome.browser.BrowsingDataType}). |
| + * @return the state of the corresponding deletion preference. |
| + */ |
| + public boolean getBrowsingDataDeletionPreference(int dataType) { |
| + return nativeGetBrowsingDataDeletionPreference(dataType); |
| + } |
| + |
| + /** |
| + * Sets the state of deletion preference for a certain browsing data type. |
| + * @param dataType the requested browsing data type (from the shared enum |
| + * {@link org.chromium.chrome.browser.BrowsingDataType}). |
| + * @param value the state to be set. |
| + */ |
| + public void setBrowsingDataDeletionPreference(int dataType, boolean value) { |
| + nativeSetBrowsingDataDeletionPreference(dataType, value); |
| + } |
| + |
| + /** |
| * Clear the specified types of browsing data asynchronously. |
| * |listener| is an object to be notified when clearing completes. |
| * It can be null, but many operations (e.g. navigation) are |
| * ill-advised while browsing data is being cleared. |
| + * @param listener a listener to call back when the clearing is finished. |
| + * @param dataTypes an array of browsing data types to delete, represented as values from |
| + * the shared enum {@link org.chromium.chrome.browser.BrowsingDataType}. |
| */ |
| - public void clearBrowsingData(OnClearBrowsingDataListener listener, |
| - boolean history, boolean cache, boolean cookiesAndSiteData, |
| - boolean passwords, boolean formData) { |
| + public void clearBrowsingData(OnClearBrowsingDataListener listener, int[] dataTypes) { |
| assert mClearBrowsingDataListener == null; |
| mClearBrowsingDataListener = listener; |
| - nativeClearBrowsingData(history, cache, cookiesAndSiteData, passwords, formData); |
| + nativeClearBrowsingData(dataTypes); |
| } |
| /* |
| @@ -977,8 +998,9 @@ public final class PrefServiceBridge { |
| private native void nativeResetTranslateDefaults(); |
| private native void nativeMigrateJavascriptPreference(); |
| private native void nativeSetJavaScriptAllowed(String pattern, int setting); |
| - private native void nativeClearBrowsingData(boolean history, boolean cache, |
| - boolean cookiesAndSiteData, boolean passwords, boolean formData); |
| + private native boolean nativeGetBrowsingDataDeletionPreference(int dataType); |
| + private native void nativeSetBrowsingDataDeletionPreference(int dataType, boolean value); |
| + private native void nativeClearBrowsingData(int[] dataTypes); |
| private native boolean nativeCanDeleteBrowsingHistory(); |
| private native void nativeSetAllowCookiesEnabled(boolean allow); |
| private native void nativeSetBlockThirdPartyCookiesEnabled(boolean enabled); |