Commit 2d1bdcdb authored by luca020400's avatar luca020400

Jelly: Add save form data setting

* Enabled by default

Change-Id: I373a521a9ff9094f97ca961b91cb64f4be8dd478
parent d2926c7c
......@@ -30,6 +30,7 @@ public final class PrefsUtils {
private static final String KEY_LOCATION = "key_location";
private static final String KEY_COOKIE = "key_cookie";
private static final String KEY_DO_NOT_TRACK = "key_do_not_track";
private static final String KEY_SAVE_FORM_DATA = "key_save_form_data";
private PrefsUtils() {
}
......@@ -75,6 +76,11 @@ public final class PrefsUtils {
return prefs.getBoolean(KEY_DO_NOT_TRACK, false);
}
public static boolean getSaveFormData(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
return prefs.getBoolean(KEY_SAVE_FORM_DATA, true);
}
public static void setHomePage(Context context, String value) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
prefs.edit().putString(KEY_HOME_PAGE, value).apply();
......
......@@ -85,6 +85,7 @@ public class WebViewExt extends WebView {
getSettings().setJavaScriptEnabled(PrefsUtils.getJavascript(mActivity));
getSettings().setJavaScriptCanOpenWindowsAutomatically(PrefsUtils.getJavascript(mActivity));
getSettings().setGeolocationEnabled(PrefsUtils.getLocation(mActivity));
getSettings().setSaveFormData(PrefsUtils.getSaveFormData(mActivity));
getSettings().setBuiltInZoomControls(true);
getSettings().setDisplayZoomControls(false);
getSettings().setDomStorageEnabled(true);
......
......@@ -110,6 +110,8 @@
<string name="pref_do_not_track_title">Do Not Track</string>
<!-- Settings: do not track preference summary -->
<string name="pref_do_not_track_summary">Send a Do Not Track request to websites you visit</string>
<!-- Settings: save form data title -->
<string name="pref_save_form_data_title">Save form data</string>
<!-- History: title -->
<string name="history_title">History</string>
......
......@@ -41,6 +41,11 @@
android:summary="@string/pref_looklock_summary"
android:title="@string/pref_looklock_title" />
<SwitchPreference
android:defaultValue="1"
android:key="key_save_form_data"
android:title="@string/pref_save_form_data_title" />
<SwitchPreference
android:defaultValue="1"
android:key="key_javascript"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment