Bug 639134 - migrate users of the old pref, r=jaws
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 26 Nov 2014 23:13:57 +0000
changeset 218461 e15514e6321fad434e00aabb28a29206e706554c
parent 218460 460d573b88222bf0c34a431ce3e83dfbf67f593c
child 218462 42ce3ca2e600bc2ff2ae03a0c9bbcb47d8dc1270
push idunknown
push userunknown
push dateunknown
reviewersjaws
bugs639134
milestone37.0a1
Bug 639134 - migrate users of the old pref, r=jaws
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1454,17 +1454,17 @@ BrowserGlue.prototype = {
     var notifyBox = win.gBrowser.getNotificationBox();
     var notification = notifyBox.appendNotification(text, title, null,
                                                     notifyBox.PRIORITY_CRITICAL_MEDIUM,
                                                     buttons);
     notification.persistence = -1; // Until user closes it
   },
 
   _migrateUI: function BG__migrateUI() {
-    const UI_VERSION = 26;
+    const UI_VERSION = 27;
     const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
     let currentUIVersion = 0;
     try {
       currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
     } catch(ex) {}
     if (currentUIVersion >= UI_VERSION)
       return;
 
@@ -1764,16 +1764,25 @@ BrowserGlue.prototype = {
 
       // Typed behavior will be used only for results from history.
       if (defaultBehavior != -1 &&
           !!(defaultBehavior & Ci.mozIPlacesAutoComplete["BEHAVIOR_TYPED"])) {
         Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);
       }
     }
 
+    if (currentUIVersion < 27) {
+      // Fix up document color use:
+      const kOldColorPref = "browser.display.use_document_colors";
+      if (Services.prefs.prefHasUserValue(kOldColorPref) &&
+          !Services.prefs.getBoolPref(kOldColorPref)) {
+        Services.prefs.setIntPref("browser.display.document_color_use", 2);
+      }
+    }
+
     // Update the migration version.
     Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
   },
 
   // ------------------------------
   // public nsIBrowserGlue members
   // ------------------------------