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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6827a17b72f47e6bb70e301c378212c8bcfa841c |
--- /dev/null |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java |
@@ -0,0 +1,706 @@ |
+// Copyright 2012 The Chromium Authors. All rights reserved. |
Ted C
2014/10/21 16:57:21
2014
Yaron
2014/10/21 17:40:13
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package org.chromium.chrome.browser.preferences; |
+ |
+import org.chromium.base.CalledByNative; |
+import org.chromium.base.ThreadUtils; |
+import org.chromium.chrome.browser.search_engines.TemplateUrlService; |
+ |
+import java.util.ArrayList; |
+ |
+/** |
+ * PrefServiceBridge is a singleton which provides access to some native preferences. Ideally |
+ * preferences should be grouped with their relevant functionality but this is a grab-bag for other |
Ted C
2014/10/21 16:57:20
:-) so honest
Yaron
2014/10/21 17:40:13
Acknowledged.
|
+ * prefernces. |
+ */ |
+public final class PrefServiceBridge { |
+ |
+ // Does not need sync with native; used for the popup settings check |
+ public static final String EXCEPTION_SETTING_ALLOW = "allow"; |
+ public static final String EXCEPTION_SETTING_BLOCK = "block"; |
+ public static final String EXCEPTION_SETTING_DEFAULT = "default"; |
+ |
+ // These values must match the native enum values in |
+ // SupervisedUserURLFilter::FilteringBehavior |
+ public static final int SUPERVISED_USER_FILTERING_ALLOW = 0; |
+ public static final int SUPERVISED_USER_FILTERING_WARN = 1; |
+ public static final int SUPERVISED_USER_FILTERING_BLOCK = 2; |
+ |
+ private static String sProfilePathValue; |
+ |
+ // Object to notify when "clear browsing data" completes. |
+ private OnClearBrowsingDataListener mClearBrowsingDataListener; |
+ private static final String LOG_TAG = "PrefServiceBridge"; |
+ |
+ // Constants related to the Contextual Search preference. |
+ private static final String CONTEXTUAL_SEARCH_DISABLED = "false"; |
+ private static final String CONTEXTUAL_SEARCH_ENABLED = "true"; |
+ |
+ /** |
+ * Structure that holds all the version information about the current Chrome browser. |
+ */ |
+ public static class AboutVersionStrings { |
+ private final String mApplicationVersion; |
+ private final String mWebkitVersion; |
+ private final String mJavascriptVersion; |
+ private final String mOSVersion; |
+ |
+ private AboutVersionStrings(String applicationVersion, String webkitVersion, |
+ String javascriptVersion, String osVersion) { |
+ mApplicationVersion = applicationVersion; |
+ mWebkitVersion = webkitVersion; |
+ mJavascriptVersion = javascriptVersion; |
+ mOSVersion = osVersion; |
+ } |
+ |
+ public String getApplicationVersion() { |
+ return mApplicationVersion; |
Ted C
2014/10/21 16:57:20
not that you want to change these as part of upstr
Yaron
2014/10/21 17:40:13
Ya, that would probably be cleaner. Noted for futu
|
+ } |
+ |
+ public String getWebkitVersion() { |
+ return mWebkitVersion; |
+ } |
+ |
+ public String getJavascriptVersion() { |
+ return mJavascriptVersion; |
+ } |
+ |
+ public String getOSVersion() { |
+ return mOSVersion; |
+ } |
+ } |
+ |
+ /** |
+ * Website popup exception entry. |
+ */ |
+ public static class PopupExceptionInfo { |
+ private final String mPattern; |
+ private final String mSetting; |
+ private final String mSource; |
+ |
+ private PopupExceptionInfo(String pattern, String setting, String source) { |
+ mPattern = pattern; |
+ mSetting = setting; |
+ mSource = source; |
+ } |
+ |
+ public String getPattern() { |
+ return mPattern; |
+ } |
Ted C
2014/10/21 16:57:21
I would add blank spaces between these to be consi
Yaron
2014/10/21 17:40:13
Done.
|
+ public String getSetting() { |
+ return mSetting; |
+ } |
+ public String getSource() { |
+ return mSource; |
+ } |
+ } |
+ |
+ @CalledByNative |
+ private static AboutVersionStrings createAboutVersionStrings( |
+ String applicationVersion, String webkitVersion, String javascriptVersion, |
+ String osVersion) { |
+ return new AboutVersionStrings( |
+ applicationVersion, webkitVersion, javascriptVersion, osVersion); |
+ } |
+ |
+ private PrefServiceBridge() { |
+ TemplateUrlService.getInstance().load(); |
+ } |
+ |
+ private static PrefServiceBridge sInstance; |
+ |
+ /** |
+ * @return The singleton preferences object. |
+ */ |
+ public static PrefServiceBridge getInstance() { |
+ ThreadUtils.assertOnUiThread(); |
+ if (sInstance == null) sInstance = new PrefServiceBridge(); |
+ return sInstance; |
+ } |
+ |
+ /** |
+ * @return Whether the preferences have been initialized. |
+ */ |
+ public static boolean isInitialized() { |
+ return sInstance != null; |
+ } |
+ |
+ /** |
+ * Return the About Chrome value for profile path. |
Ted C
2014/10/21 16:57:20
@return instead of Return
Looks like this file is
Yaron
2014/10/21 17:40:13
Done.
|
+ */ |
+ public String getProfilePathValue() { |
+ return sProfilePathValue; |
+ } |
+ |
+ /** |
+ * Set the About Chrome value for profile path. |
+ */ |
+ @CalledByNative |
+ public static void setProfilePathValue(String pathValue) { |
+ sProfilePathValue = pathValue; |
+ } |
+ |
+ /** |
+ * @return the mAcceptCookiesEnabled |
Ted C
2014/10/21 16:57:21
that is an impressive comment. I won't make you w
Yaron
2014/10/21 17:40:13
Done.
|
+ */ |
+ public boolean isAcceptCookiesEnabled() { |
+ return nativeGetAcceptCookiesEnabled(); |
+ } |
+ |
+ /** |
+ * @return whether cookies acceptance is managed |
+ */ |
+ public boolean isAcceptCookiesManaged() { |
+ return nativeGetAcceptCookiesManaged(); |
+ } |
+ |
+ /** |
+ * @return the mRememberPasswordsEnabled |
+ */ |
+ public boolean isRememberPasswordsEnabled() { |
+ return nativeGetRememberPasswordsEnabled(); |
+ } |
+ |
+ /** |
+ * @return the mRememberPasswordsManaged |
+ */ |
+ public boolean isRememberPasswordsManaged() { |
+ return nativeGetRememberPasswordsManaged(); |
+ } |
+ |
+ /** |
+ * @return the mAllowLocationEnabled |
+ */ |
+ public boolean isAllowLocationEnabled() { |
+ return nativeGetAllowLocationEnabled(); |
+ } |
+ |
+ /** |
+ * @return whether the location preference is configured by policy |
+ */ |
+ public boolean isAllowLocationManaged() { |
+ return nativeGetAllowLocationManaged(); |
+ } |
+ |
+ /** |
+ * @return whether Do Not Track is enabled |
+ */ |
+ public boolean isDoNotTrackEnabled() { |
+ return nativeGetDoNotTrackEnabled(); |
+ } |
+ |
+ public boolean getPasswordEchoEnabled() { |
+ return nativeGetPasswordEchoEnabled(); |
+ } |
+ |
+ /** |
+ * @return Whether EULA has been accepted by the user. |
+ */ |
+ public boolean isFirstRunEulaAccepted() { |
+ return nativeGetFirstRunEulaAccepted(); |
+ } |
+ |
+ /** |
+ * Returns true if JavaScript is enabled. It may return the temporary value set by |
+ * {@link #setJavaScriptEnabled}. The default is true. |
+ */ |
+ public boolean javaScriptEnabled() { |
+ return nativeGetJavaScriptEnabled(); |
+ } |
+ |
+ /** |
+ * @return whether Javascript is managed by policy |
+ */ |
+ public boolean javaScriptManaged() { |
+ return nativeGetJavaScriptManaged(); |
+ } |
+ |
+ /** |
+ * Sets the preference that controls protected media identifier. |
+ */ |
+ public void setProtectedMediaIdentifierEnabled(boolean enabled) { |
+ nativeSetProtectedMediaIdentifierEnabled(enabled); |
+ } |
+ |
+ /** |
+ * Sets the preference that controls translate |
+ */ |
+ public void setTranslateEnabled(boolean enabled) { |
+ nativeSetTranslateEnabled(enabled); |
+ } |
+ |
+ /** |
+ * Sets the preference that signals when the user has accepted the EULA. |
+ */ |
+ public void setEulaAccepted() { |
+ nativeSetEulaAccepted(); |
+ } |
+ |
+ /** |
+ * Resets translate defaults if needed |
+ */ |
+ public void resetTranslateDefaults() { |
+ nativeResetTranslateDefaults(); |
+ } |
+ |
+ /** |
+ * Enable or disable JavaScript. If "immediately" is true, the change is applied right away. |
+ * Otherwise the change will be applied when {@link #sync} is called. |
Ted C
2014/10/21 16:57:21
This comment seems no longer valid.
Yaron
2014/10/21 17:40:13
Done.
|
+ */ |
+ public void setJavaScriptEnabled(boolean enabled) { |
+ nativeSetJavaScriptEnabled(enabled); |
+ } |
+ |
+ /** |
+ * Returns the last account username associated with sync. |
+ */ |
+ public String getSyncLastAccountName() { |
+ return nativeGetSyncLastAccountName(); |
+ } |
+ |
+ /** |
+ * Enable or disable x-auto-login |
+ */ |
+ public void setAutologinEnabled(boolean autologinEnabled) { |
+ nativeSetAutologinEnabled(autologinEnabled); |
+ } |
+ |
+ /** |
+ * Return true if x-auto-login is enabled, false otherwise. |
+ */ |
+ public boolean isAutologinEnabled() { |
+ return nativeGetAutologinEnabled(); |
+ } |
+ |
+ /** |
+ * Enable or disable crashes_ui. |
+ */ |
+ public void setCrashReporting(boolean reporting) { |
+ nativeSetCrashReporting(reporting); |
+ } |
+ |
+ /** |
+ * Return whether Search Suggest is enabled. |
+ */ |
+ public boolean isSearchSuggestEnabled() { |
+ return nativeGetSearchSuggestEnabled(); |
+ } |
+ |
+ /** |
+ * Sets whether search suggest should be enabled. |
+ */ |
+ public void setSearchSuggestEnabled(boolean enabled) { |
+ nativeSetSearchSuggestEnabled(enabled); |
+ } |
+ |
+ /** |
+ * Return whether Search Suggest is managed. |
+ */ |
+ public boolean isSearchSuggestManaged() { |
+ return nativeGetSearchSuggestManaged(); |
+ } |
+ |
+ /** |
+ * Return the Contextual Search preference. |
+ */ |
+ public String getContextualSearchPreference() { |
+ return nativeGetContextualSearchPreference(); |
+ } |
+ |
+ /** |
+ * Sets the Contextual Search preference and sends a notification. |
Ted C
2014/10/21 16:57:21
is this sends a notification still valid?
Yaron
2014/10/21 17:40:13
nah, I removed that junk prior to upstreaming :)
|
+ * @param prefValue one of "", CONTEXTUAL_SEARCH_ENABLED or CONTEXTUAL_SEARCH_DISABLED. |
+ */ |
+ public void setContextualSearchPreference(String prefValue) { |
+ nativeSetContextualSearchPreference(prefValue); |
+ } |
+ |
+ /** |
+ * @return whether the Contextual Search feature was disabled by the user explicitly. |
+ */ |
+ public boolean isContextualSearchDisabled() { |
+ return getContextualSearchPreference().equals(CONTEXTUAL_SEARCH_DISABLED); |
+ } |
+ |
+ /** |
+ * @return whether the Contextual Search feature is uninitialized (preference unset by the |
+ * user). |
Ted C
2014/10/21 16:57:21
this should align with "whether" above
Yaron
2014/10/21 17:40:13
Done.
|
+ */ |
+ public boolean isContextualSearchUninitialized() { |
+ return getContextualSearchPreference().isEmpty(); |
+ } |
+ |
+ /** |
+ * @param whether Contextual Search should be enabled. |
+ */ |
+ public void setContextualSearchState(boolean enabled) { |
+ setContextualSearchPreference(enabled |
+ ? CONTEXTUAL_SEARCH_ENABLED : CONTEXTUAL_SEARCH_DISABLED); |
+ } |
+ |
+ /** |
+ * Return whether there is a user set value for kNetworkPredictionEnabled. This should only be |
+ * used for preference migration. |
+ */ |
+ public boolean networkPredictionEnabledHasUserSetting() { |
+ return nativeNetworkPredictionEnabledHasUserSetting(); |
+ } |
+ |
+ /** |
+ * Return whether there is a user set value for kNetworkPredictionOptions. This should only be |
+ * used for preference migration. |
+ */ |
+ public boolean networkPredictionOptionsHasUserSetting() { |
+ return nativeNetworkPredictionOptionsHasUserSetting(); |
+ } |
+ |
+ /** |
+ * Return the user set value for kNetworkPredictionEnabled. This should only be used for |
+ * preference migration. |
+ */ |
+ public boolean getNetworkPredictionEnabledUserPrefValue() { |
+ return nativeGetNetworkPredictionEnabledUserPrefValue(); |
+ } |
+ |
+ /** |
+ * Return Network Predictions option. It is stored as an int and converted to an enum. |
Ted C
2014/10/21 16:57:20
The storage information seems to be very implement
Yaron
2014/10/21 17:40:13
Done.
|
+ */ |
+ public NetworkPredictionOptions getNetworkPredictionOptions() { |
+ return NetworkPredictionOptions.intToEnum(nativeGetNetworkPredictionOptions()); |
+ } |
+ |
+ /** |
+ * Sets network predictions preference. It is received as an enum and converted to an int. |
+ */ |
+ public void setNetworkPredictionOptions(NetworkPredictionOptions option) { |
+ nativeSetNetworkPredictionOptions(option.enumToInt()); |
+ } |
+ |
+ /** |
+ * Return whether Network Predictions is managed. |
+ */ |
+ public boolean isNetworkPredictionManaged() { |
+ return nativeGetNetworkPredictionManaged(); |
+ } |
+ |
+ /** |
+ * Checks whether network predictions are allowed given preferences and current network |
+ * connection type. |
+ * @return Whether network predictions are allowed. |
+ */ |
+ public boolean canPredictNetworkActions() { |
+ return nativeCanPredictNetworkActions(); |
+ } |
+ |
+ /** |
+ * Return whether the web service to resolve navigation error is enabled. |
+ */ |
+ public boolean isResolveNavigationErrorEnabled() { |
+ return nativeGetResolveNavigationErrorEnabled(); |
+ } |
+ |
+ /** |
+ * Return whether the web service to resolve navigation error is managed. |
+ */ |
+ public boolean isResolveNavigationErrorManaged() { |
+ return nativeGetResolveNavigationErrorManaged(); |
+ } |
+ |
+ /** |
+ * Return whether usage and crash report is managed. |
+ */ |
+ public boolean isCrashReportManaged() { |
Ted C
2014/10/21 16:57:21
should this go up with setCrashReporting?
Yaron
2014/10/21 17:40:13
Done.
|
+ return nativeGetCrashReportManaged(); |
+ } |
+ |
+ /** |
+ * @return whether or not the protected media identifier is enabled. |
+ */ |
+ public boolean isProtectedMediaIdentifierEnabled() { |
+ return nativeGetProtectedMediaIdentifierEnabled(); |
+ } |
+ |
+ /** |
+ * Return true if translate is enabled, false otherwise. |
+ */ |
+ public boolean isTranslateEnabled() { |
+ return nativeGetTranslateEnabled(); |
+ } |
+ |
+ /** |
+ * @return whether translate is configured by policy |
+ */ |
+ public boolean isTranslateManaged() { |
+ return nativeGetTranslateManaged(); |
+ } |
+ |
+ /** |
+ * Sets whether the web service to resolve navigation error should be enabled. |
+ */ |
+ public void setResolveNavigationErrorEnabled(boolean enabled) { |
+ nativeSetResolveNavigationErrorEnabled(enabled); |
+ } |
+ |
+ /** |
+ * Interface for a class that is listening to clear browser data events. |
+ */ |
+ public interface OnClearBrowsingDataListener { |
+ public abstract void onBrowsingDataCleared(); |
+ } |
+ |
+ /** |
+ * 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. |
+ */ |
+ public void clearBrowsingData(OnClearBrowsingDataListener listener, |
+ boolean history, boolean cache, boolean cookiesAndSiteData, |
+ boolean passwords, boolean formData) { |
+ mClearBrowsingDataListener = listener; |
Ted C
2014/10/21 16:57:21
Seems like we should be checking that mClearBrowsi
Yaron
2014/10/21 17:40:14
Agreed - added an assert. I even considered fixing
|
+ nativeClearBrowsingData(history, cache, cookiesAndSiteData, passwords, formData); |
+ } |
+ |
+ @CalledByNative |
+ private void browsingDataCleared() { |
+ if (mClearBrowsingDataListener != null) { |
+ mClearBrowsingDataListener.onBrowsingDataCleared(); |
+ mClearBrowsingDataListener = null; |
+ } |
+ } |
+ |
+ public void setAllowCookiesEnabled(boolean allow) { |
+ nativeSetAllowCookiesEnabled(allow); |
+ } |
+ |
+ public void setDoNotTrackEnabled(boolean enabled) { |
+ nativeSetDoNotTrackEnabled(enabled); |
+ } |
+ |
+ public void setRememberPasswordsEnabled(boolean allow) { |
+ nativeSetRememberPasswordsEnabled(allow); |
+ } |
+ |
+ public void setAllowLocationEnabled(boolean allow) { |
+ nativeSetAllowLocationEnabled(allow); |
+ } |
+ |
+ public void setPasswordEchoEnabled(boolean enabled) { |
+ nativeSetPasswordEchoEnabled(enabled); |
+ } |
+ |
+ /** |
+ * @return The setting if popups are enabled |
+ */ |
+ public boolean popupsEnabled() { |
+ return nativeGetAllowPopupsEnabled(); |
+ } |
+ |
+ /** |
+ * @return Whether the setting to allow popups is managed |
+ */ |
+ public boolean isPopupsManaged() { |
+ return nativeGetAllowPopupsManaged(); |
+ } |
+ |
+ /** |
+ * Sets the preferences on whether to enable/disable popups |
+ * |
+ * @param allow attribute to enable/disable popups |
+ */ |
+ public void setAllowPopupsEnabled(boolean allow) { |
+ nativeSetAllowPopupsEnabled(allow); |
+ } |
+ |
+ /** |
+ * @return true if incognito mode is enabled. |
+ */ |
+ public boolean isIncognitoModeEnabled() { |
+ return nativeGetIncognitoModeEnabled(); |
+ } |
+ |
+ /** |
+ * @return true if incognito mode is managed by policy. |
+ */ |
+ public boolean isIncognitoModeManaged() { |
+ return nativeGetIncognitoModeManaged(); |
+ } |
+ |
+ /** |
+ * @return Whether printing is enabled. |
+ */ |
+ public boolean isPrintingEnabled() { |
+ return nativeGetPrintingEnabled(); |
+ } |
+ |
+ /** |
+ * Adds/Edit a popup exception |
+ * |
+ * @param pattern attribute for the popup exception pattern |
+ * @param allow attribute to specify whether to allow or block pattern |
+ */ |
+ public void setPopupException(String pattern, boolean allow) { |
+ nativeSetPopupException(pattern, allow); |
+ } |
+ |
+ /** |
+ * Removes a popup exception |
+ * |
+ * @param pattern attribute for the popup exception pattern |
+ */ |
+ public void removePopupException(String pattern) { |
+ nativeRemovePopupException(pattern); |
+ } |
+ |
+ /** |
+ * get all the currently saved popup exceptions |
+ * |
+ * @return HashMap array of all the exceptions and their settings |
Ted C
2014/10/21 16:57:21
s/HashMap array/List
Yaron
2014/10/21 17:40:13
Done.
|
+ */ |
+ public ArrayList<PopupExceptionInfo> getPopupExceptions() { |
Ted C
2014/10/21 16:57:21
This should be just returning a list instead of Ar
Yaron
2014/10/21 17:40:13
Done.
|
+ ArrayList<PopupExceptionInfo> list = new ArrayList<PopupExceptionInfo>(); |
+ nativeGetPopupExceptions(list); |
+ return list; |
+ } |
+ |
+ @CalledByNative |
+ private static void insertPopupExceptionToList( |
+ ArrayList<PopupExceptionInfo> list, String pattern, String setting, String source) { |
+ PopupExceptionInfo exception = new PopupExceptionInfo(pattern, setting, source); |
+ list.add(exception); |
+ } |
+ |
+ /** |
+ * Get all the version strings from native. |
+ * @return AboutVersionStrings about version strings. |
+ */ |
+ public AboutVersionStrings getAboutVersionStrings() { |
+ return nativeGetAboutVersionStrings(); |
+ } |
+ |
+ /** |
+ * Set profile path value needed for about chrome. |
+ */ |
+ public void setPathValuesForAboutChrome() { |
+ if (sProfilePathValue == null) { |
+ nativeSetPathValuesForAboutChrome(); |
+ } |
+ } |
+ |
+ /** |
+ * Reset accept-languages to its default value. |
+ * |
+ * @param defaultLocale A fall-back value such as en_US, de_DE, zh_CN, etc. |
+ */ |
+ public void resetAcceptLanguages(String defaultLocale) { |
+ nativeResetAcceptLanguages(defaultLocale); |
+ } |
+ |
+ /** |
+ * @return whether ForceSafeSearch is set |
+ */ |
+ public boolean isForceSafeSearch() { |
+ return nativeGetForceSafeSearch(); |
+ } |
+ |
+ /** |
+ * @return the default supervised user filtering behavior |
+ */ |
+ public int getDefaultSupervisedUserFilteringBehavior() { |
+ return nativeGetDefaultSupervisedUserFilteringBehavior(); |
+ } |
+ |
+ public String getSupervisedUserCustodianName() { |
+ return nativeGetSupervisedUserCustodianName(); |
+ } |
+ |
+ public String getSupervisedUserCustodianEmail() { |
+ return nativeGetSupervisedUserCustodianEmail(); |
+ } |
+ |
+ public String getSupervisedUserCustodianProfileImageURL() { |
+ return nativeGetSupervisedUserCustodianProfileImageURL(); |
+ } |
+ |
+ public String getSupervisedUserSecondCustodianName() { |
+ return nativeGetSupervisedUserSecondCustodianName(); |
+ } |
+ |
+ public String getSupervisedUserSecondCustodianEmail() { |
+ return nativeGetSupervisedUserSecondCustodianEmail(); |
+ } |
+ |
+ public String getSupervisedUserSecondCustodianProfileImageURL() { |
+ return nativeGetSupervisedUserSecondCustodianProfileImageURL(); |
+ } |
+ |
+ private native boolean nativeGetAcceptCookiesEnabled(); |
+ private native boolean nativeGetAcceptCookiesManaged(); |
+ private native boolean nativeGetRememberPasswordsEnabled(); |
+ private native boolean nativeGetRememberPasswordsManaged(); |
+ private native boolean nativeGetAllowLocationManaged(); |
+ private native boolean nativeGetDoNotTrackEnabled(); |
+ private native boolean nativeGetPasswordEchoEnabled(); |
+ private native boolean nativeGetFirstRunEulaAccepted(); |
+ private native boolean nativeGetJavaScriptManaged(); |
+ private native boolean nativeGetTranslateEnabled(); |
+ private native boolean nativeGetTranslateManaged(); |
+ private native boolean nativeGetResolveNavigationErrorEnabled(); |
+ private native boolean nativeGetResolveNavigationErrorManaged(); |
+ private native boolean nativeGetProtectedMediaIdentifierEnabled(); |
+ private native boolean nativeGetCrashReportManaged(); |
+ private native boolean nativeGetIncognitoModeEnabled(); |
+ private native boolean nativeGetIncognitoModeManaged(); |
+ private native boolean nativeGetPrintingEnabled(); |
+ private native boolean nativeGetForceSafeSearch(); |
+ private native void nativeSetTranslateEnabled(boolean enabled); |
+ private native void nativeResetTranslateDefaults(); |
+ private native boolean nativeGetJavaScriptEnabled(); |
+ private native void nativeSetJavaScriptEnabled(boolean enabled); |
+ private native void nativeClearBrowsingData(boolean history, boolean cache, |
+ boolean cookiesAndSiteData, boolean passwords, boolean formData); |
+ private native boolean nativeGetAllowCookiesEnabled(); |
+ private native void nativeSetAllowCookiesEnabled(boolean allow); |
+ private native void nativeSetDoNotTrackEnabled(boolean enabled); |
+ private native void nativeSetRememberPasswordsEnabled(boolean allow); |
+ private native void nativeSetProtectedMediaIdentifierEnabled(boolean enabled); |
+ private native boolean nativeGetAllowLocationEnabled(); |
+ private native void nativeSetAllowLocationEnabled(boolean allow); |
+ private native void nativeSetPasswordEchoEnabled(boolean enabled); |
+ private native boolean nativeGetAllowPopupsEnabled(); |
+ private native boolean nativeGetAllowPopupsManaged(); |
+ private native void nativeSetAllowPopupsEnabled(boolean allow); |
+ private native void nativeSetPopupException(String pattern, boolean allow); |
+ private native void nativeRemovePopupException(String pattern); |
+ private native void nativeGetPopupExceptions(Object list); |
+ private native boolean nativeGetAutologinEnabled(); |
+ private native void nativeSetAutologinEnabled(boolean autologinEnabled); |
+ private native void nativeSetCrashReporting(boolean reporting); |
+ private native boolean nativeCanPredictNetworkActions(); |
+ private native AboutVersionStrings nativeGetAboutVersionStrings(); |
+ private native void nativeSetPathValuesForAboutChrome(); |
+ private native void nativeSetContextualSearchPreference(String preference); |
+ private native String nativeGetContextualSearchPreference(); |
+ private native boolean nativeGetSearchSuggestEnabled(); |
+ private native void nativeSetSearchSuggestEnabled(boolean enabled); |
+ private native boolean nativeGetSearchSuggestManaged(); |
+ private native boolean nativeGetNetworkPredictionManaged(); |
+ private native boolean nativeNetworkPredictionEnabledHasUserSetting(); |
+ private native boolean nativeNetworkPredictionOptionsHasUserSetting(); |
+ private native boolean nativeGetNetworkPredictionEnabledUserPrefValue(); |
+ private native int nativeGetNetworkPredictionOptions(); |
+ private native void nativeSetNetworkPredictionOptions(int option); |
+ private native void nativeSetResolveNavigationErrorEnabled(boolean enabled); |
+ private native void nativeSetEulaAccepted(); |
+ private native void nativeResetAcceptLanguages(String defaultLocale); |
+ private native String nativeGetSyncLastAccountName(); |
+ private native String nativeGetSupervisedUserCustodianName(); |
+ private native String nativeGetSupervisedUserCustodianEmail(); |
+ private native String nativeGetSupervisedUserCustodianProfileImageURL(); |
+ private native int nativeGetDefaultSupervisedUserFilteringBehavior(); |
+ private native String nativeGetSupervisedUserSecondCustodianName(); |
+ private native String nativeGetSupervisedUserSecondCustodianEmail(); |
+ private native String nativeGetSupervisedUserSecondCustodianProfileImageURL(); |
+} |