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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java

Issue 1870703002: Connect the "other forms of browsing history" frontend on Android to backend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-dialog-rebased
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.preferences; 5 package org.chromium.chrome.browser.preferences;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.content.SharedPreferences; 8 import android.content.SharedPreferences;
9 import android.preference.PreferenceManager; 9 import android.preference.PreferenceManager;
10 import android.util.Log; 10 import android.util.Log;
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 } 723 }
724 724
725 @CalledByNative 725 @CalledByNative
726 private void browsingDataCleared() { 726 private void browsingDataCleared() {
727 if (mClearBrowsingDataListener != null) { 727 if (mClearBrowsingDataListener != null) {
728 mClearBrowsingDataListener.onBrowsingDataCleared(); 728 mClearBrowsingDataListener.onBrowsingDataCleared();
729 mClearBrowsingDataListener = null; 729 mClearBrowsingDataListener = null;
730 } 730 }
731 } 731 }
732 732
733 /**
734 * Interface to a class that receives callbacks instructing it to inform the user about other
735 * forms of browsing history.
736 */
737 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
738 public abstract void enableDialogAboutOtherFormsOfBrowsingHistory();
739 public abstract void showNoticeAboutOtherFormsOfBrowsingHistory();
740 }
741
742 private OtherFormsOfBrowsingHistoryListener mShowNoticeListener;
743 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
744
745 @CalledByNative
746 private void showNoticeAboutOtherFormsOfBrowsingHistory(boolean show) {
747 if (mShowNoticeListener != null) {
748 if (show) {
749 mShowNoticeListener.showNoticeAboutOtherFormsOfBrowsingHistory() ;
750 }
751
752 // Null the listener so that ClearBrowsingDataPreferences can be gar bage-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.
753 mShowNoticeListener = null;
754 }
755 }
756
757 @CalledByNative
758 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
759 if (mEnableDialogListener != null) {
760 if (enable) {
761 mEnableDialogListener.enableDialogAboutOtherFormsOfBrowsingHisto ry();
762 }
763
764 // Null the listener so that ClearBrowsingDataPreferences can be gar bage-collected.
765 mEnableDialogListener = null;
766 }
767 }
768
769 /**
770 * Requests that the web history service finds out if we should inform the u ser about the
771 * existence of other forms of browsing history. The response will be asynch ronous, through
772 * {@link PrefServiceBridge#enableDialogAboutOtherFormsOfBrowsingHistory} an d
773 * {@link PrefServiceBridge#showNoticeAboutOtherFormsOfBrowsingHistory}.
774 */
775 public void requestInfoAboutOtherFormsOfBrowsingHistory(
776 OtherFormsOfBrowsingHistoryListener listener) {
777 mShowNoticeListener = listener;
778 mEnableDialogListener = listener;
779 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
780 }
781
733 public void setAllowCookiesEnabled(boolean allow) { 782 public void setAllowCookiesEnabled(boolean allow) {
734 nativeSetAllowCookiesEnabled(allow); 783 nativeSetAllowCookiesEnabled(allow);
735 } 784 }
736 785
737 public void setBlockThirdPartyCookiesEnabled(boolean enabled) { 786 public void setBlockThirdPartyCookiesEnabled(boolean enabled) {
738 nativeSetBlockThirdPartyCookiesEnabled(enabled); 787 nativeSetBlockThirdPartyCookiesEnabled(enabled);
739 } 788 }
740 789
741 public void setDoNotTrackEnabled(boolean enabled) { 790 public void setDoNotTrackEnabled(boolean enabled) {
742 nativeSetDoNotTrackEnabled(enabled); 791 nativeSetDoNotTrackEnabled(enabled);
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 private native boolean nativeGetSupervisedUserSafeSitesEnabled(); 1063 private native boolean nativeGetSupervisedUserSafeSitesEnabled();
1015 private native void nativeSetTranslateEnabled(boolean enabled); 1064 private native void nativeSetTranslateEnabled(boolean enabled);
1016 private native void nativeSetAutoDetectEncodingEnabled(boolean enabled); 1065 private native void nativeSetAutoDetectEncodingEnabled(boolean enabled);
1017 private native void nativeResetTranslateDefaults(); 1066 private native void nativeResetTranslateDefaults();
1018 private native void nativeMigrateJavascriptPreference(); 1067 private native void nativeMigrateJavascriptPreference();
1019 private native boolean nativeGetBrowsingDataDeletionPreference(int dataType) ; 1068 private native boolean nativeGetBrowsingDataDeletionPreference(int dataType) ;
1020 private native void nativeSetBrowsingDataDeletionPreference(int dataType, bo olean value); 1069 private native void nativeSetBrowsingDataDeletionPreference(int dataType, bo olean value);
1021 private native int nativeGetBrowsingDataDeletionTimePeriod(); 1070 private native int nativeGetBrowsingDataDeletionTimePeriod();
1022 private native void nativeSetBrowsingDataDeletionTimePeriod(int timePeriod); 1071 private native void nativeSetBrowsingDataDeletionTimePeriod(int timePeriod);
1023 private native void nativeClearBrowsingData(int[] dataTypes, int timePeriod) ; 1072 private native void nativeClearBrowsingData(int[] dataTypes, int timePeriod) ;
1073 private native void nativeRequestInfoAboutOtherFormsOfBrowsingHistory();
1024 private native boolean nativeCanDeleteBrowsingHistory(); 1074 private native boolean nativeCanDeleteBrowsingHistory();
1025 private native void nativeSetAllowCookiesEnabled(boolean allow); 1075 private native void nativeSetAllowCookiesEnabled(boolean allow);
1026 private native void nativeSetBackgroundSyncEnabled(boolean allow); 1076 private native void nativeSetBackgroundSyncEnabled(boolean allow);
1027 private native void nativeSetBlockThirdPartyCookiesEnabled(boolean enabled); 1077 private native void nativeSetBlockThirdPartyCookiesEnabled(boolean enabled);
1028 private native void nativeSetDoNotTrackEnabled(boolean enabled); 1078 private native void nativeSetDoNotTrackEnabled(boolean enabled);
1029 private native void nativeSetFullscreenAllowed(boolean allowed); 1079 private native void nativeSetFullscreenAllowed(boolean allowed);
1030 private native void nativeSetRememberPasswordsEnabled(boolean allow); 1080 private native void nativeSetRememberPasswordsEnabled(boolean allow);
1031 private native void nativeSetPasswordManagerAutoSigninEnabled(boolean enable d); 1081 private native void nativeSetPasswordManagerAutoSigninEnabled(boolean enable d);
1032 private native void nativeSetProtectedMediaIdentifierEnabled(boolean enabled ); 1082 private native void nativeSetProtectedMediaIdentifierEnabled(boolean enabled );
1033 private native boolean nativeGetAllowLocationEnabled(); 1083 private native boolean nativeGetAllowLocationEnabled();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 private native String nativeGetSupervisedUserSecondCustodianName(); 1118 private native String nativeGetSupervisedUserSecondCustodianName();
1069 private native String nativeGetSupervisedUserSecondCustodianEmail(); 1119 private native String nativeGetSupervisedUserSecondCustodianEmail();
1070 private native String nativeGetSupervisedUserSecondCustodianProfileImageURL( ); 1120 private native String nativeGetSupervisedUserSecondCustodianProfileImageURL( );
1071 private native boolean nativeGetMetricsReportingEnabled(); 1121 private native boolean nativeGetMetricsReportingEnabled();
1072 private native void nativeSetMetricsReportingEnabled(boolean enabled); 1122 private native void nativeSetMetricsReportingEnabled(boolean enabled);
1073 private native boolean nativeHasSetMetricsReporting(); 1123 private native boolean nativeHasSetMetricsReporting();
1074 private native void nativeSetClickedUpdateMenuItem(boolean clicked); 1124 private native void nativeSetClickedUpdateMenuItem(boolean clicked);
1075 private native boolean nativeGetClickedUpdateMenuItem(); 1125 private native boolean nativeGetClickedUpdateMenuItem();
1076 private native void nativeSetSupervisedUserId(String supervisedUserId); 1126 private native void nativeSetSupervisedUserId(String supervisedUserId);
1077 } 1127 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698