merge fx-team to mozilla-central
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 27 Feb 2014 15:34:11 +0100
changeset 171323 4cfb6c61b13789061152cd9b04950b0430ddf81d
parent 171318 f8e801b991bcc20c5eea6b9558b743ab15c73bf9 (current diff)
parent 171322 f5b3819834fecc2791177466c60f0dbb4d5cffa9 (diff)
child 171324 8c7cf76ab17da5da3928c3a7d134141c617fd4ea
child 171403 9cc0d9c8fc7ce54a729a9d61af39acff33e51768
child 171438 fb009d10f3e6d0f47cdc5f4e88b1d359765f118c
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
milestone30.0a1
merge fx-team to mozilla-central
toolkit/mozapps/extensions/service/VersionCheck.php
--- a/browser/components/sessionstore/src/SessionStore.jsm
+++ b/browser/components/sessionstore/src/SessionStore.jsm
@@ -3135,22 +3135,18 @@ let SessionStoreInternal = {
    * to restore the previous session (publicly exposed as restoreLastSession).
    *
    * @param state
    *        The state, presumably from nsISessionStartup.state
    * @returns [defaultState, state]
    */
   _prepDataForDeferredRestore: function ssi_prepDataForDeferredRestore(state) {
     // Make sure that we don't modify the global state as provided by
-    // nsSessionStartup.state. Converting the object to a JSON string and
-    // parsing it again is the easiest way to do that, although not the most
-    // efficient one. Deferred sessions that don't have automatic session
-    // restore enabled tend to be a lot smaller though so that this shouldn't
-    // be a big perf hit.
-    state = JSON.parse(JSON.stringify(state));
+    // nsSessionStartup.state.
+    state = Cu.cloneInto(state, {});
 
     let defaultState = { windows: [], selectedWindow: 1 };
 
     state.selectedWindow = state.selectedWindow || 1;
 
     // Look at each window, remove pinned tabs, adjust selectedindex,
     // remove window if necessary.
     for (let wIndex = 0; wIndex < state.windows.length;) {
--- a/browser/components/sessionstore/src/TabState.jsm
+++ b/browser/components/sessionstore/src/TabState.jsm
@@ -15,16 +15,18 @@ Cu.import("resource://gre/modules/Task.j
 XPCOMUtils.defineLazyModuleGetter(this, "console",
   "resource://gre/modules/devtools/Console.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PrivacyFilter",
   "resource:///modules/sessionstore/PrivacyFilter.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "TabStateCache",
   "resource:///modules/sessionstore/TabStateCache.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "TabAttributes",
   "resource:///modules/sessionstore/TabAttributes.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "Utils",
+  "resource:///modules/sessionstore/Utils.jsm");
 
 /**
  * Module that contains tab state collection methods.
  */
 this.TabState = Object.freeze({
   setSyncHandler: function (browser, handler) {
     TabStateInternal.setSyncHandler(browser, handler);
   },
@@ -146,17 +148,17 @@ let TabStateInternal = {
     if (!browser || !browser.currentURI) {
       // can happen when calling this function right after .addTab()
       return tabData;
     }
     if (browser.__SS_data) {
       // Use the data to be restored when the tab hasn't been
       // completely loaded. We clone the data, since we're updating it
       // here and the caller may update it further.
-      tabData = JSON.parse(JSON.stringify(browser.__SS_data));
+      tabData = Utils.shallowCopy(browser.__SS_data);
       if (tab.pinned)
         tabData.pinned = true;
       else
         delete tabData.pinned;
       tabData.hidden = tab.hidden;
 
       // If __SS_extdata is set then we'll use that since it might be newer.
       if (tab.__SS_extdata)
--- a/browser/components/sessionstore/src/Utils.jsm
+++ b/browser/components/sessionstore/src/Utils.jsm
@@ -36,10 +36,20 @@ this.Utils = Object.freeze({
       return false;
 
     if (host == domain)
       return true;
 
     let prevChar = host[index - 1];
     return (index == (host.length - domain.length)) &&
            (prevChar == "." || prevChar == "/");
+  },
+
+  shallowCopy: function (obj) {
+    let retval = {};
+
+    for (let key of Object.keys(obj)) {
+      retval[key] = obj[key];
+    }
+
+    return retval;
   }
 });
--- a/browser/modules/UITour.jsm
+++ b/browser/modules/UITour.jsm
@@ -21,30 +21,33 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyModuleGetter(this, "UITelemetry",
   "resource://gre/modules/UITelemetry.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "BrowserUITelemetry",
   "resource:///modules/BrowserUITelemetry.jsm");
 
 
 const UITOUR_PERMISSION   = "uitour";
 const PREF_PERM_BRANCH    = "browser.uitour.";
+const PREF_SEENPAGEIDS    = "browser.uitour.seenPageIDs";
 const MAX_BUTTONS         = 4;
 
 const BUCKET_NAME         = "UITour";
 const BUCKET_TIMESTEPS    = [
   1 * 60 * 1000, // Until 1 minute after tab is closed/inactive.
   3 * 60 * 1000, // Until 3 minutes after tab is closed/inactive.
   10 * 60 * 1000, // Until 10 minutes after tab is closed/inactive.
   60 * 60 * 1000, // Until 1 hour after tab is closed/inactive.
 ];
 
+// Time after which seen Page IDs expire.
+const SEENPAGEID_EXPIRY  = 2 * 7 * 24 * 60 * 60 * 1000; // 2 weeks.
 
 
 this.UITour = {
-  seenPageIDs: new Set(),
+  seenPageIDs: null,
   pageIDSourceTabs: new WeakMap(),
   pageIDSourceWindows: new WeakMap(),
   /* Map from browser windows to a set of tabs in which a tour is open */
   originTabs: new WeakMap(),
   /* Map from browser windows to a set of pinned tabs opened by (a) tour(s) */
   pinnedTabs: new WeakMap(),
   urlbarCapture: new WeakMap(),
   appMenuOpenForAnnotation: new Set(),
@@ -110,20 +113,82 @@ this.UITour = {
     }],
     ["urlbar",      {
       query: "#urlbar",
       widgetName: "urlbar-container",
     }],
   ]),
 
   init: function() {
+    // Lazy getter is initialized here so it can be replicated any time
+    // in a test.
+    delete this.seenPageIDs;
+    Object.defineProperty(this, "seenPageIDs", {
+      get: this.restoreSeenPageIDs.bind(this),
+      configurable: true,
+    });
+
     UITelemetry.addSimpleMeasureFunction("UITour",
                                          this.getTelemetry.bind(this));
   },
 
+  restoreSeenPageIDs: function() {
+    delete this.seenPageIDs;
+
+    if (UITelemetry.enabled) {
+      let dateThreshold = Date.now() - SEENPAGEID_EXPIRY;
+
+      try {
+        let data = Services.prefs.getCharPref(PREF_SEENPAGEIDS);
+        data = new Map(JSON.parse(data));
+
+        for (let [pageID, details] of data) {
+
+          if (typeof pageID != "string" ||
+              typeof details != "object" ||
+              typeof details.lastSeen != "number" ||
+              details.lastSeen < dateThreshold) {
+
+            data.delete(pageID);
+          }
+        }
+
+        this.seenPageIDs = data;
+      } catch (e) {}
+    }
+
+    if (!this.seenPageIDs)
+      this.seenPageIDs = new Map();
+
+    this.persistSeenIDs();
+
+    return this.seenPageIDs;
+  },
+
+  addSeenPageID: function(aPageID) {
+    if (!UITelemetry.enabled)
+      return;
+
+    this.seenPageIDs.set(aPageID, {
+      lastSeen: Date.now(),
+    });
+
+    this.persistSeenIDs();
+  },
+
+  persistSeenIDs: function() {
+    if (this.seenPageIDs.size === 0) {
+      Services.prefs.clearUserPref(PREF_SEENPAGEIDS);
+      return;
+    }
+
+    Services.prefs.setCharPref(PREF_SEENPAGEIDS,
+                               JSON.stringify([...this.seenPageIDs]));
+  },
+
   onPageEvent: function(aEvent) {
     let contentDocument = null;
     if (aEvent.target instanceof Ci.nsIDOMHTMLDocument)
       contentDocument = aEvent.target;
     else if (aEvent.target instanceof Ci.nsIDOMHTMLElement)
       contentDocument = aEvent.target.ownerDocument;
     else
       return false;
@@ -156,21 +221,25 @@ this.UITour = {
       }
       Cu.reportError("Discarding tabless UITour event (" + action + ") while not detaching a tab." +
                      "This shouldn't happen!");
       return;
     }
 
     switch (action) {
       case "registerPageID": {
+        // This is only relevant if Telemtry is enabled.
+        if (!UITelemetry.enabled)
+          break;
+
         // We don't want to allow BrowserUITelemetry.BUCKET_SEPARATOR in the
         // pageID, as it could make parsing the telemetry bucket name difficult.
         if (typeof data.pageID == "string" &&
             !data.pageID.contains(BrowserUITelemetry.BUCKET_SEPARATOR)) {
-          this.seenPageIDs.add(data.pageID);
+          this.addSeenPageID(data.pageID);
 
           // Store tabs and windows separately so we don't need to loop over all
           // tabs when a window is closed.
           this.pageIDSourceTabs.set(tab, data.pageID);
           this.pageIDSourceWindows.set(window, data.pageID);
 
           this.setTelemetryBucket(data.pageID);
         }
@@ -439,17 +508,17 @@ this.UITour = {
                  BrowserUITelemetry.BUCKET_SEPARATOR + aType;
 
     BrowserUITelemetry.setExpiringBucket(bucket,
                                          BUCKET_TIMESTEPS);
   },
 
   getTelemetry: function() {
     return {
-      seenPageIDs: [...this.seenPageIDs],
+      seenPageIDs: [...this.seenPageIDs.keys()],
     };
   },
 
   teardownTour: function(aWindow, aWindowClosing = false) {
     aWindow.gBrowser.tabContainer.removeEventListener("TabSelect", this);
     aWindow.PanelUI.panel.removeEventListener("popuphiding", this.hidePanelAnnotations);
     aWindow.PanelUI.panel.removeEventListener("ViewShowing", this.hidePanelAnnotations);
     aWindow.removeEventListener("SSWindowClosing", this);
--- a/browser/modules/test/browser_UITour_registerPageID.js
+++ b/browser/modules/test/browser_UITour_registerPageID.js
@@ -3,33 +3,78 @@
 
 "use strict";
 
 let gTestTab;
 let gContentAPI;
 let gContentWindow;
 
 Components.utils.import("resource:///modules/UITour.jsm");
+Components.utils.import("resource://gre/modules/UITelemetry.jsm");
 Components.utils.import("resource:///modules/BrowserUITelemetry.jsm");
 
 function test() {
+  UITelemetry._enabled = true;
+
   registerCleanupFunction(function() {
-    UITour.seenPageIDs.clear();
+    Services.prefs.clearUserPref("browser.uitour.seenPageIDs");
+    resetSeenPageIDsLazyGetter();
+    UITelemetry._enabled = undefined;
     BrowserUITelemetry.setBucket(null);
+    delete window.UITelemetry;
     delete window.BrowserUITelemetry;
   });
   UITourTest();
 }
 
+function resetSeenPageIDsLazyGetter() {
+  delete UITour.seenPageIDs;
+  // This should be kept in sync with how UITour.init() sets this.
+  Object.defineProperty(UITour, "seenPageIDs", {
+    get: UITour.restoreSeenPageIDs.bind(UITour),
+    configurable: true,
+  });
+}
+
+function checkExpectedSeenPageIDs(expected) {
+  is(UITour.seenPageIDs.size, expected.length, "Should be " + expected.length + " total seen page IDs");
+
+  for (let id of expected)
+    ok(UITour.seenPageIDs.has(id), "Should have seen '" + id + "' page ID");
+
+  let prefData = Services.prefs.getCharPref("browser.uitour.seenPageIDs");
+  prefData = new Map(JSON.parse(prefData));
+
+  is(prefData.size, expected.length, "Should be " + expected.length + " total seen page IDs persisted");
+
+  for (let id of expected)
+    ok(prefData.has(id), "Should have seen '" + id + "' page ID persisted");
+}
+
 let tests = [
-  function test_seenPageIDs_1(done) {
+  function test_seenPageIDs_restore(done) {
+    info("Setting up seenPageIDs to be restored from pref");
+    let data = JSON.stringify([
+      ["savedID1", { lastSeen: Date.now() }],
+      ["savedID2", { lastSeen: Date.now() }],
+      // 3 weeks ago, should auto expire.
+      ["savedID3", { lastSeen: Date.now() - 3 * 7 * 24 * 60 * 60 * 1000 }],
+    ]);
+    Services.prefs.setCharPref("browser.uitour.seenPageIDs",
+                               data);
+
+    resetSeenPageIDsLazyGetter();
+    checkExpectedSeenPageIDs(["savedID1", "savedID2"]);
+
+    done();
+  },
+  function test_seenPageIDs_set_1(done) {
     gContentAPI.registerPageID("testpage1");
 
-    is(UITour.seenPageIDs.size, 1, "Should be 1 seen page ID");
-    ok(UITour.seenPageIDs.has("testpage1"), "Should have seen 'testpage1' page ID");
+    checkExpectedSeenPageIDs(["savedID1", "savedID2", "testpage1"]);
 
     const PREFIX = BrowserUITelemetry.BUCKET_PREFIX;
     const SEP = BrowserUITelemetry.BUCKET_SEPARATOR;
 
     let bucket = PREFIX + "UITour" + SEP + "testpage1";
     is(BrowserUITelemetry.currentBucket, bucket, "Bucket should have correct name");
 
     gBrowser.selectedTab = gBrowser.addTab("about:blank");
@@ -37,22 +82,20 @@ let tests = [
     is(BrowserUITelemetry.currentBucket, bucket,
        "After switching tabs, bucket should be expiring");
 
     gBrowser.removeTab(gBrowser.selectedTab);
     gBrowser.selectedTab = gTestTab;
     BrowserUITelemetry.setBucket(null);
     done();
   },
-  function test_seenPageIDs_2(done) {
+  function test_seenPageIDs_set_2(done) {
     gContentAPI.registerPageID("testpage2");
 
-    is(UITour.seenPageIDs.size, 2, "Should be 2 seen page IDs");
-    ok(UITour.seenPageIDs.has("testpage1"), "Should have seen 'testpage1' page ID");
-    ok(UITour.seenPageIDs.has("testpage2"), "Should have seen 'testpage2' page ID");
+    checkExpectedSeenPageIDs(["savedID1", "savedID2", "testpage1", "testpage2"]);
 
     const PREFIX = BrowserUITelemetry.BUCKET_PREFIX;
     const SEP = BrowserUITelemetry.BUCKET_SEPARATOR;
 
     let bucket = PREFIX + "UITour" + SEP + "testpage2";
     is(BrowserUITelemetry.currentBucket, bucket, "Bucket should have correct name");
 
     gBrowser.removeTab(gTestTab);
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -74,16 +74,52 @@ this.__defineGetter__("gIsInitializing",
 
 function initialize(event) {
   // XXXbz this listener gets _all_ load events for all nodes in the
   // document... but relies on not being called "too early".
   if (event.target instanceof XMLStylesheetProcessingInstruction) {
     return;
   }
   document.removeEventListener("load", initialize, true);
+
+  let globalCommandSet = document.getElementById("globalCommandSet");
+  globalCommandSet.addEventListener("command", function(event) {
+    gViewController.doCommand(event.target.id);
+  });
+
+  let viewCommandSet = document.getElementById("viewCommandSet");
+  viewCommandSet.addEventListener("commandupdate", function(event) {
+    gViewController.updateCommands();
+  });
+  viewCommandSet.addEventListener("command", function(event) {
+    gViewController.doCommand(event.target.id);
+  });
+
+  let detailScreenshot = document.getElementById("detail-screenshot");
+  detailScreenshot.addEventListener("load", function(event) {
+    this.removeAttribute("loading");
+  });
+  detailScreenshot.addEventListener("error", function(event) {
+    this.setAttribute("loading", "error");
+  });
+
+  let addonPage = document.getElementById("addons-page");
+  addonPage.addEventListener("dragenter", function(event) {
+    gDragDrop.onDragOver(event);
+  });
+  addonPage.addEventListener("dragover", function(event) {
+    gDragDrop.onDragOver(event);
+  });
+  addonPage.addEventListener("drop", function(event) {
+    gDragDrop.onDrop(event);
+  });
+  addonPage.addEventListener("keypress", function(event) {
+    gHeader.onKeyPress(event);
+  });
+
   gViewController.initialize();
   gCategories.initialize();
   gHeader.initialize();
   gEventManager.initialize();
   Services.obs.addObserver(sendEMPong, "EM-ping", false);
   Services.obs.notifyObservers(window, "EM-loaded", "");
 
   // If the initial view has already been selected (by a call to loadView from
@@ -674,16 +710,23 @@ var gViewController = {
       isEnabled: function cmd_forward_isEnabled() {
         return gHistory.canGoForward;
       },
       doCommand: function cmd_forward_doCommand() {
         gHistory.forward();
       }
     },
 
+    cmd_focusSearch: {
+      isEnabled: () => true,
+      doCommand: function cmd_focusSearch_doCommand() {
+        gHeader.focusSearchBox();
+      }
+    },
+
     cmd_restartApp: {
       isEnabled: function cmd_restartApp_isEnabled() true,
       doCommand: function cmd_restartApp_doCommand() {
         let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
                          createInstance(Ci.nsISupportsPRBool);
         Services.obs.notifyObservers(cancelQuit, "quit-application-requested",
                                      "restart");
         if (cancelQuit.data)
@@ -1752,16 +1795,29 @@ var gHeader = {
 
   focusSearchBox: function gHeader_focusSearchBox() {
     this._search.focus();
   },
 
   onKeyPress: function gHeader_onKeyPress(aEvent) {
     if (String.fromCharCode(aEvent.charCode) == "/") {
       this.focusSearchBox();
+      return;
+    }
+
+    // XXXunf Temporary until bug 371900 is fixed.
+    let key = document.getElementById("focusSearch").getAttribute("key");
+#ifdef XP_MACOSX
+    let keyModifier = aEvent.metaKey;
+#else
+    let keyModifier = aEvent.ctrlKey;
+#endif
+    if (String.fromCharCode(aEvent.charCode) == key && keyModifier) {
+      this.focusSearchBox();
+      return;
     }
   },
 
   get shouldShowNavButtons() {
     var docshellItem = window.QueryInterface(Ci.nsIInterfaceRequestor)
                              .getInterface(Ci.nsIWebNavigation)
                              .QueryInterface(Ci.nsIDocShellTreeItem);
 
--- a/toolkit/mozapps/extensions/content/extensions.xul
+++ b/toolkit/mozapps/extensions/content/extensions.xul
@@ -13,21 +13,17 @@
 <!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd">
 %extensionsDTD;
 ]>
 
 <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
       xmlns:xhtml="http://www.w3.org/1999/xhtml"
       id="addons-page" title="&addons.windowTitle;"
       role="application" windowtype="Addons:Manager"
-      disablefastfind="true"
-      ondragenter="gDragDrop.onDragOver(event)"
-      ondragover="gDragDrop.onDragOver(event)"
-      ondrop="gDragDrop.onDrop(event)"
-      onkeypress="gHeader.onKeyPress(event)">
+      disablefastfind="true">
 
   <xhtml:link rel="shortcut icon"
               href="chrome://mozapps/skin/extensions/extensionGeneric-16.png"/>
 
   <script type="application/javascript"
           src="chrome://mozapps/content/extensions/extensions.js"/>
   <script type="application/javascript"
           src="chrome://global/content/contentAreaUtils.js"/>
@@ -71,18 +67,18 @@
       <menuitem id="menuitem_about" command="cmd_showItemAbout"
                 label="&cmd.about.label;"
                 accesskey="&cmd.about.accesskey;"/>
     </menupopup>
   </popupset>
 
   <!-- global commands - these act on all addons, or affect the addons manager
        in some other way -->
-  <commandset id="globalCommandSet"
-              oncommand="gViewController.doCommand(event.target.id);">
+  <commandset id="globalCommandSet">
+    <command id="cmd_focusSearch"/>
     <command id="cmd_findAllUpdates"/>
     <command id="cmd_restartApp"/>
     <command id="cmd_goToDiscoverPane"/>
     <command id="cmd_goToRecentUpdates"/>
     <command id="cmd_goToAvailableUpdates"/>
     <command id="cmd_installFromFile"/>
     <command id="cmd_back"/>
     <command id="cmd_forward"/>
@@ -90,19 +86,17 @@
     <command id="cmd_pluginCheck"/>
     <command id="cmd_enableUpdateSecurity"/>
     <command id="cmd_toggleAutoUpdateDefault"/>
     <command id="cmd_resetAddonAutoUpdate"/>
   </commandset>
 
   <!-- view commands - these act on the selected addon -->
   <commandset id="viewCommandSet"
-              events="richlistbox-select" commandupdater="true"
-              oncommandupdate="gViewController.updateCommands();"
-              oncommand="gViewController.doCommand(event.target.id);">
+              events="richlistbox-select" commandupdater="true">
     <command id="cmd_showItemDetails"/>
     <command id="cmd_findItemUpdates"/>
     <command id="cmd_showItemPreferences"/>
     <command id="cmd_showItemAbout"/>
     <command id="cmd_enableItem"/>
     <command id="cmd_disableItem"/>
     <command id="cmd_installItem"/>
     <command id="cmd_purchaseItem"/>
@@ -111,18 +105,19 @@
     <command id="cmd_cancelOperation"/>
     <command id="cmd_contribute"/>
     <command id="cmd_askToActivateItem"/>
     <command id="cmd_alwaysActivateItem"/>
     <command id="cmd_neverActivateItem"/>
   </commandset>
 
   <keyset>
+    <!-- XXXunf Disabled until bug 371900 is fixed. -->
     <key id="focusSearch" key="&search.commandkey;" modifiers="accel"
-         oncommand="gHeader.focusSearchBox();"/>
+         disabled="true"/>
   </keyset>
 
   <!-- main header -->
   <hbox id="header" align="center">
     <toolbarbutton id="back-btn" class="nav-button header-button" command="cmd_back"
             tooltiptext="&cmd.back.tooltip;" hidden="true" disabled="true"/>
     <toolbarbutton id="forward-btn" class="nav-button header-button" command="cmd_forward"
             tooltiptext="&cmd.forward.tooltip;" hidden="true" disabled="true"/>
@@ -513,19 +508,17 @@
                       <label class="disabled-postfix" value="&addon.disabled.postfix;"/>
                       <label class="update-postfix" value="&addon.update.postfix;"/>
                       <spacer flex="5000"/> <!-- Necessary to allow the name to wrap -->
                     </hbox>
                     <label id="detail-creator" class="creator"/>
                   </vbox>
                   <hbox id="detail-desc-container" align="start">
                     <vbox pack="center"> <!-- Necessary to work around bug 394738 -->
-                      <image id="detail-screenshot" hidden="true"
-                             onload="this.removeAttribute('loading');"
-                             onerror="this.setAttribute('loading', 'error');"/>
+                      <image id="detail-screenshot" hidden="true"/>
                     </vbox>
                     <vbox flex="1">
                       <description id="detail-desc"/>
                       <description id="detail-fulldesc"/>
                     </vbox>
                   </hbox>
                   <vbox id="detail-contributions">
                     <description id="detail-contrib-description">
--- a/toolkit/mozapps/extensions/jar.mn
+++ b/toolkit/mozapps/extensions/jar.mn
@@ -1,17 +1,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 toolkit.jar:
 % content mozapps %content/mozapps/
 * content/mozapps/extensions/extensions.xul                     (content/extensions.xul)
   content/mozapps/extensions/extensions.css                     (content/extensions.css)
-  content/mozapps/extensions/extensions.js                      (content/extensions.js)
+* content/mozapps/extensions/extensions.js                      (content/extensions.js)
 * content/mozapps/extensions/extensions.xml                     (content/extensions.xml)
   content/mozapps/extensions/updateinfo.xsl                     (content/updateinfo.xsl)
   content/mozapps/extensions/extensions-content.js              (content/extensions-content.js)
   content/mozapps/extensions/about.xul                          (content/about.xul)
   content/mozapps/extensions/about.js                           (content/about.js)
   content/mozapps/extensions/list.xul                           (content/list.xul)
   content/mozapps/extensions/list.js                            (content/list.js)
   content/mozapps/extensions/blocklist.xul                      (content/blocklist.xul)
deleted file mode 100644
--- a/toolkit/mozapps/extensions/service/VersionCheck.php
+++ /dev/null
@@ -1,221 +0,0 @@
-<?php
-/* -*- Mode: php; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/// config bits:
-$db_server = "";
-$db_user = "";
-$db_pass = "";
-$db_name = "";
-
-// error handling
-function bail ($errstr) {
-    die("Error: " . $errstr);
-}
-
-
-// major.minor.release.build[+]
-// make sure this is a valid version
-function expandversion ($vstr) {
-    $v = explode('.', $vstr);
-
-    if ($vstr == '' || count($v) == 0 || count($v) > 4) {
-        bail ('Bogus version.');
-    }
-
-    $vlen = count($v);
-    $ret = array();
-    $hasplus = 0;
-
-    for ($i = 0; $i < 4; $i++) {
-        if ($i > $vlen-1) {
-            // this version chunk was not specified; give 0
-            $ret[] = 0;
-        } else {
-            $s = $v[$i];
-            if ($i == 3) {
-                // need to check for +
-                $slen = strlen($s);
-                if ($s{$slen-1} == '+') {
-                    $s = substr($s, 0, $slen-1);
-                    $hasplus = 1;
-                }
-            }
-
-            $ret[] = intval($s);
-        }
-    }
-
-    $ret[] = $hasplus;
-
-    return $ret;
-}
-
-function vercmp ($a, $b) {
-    if ($a == $b)
-        return 0;
-
-    $va = expandversion($a);
-    $vb = expandversion($b);
-
-    for ($i = 0; $i < 5; $i++)
-        if ($va[$i] != $vb[$i])
-            return ($vb[$i] - $va[$i]);
-
-    return 0;
-}
-
-
-//
-// These are passed in the GET string
-//
-
-if (!array_key_exists('reqVersion', $_GET))
-    bail ("Invalid request.");
-
-$reqVersion = $_GET['reqVersion'];
-
-if ($reqVersion == 1) {
-
-    if (!array_key_exists('id', $_GET) ||
-        !array_key_exists('version', $_GET) ||
-        !array_key_exists('maxAppVersion', $_GET) ||
-        !array_key_exists('appID', $_GET) ||
-        !array_key_exists('appVersion', $_GET))
-        bail ("Invalid request.");
-
-    $reqItemGuid = $_GET['id'];
-    $reqItemVersion = $_GET['version'];
-    $reqItemMaxAppVersion = $_GET['maxAppVersion'];
-    $reqTargetAppGuid = $_GET['appID'];
-    $reqTargetAppVersion = $_GET['appVersion'];
-} else {
-    // bail
-    bail ("Bad request version received");
-}
-
-// check args
-if (empty($reqItemGuid) || empty($reqItemVersion) || empty($reqTargetAppGuid)) {
-    bail ("Invalid request.");
-}
-
-mysql_connect($db_server, $db_user, $db_pass)
-    || bail ("Failed to connect to database.");
-
-mysql_select_db ($db_name)
-    || bail ("Failed to select database.");
-
-// We need to fetch two things for the database:
-// 1) The current extension version's info, for a possibly updated max version
-// 2) The latest version available, if different from the above.
-//
-// We know:
-//  - $reqItemGuid
-//  - $reqItemVersion
-//  - $reqTargetAppGuid
-//  - $reqTargetAppVersion
-//
-// We need to get:
-//  - extension GUID
-//  - extension version
-//  - extension xpi link
-//  - app ID
-//  - app min version
-//  - app max version
-
-$query = "SELECT t_main.guid AS extguid,
-                 t_version.version AS extversion,
-                 t_version.uri AS exturi,
-                 t_version.minappver AS appminver,
-                 t_version.maxappver AS appmaxver,
-                 t_applications.guid AS appguid
-          FROM t_main, t_version, t_applications
-          WHERE t_main.guid = '" . mysql_real_escape_string($reqItemGuid) . "' AND
-                t_main.id = t_version.id AND
-                t_version.appid = t_applications.appid AND
-                t_applications.guid = '" . mysql_real_escape_string($reqTargetAppGuid) . "'";
-
-$result = mysql_query ($query);
-
-if (!$result) {
-    bail ('Query error: ' . mysql_error());
-}
-
-// info for this version
-$thisVersionData = '';
-// info for highest version
-$highestVersion = '';
-$highestVersionData = '';
-
-while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
-    // is this row for the current version?
-    if ($line['extversion'] == $reqItemVersion) {
-        // if so
-        $thisVersionData = $line;
-    } else if (vercmp ($reqItemVersion, $line['extversion']) > 0) {
-        // did we already see an update with a higher version than this?
-        if ($highestVersion != '' && vercmp ($highestVersion, $line['extversion']) < 0)
-            continue;
-
-        // does this update support my current app version?
-        if (vercmp($line['appmaxver'], $reqTargetAppVersion) > 0 ||
-            vercmp($reqTargetAppVersion, $line['appminver']) > 0)
-            continue;
-
-        $highestVersion = $line['extversion'];
-        $highestVersionData = $line;
-    }
-}
-
-mysql_free_result ($result);
-
-//
-// Now to spit out the RDF.  We hand-generate because the data is pretty simple.
-//
-
-print "<?xml version=\"1.0\"?>\n";
-print "<RDF:RDF xmlns:RDF=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:em=\"http://www.mozilla.org/2004/em-rdf#\">\n\n";
-
-print "<RDF:Description about=\"urn:mozilla:extension:{$reqItemGuid}\">\n";
-
-// output list of updates (just highest and this)
-print " <em:updates><RDF:Seq>\n";
-if (!empty($thisVersionData))
-    print "  <RDF:li resource=\"urn:mozilla:extension:{$reqItemGuid}:{$thisVersionData['extversion']}\"/>\n";
-if (!empty($highestVersionData))
-    print "  <RDF:li resource=\"urn:mozilla:extension:{$reqItemGuid}:{$highestVersionData['extversion']}\"/>\n";
-print " </RDF:Seq></em:updates>\n";
-
-// output compat bits for firefox 0.9
-if (!empty($highestVersionData)) {
-    print " <em:version>{$highestVersionData['extversion']}</em:version>\n";
-    print " <em:updateLink>{$highestVersionData['exturi']}</em:updateLink>\n";
-}
-
-print "</RDF:Description>\n\n";
-
-function print_update ($data) {
-    print "<RDF:Description about=\"urn:mozilla:extension:{$reqItemGuid}:{$data['extversion']}\">\n";
-    print " <em:version>{$data['extversion']}</em:version>\n";
-    print " <em:targetApplication>\n";
-    print "  <RDF:Description>\n";
-    print "   <em:id>{$data['appguid']}</em:id>\n";
-    print "   <em:minVersion>{$data['appminver']}</em:minVersion>\n";
-    print "   <em:maxVersion>{$data['appmaxver']}</em:maxVersion>\n";
-    print "   <em:updateLink>{$data['exturi']}</em:updateLink>\n";
-    print "  </RDF:Description>\n";
-    print " </em:targetApplication>\n";
-    print "</RDF:Description>\n";
-}
-
-if (!empty($thisVersionData))
-    print_update ($thisVersionData);
-if (!empty($highestVersionData))
-    print_update ($highestVersionData);
-
-print "</RDF:RDF>\n";
-
-?>
-