<string name="pref_content_open_in_background">Open in background</string>
<!-- Settings label -->
<string name="pref_content_plugins">Enable plug-ins</string>
+ <!-- Plugin options -->
+ <string-array name="pref_content_plugins_choices">
+ <item>Always on</item>
+ <item>On demand</item>
+ <item>Off</item>
+ </string-array>
+ <string-array name="pref_content_plugins_values">
+ <item>ON</item>
+ <item>ON_DEMAND</item>
+ <item>OFF</item>
+ </string-array>
<!-- Settings summary -->
<string name="pref_content_open_in_background_summary">Open new windows behind the current one</string>
<!-- Settings label -->
android:defaultValue="true"
android:title="@string/pref_content_javascript" />
- <CheckBoxPreference
- android:key="enable_plugins"
- android:defaultValue="true"
- android:title="@string/pref_content_plugins" />
+ <ListPreference
+ android:key="plugin_state"
+ android:title="@string/pref_content_plugins"
+ android:defaultValue="ON"
+ android:entries="@array/pref_content_plugins_choices"
+ android:entryValues="@array/pref_content_plugins_values"
+ android:dialogTitle="@string/pref_content_plugins" />
<CheckBoxPreference
android:key="open_in_background"
// Note: boolean variables are set inside reset function.
private boolean loadsImagesAutomatically;
private boolean javaScriptEnabled;
- private boolean pluginsEnabled;
+ private WebSettings.PluginState pluginState;
private boolean javaScriptCanOpenWindowsAutomatically;
private boolean showSecurityWarnings;
private boolean rememberPasswords;
s.setUseWideViewPort(b.useWideViewPort);
s.setLoadsImagesAutomatically(b.loadsImagesAutomatically);
s.setJavaScriptEnabled(b.javaScriptEnabled);
- s.setPluginsEnabled(b.pluginsEnabled);
+ s.setPluginState(b.pluginState);
s.setJavaScriptCanOpenWindowsAutomatically(
b.javaScriptCanOpenWindowsAutomatically);
s.setDefaultTextEncodingName(b.defaultTextEncodingName);
loadsImagesAutomatically);
javaScriptEnabled = p.getBoolean("enable_javascript",
javaScriptEnabled);
- pluginsEnabled = p.getBoolean("enable_plugins",
- pluginsEnabled);
+ pluginState = WebSettings.PluginState.valueOf(
+ p.getString("plugin_state", pluginState.name()));
javaScriptCanOpenWindowsAutomatically = !p.getBoolean(
"block_popup_windows",
!javaScriptCanOpenWindowsAutomatically);
// is improved.
loadsImagesAutomatically = true;
javaScriptEnabled = true;
- pluginsEnabled = true;
+ pluginState = WebSettings.PluginState.ON;
javaScriptCanOpenWindowsAutomatically = false;
showSecurityWarnings = true;
rememberPasswords = true;