~ubuntu-branches/ubuntu/oneiric/ubufox/oneiric-proposed

« back to all changes in this revision

Viewing changes to content/updateRestart.js

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2011-01-01 14:30:25 UTC
  • Revision ID: james.westby@ubuntu.com-20110101143025-52ew6ngsqev5gcqn
Tags: 0.9~rc2-0ubuntu7
* Add patch to update for Firefox 4:
  - Rename AboutHome to AboutStartup, and have it handle about:startup now 
    (to not conflict with the new about:home handler in Firefox
  - Set default home page to about:startpage
  - Add support for the XPCOM changes in Gecko 2.0
  - In the restart notifier, don't hardcode a list of filenames for different
    browser versions, but just use MOZ_APP_LAUNCHER instead. This will
    indirectly fix LP: #511250 and should prevent it from happening again
  - Look in the new location for the restart-required trigger, it has moved
    to a location not monitored by update-notifier now, so we only get the
    restart required notification in the browser
  - Merge the plugin finder code from Firefox 4. This now uses AddonManager,
    so the MinVersion needs to be bumped
  - Drop the FF2.0 specific code
  - Drop the AddonsOverlay and associated code, this hasn't worked for
    several releases since we started using software-center, and nobody
    really noticed so far. We can reimplement this at a later date if wanted,
    but it throws JS exceptions when loading in FF4.0 now
  - Specify for the extension to be unpacked by the installer. Without this,
    the prefs aren't used
  - Get the distributionID field for the pfs URL from the preferences, rather
    than hard-coding a value

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
function checkUpdate()
79
79
{
80
80
  var resReqFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
81
 
  var versionString = null;
82
 
  try {
83
 
    versionString = Components.classes["@mozilla.org/fuel/application;1"].getService(Components.interfaces.extIApplication).version;
84
 
  } catch (e) {
85
 
  }
86
 
  if (versionString != null && String_startsWith (versionString, "3.0"))
87
 
    resReqFile.initWithPath("/var/lib/update-notifier/user.d/firefox-3.0-restart-required");
88
 
  else if (versionString != null && String_startsWith (versionString, "3.5"))
89
 
    resReqFile.initWithPath("/var/lib/update-notifier/user.d/firefox-3.5-restart-required");
90
 
  else if (versionString != null && String_startsWith (versionString, "3.6"))
91
 
    resReqFile.initWithPath("/var/lib/update-notifier/user.d/firefox-3.6-restart-required");
92
 
  else if (versionString != null && String_startsWith (versionString, "3.7"))
93
 
    resReqFile.initWithPath("/var/lib/update-notifier/user.d/firefox-3.7-restart-required");
94
 
  else { // not supported version - skip restart notification
 
81
  var launcher = Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment).get("MOZ_APP_LAUNCHER");
 
82
  if(launcher == null) {
95
83
    return;
96
84
  }
97
85
 
 
86
  try {
 
87
    // If the launcher is a full path, just get the basename
 
88
    resReqFile.initWithPath(launcher);
 
89
    launcher = resReqFile.leafName;
 
90
  } catch (e) { // initWithPath will throw if the path is relative
 
91
  }
 
92
 
 
93
  resReqFile.initWithPath("/var/run/" + launcher + "-restart-required");
 
94
 
98
95
  if(resReqFile.exists())
99
96
  {
100
97
    var dateResReq = resReqFile.lastModifiedTime;