Add the on-demand setting for plugins.

Requires a change to webkit and the framework.

Bug: 2411524
Change-Id: I874e4e2139eedf4bc9332947fe6513b027e660d9
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1b02aac..3e9a7be 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -312,6 +312,17 @@
     <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 -->
diff --git a/res/xml/browser_preferences.xml b/res/xml/browser_preferences.xml
index 04c0ebe..ee1b306 100644
--- a/res/xml/browser_preferences.xml
+++ b/res/xml/browser_preferences.xml
@@ -78,10 +78,13 @@
                 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"