Bug 810794 - Enable to config 'network.cookie.cookieBehavior'. r=mleibovic
authorTetsuharu OHZEKI <saneyuki.s.snyk@gmail.com>
Tue, 13 Nov 2012 18:58:49 -0500
changeset 113171 f82641cc61eb84937e84957f4e8c48bf68cee70c
parent 113170 424d4452324592f6eb1b39a33cc7aef208a2be68
child 113172 f0ac91e2b9247ec305b4f0a2bccea0165b12c05c
push id23859
push useremorley@mozilla.com
push dateWed, 14 Nov 2012 14:36:31 +0000
treeherdermozilla-central@87928cd21b40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmleibovic
bugs810794
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 810794 - Enable to config 'network.cookie.cookieBehavior'. r=mleibovic
mobile/android/base/locales/en-US/android_strings.dtd
mobile/android/base/resources/values/arrays.xml
mobile/android/base/resources/xml/preferences.xml.in
mobile/android/base/strings.xml.in
mobile/android/chrome/content/browser.js
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -66,17 +66,22 @@
 <!ENTITY pref_category_general "General">
 <!ENTITY pref_category_privacy "Privacy &amp; Security">
 <!ENTITY pref_category_content "Content">
 <!ENTITY pref_category_importexport "Import &amp; Export">
 <!ENTITY pref_about_firefox "About &brandShortName;">
 <!ENTITY pref_do_not_track "Tell sites not to track me">
 <!ENTITY pref_telemetry "Send performance data">
 <!ENTITY pref_remember_signons "Remember passwords">
-<!ENTITY pref_cookies "Enable cookies">
+
+<!ENTITY pref_cookies "Cookies">
+<!ENTITY pref_cookies_accept_all "Enabled">
+<!ENTITY pref_cookies_not_accept_foreign "Enabled, excluding 3rd party">
+<!ENTITY pref_cookies_disabled "Disabled">
+
 <!ENTITY pref_char_encoding "Character encoding">
 <!ENTITY pref_char_encoding_on "Show menu">
 <!ENTITY pref_char_encoding_off "Don\'t show menu">
 <!ENTITY pref_clear_private_data "Clear private data">
 <!ENTITY pref_plugins "Plugins">
 <!ENTITY pref_plugins_enabled "Enabled">
 <!ENTITY pref_plugins_tap_to_play "Tap to play">
 <!ENTITY pref_plugins_disabled "Disabled">
--- a/mobile/android/base/resources/values/arrays.xml
+++ b/mobile/android/base/resources/values/arrays.xml
@@ -32,16 +32,26 @@
     <string-array name="pref_char_encoding_entries">
         <item>@string/pref_char_encoding_on</item>
         <item>@string/pref_char_encoding_off</item>
     </string-array>
     <string-array name="pref_char_encoding_values">
         <item>true</item>
         <item>false</item>
     </string-array>
+    <string-array name="pref_cookies_entries">
+        <item>@string/pref_cookies_accept_all</item>
+        <item>@string/pref_cookies_not_accept_foreign</item>
+        <item>@string/pref_cookies_disabled</item>
+    </string-array>
+    <string-array name="pref_cookies_values">
+        <item>0</item>
+        <item>1</item>
+        <item>2</item>
+    </string-array>
     <string-array name="pref_import_android_entries">
         <item>@string/awesomebar_bookmarks_title</item>
         <item>@string/awesomebar_history_title</item>
     </string-array>
     <string-array name="pref_import_android_values">
         <item>true</item>
         <item>true</item>
     </string-array>
--- a/mobile/android/base/resources/xml/preferences.xml.in
+++ b/mobile/android/base/resources/xml/preferences.xml.in
@@ -72,19 +72,21 @@
                             android:defaultValue="false"
                             android:persistent="false" />
 
         <CheckBoxPreference android:key="signon.rememberSignons"
                             android:title="@string/pref_remember_signons"
                             android:defaultValue="true"
                             android:persistent="false" />
 
-        <CheckBoxPreference android:key="network.cookie.cookieBehavior"
-                            android:title="@string/pref_cookies"
-                            android:persistent="false" />
+        <ListPreference android:key="network.cookie.cookieBehavior"
+                        android:title="@string/pref_cookies"
+                        android:entries="@array/pref_cookies_entries"
+                        android:entryValues="@array/pref_cookies_values"
+                        android:persistent="false" />
 
 #ifdef MOZ_TELEMETRY_REPORTING
         <CheckBoxPreference android:key="toolkit.telemetry.enabled"
                             android:title="@string/pref_telemetry"
                             android:persistent="false" />
 #endif
 
         <CheckBoxPreference android:key="privacy.masterpassword.enabled"
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -72,17 +72,22 @@
   <string name="pref_category_general">&pref_category_general;</string>
   <string name="pref_category_privacy">&pref_category_privacy;</string>
   <string name="pref_category_content">&pref_category_content;</string>
   <string name="pref_category_importexport">&pref_category_importexport;</string>
   <string name="pref_about_firefox">&pref_about_firefox;</string>
   <string name="pref_do_not_track">&pref_do_not_track;</string>
   <string name="pref_telemetry">&pref_telemetry;</string>
   <string name="pref_remember_signons">&pref_remember_signons;</string>
+
   <string name="pref_cookies">&pref_cookies;</string>
+  <string name="pref_cookies_accept_all">&pref_cookies_accept_all;</string>
+  <string name="pref_cookies_not_accept_foreign">&pref_cookies_not_accept_foreign;</string>
+  <string name="pref_cookies_disabled">&pref_cookies_disabled;</string>
+
   <string name="pref_char_encoding">&pref_char_encoding;</string>
   <string name="pref_char_encoding_on">&pref_char_encoding_on;</string>
   <string name="pref_char_encoding_off">&pref_char_encoding_off;</string>
   <string name="pref_clear_private_data">&pref_clear_private_data;</string>
   <string name="pref_plugins">&pref_plugins;</string>
   <string name="pref_plugins_enabled">&pref_plugins_enabled;</string>
   <string name="pref_plugins_tap_to_play">&pref_plugins_tap_to_play;</string>
   <string name="pref_plugins_disabled">&pref_plugins_disabled;</string>
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -870,18 +870,18 @@ var BrowserApp = {
         }
 
         // some preferences use integers or strings instead of booleans for
         // indicating enabled/disabled. since the java ui uses the type to
         // determine which ui elements to show, we need to normalize these
         // preferences to be actual booleans.
         switch (prefName) {
           case "network.cookie.cookieBehavior":
-            pref.type = "bool";
-            pref.value = pref.value == 0;
+            pref.type = "string";
+            pref.value = pref.value.toString();
             break;
           case "font.size.inflation.minTwips":
             pref.type = "string";
             pref.value = pref.value.toString();
             break;
         }
 
         prefs.push(pref);
@@ -918,17 +918,17 @@ var BrowserApp = {
     }
 
     // when sending to java, we normalized special preferences that use
     // integers and strings to represent booleans.  here, we convert them back
     // to their actual types so we can store them.
     switch (json.name) {
       case "network.cookie.cookieBehavior":
         json.type = "int";
-        json.value = (json.value ? 0 : 2);
+        json.value = parseInt(json.value);
         break;
       case "font.size.inflation.minTwips":
         json.type = "int";
         json.value = parseInt(json.value);
         break;
     }
 
     if (json.type == "bool") {