Verified Commit 49e9c6cb authored by Kathleen Brade's avatar Kathleen Brade Committed by ma1
Browse files

BB 4234: Use the Firefox Update Process for Base Browser.

Windows: disable "runas" code path in updater (15201).
Windows: avoid writing to the registry (16236).
Also includes fixes for tickets 13047, 13301, 13356, 13594, 15406,
  16014, 16909, 24476, and 25909.

Also fix bug 27221: purge the startup cache if the Base Browser
version changed (even if the Firefox version and build ID did
not change), e.g., after a minor Base Browser update.

Also fix 32616: Disable GetSecureOutputDirectoryPath() functionality.

Bug 26048: potentially confusing "restart to update" message

Within the update doorhanger, remove the misleading message that mentions
that windows will be restored after an update is applied, and replace the
"Restart and Restore" button label with an existing
"Restart to update Tor Browser" string.

Bug 28885: notify users that update is downloading

Add a "Downloading Base Browser update" item which appears in the
hamburger (app) menu while the update service is downloading a MAR
file. Before this change, the browser did not indicate to the user
that an update was in progress, which is especially confusing in
Tor Browser because downloads often take some time. If the user
clicks on the new menu item, the about dialog is opened to allow
the user to see download progress.

As part of this fix, the update service was changed to always show
update-related messages in the hamburger menu, even if the update
was started in the foreground via the about dialog or via the
"Check for Tor Browser Update" toolbar menu item. This change is
consistent with the Tor Browser goal of making sure users are
informed about the update process.

Removed #28885 parts of this patch which have been uplifted to Firefox.
parent 303381fa
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -100,9 +100,11 @@ tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME) $(objdir)/macbuild/Contents/MacOS-
	rsync -aL $(DIST)/bin/$(MOZ_APP_NAME) '$(dist_dest)/Contents/MacOS'
	cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/firefox.icns '$(dist_dest)/Contents/Resources/firefox.icns'
	cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/document.icns '$(dist_dest)/Contents/Resources/document.icns'
ifndef BASE_BROWSER_UPDATE
	$(MKDIR) -p '$(dist_dest)/Contents/Library/LaunchServices'
ifdef MOZ_UPDATER
	cp -f '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(dist_dest)/Contents/Library/LaunchServices'
endif
endif
	$(MKDIR) -p '$(dist_dest)/Contents/Frameworks'
	mv '$(dist_dest)/Contents/Resources/ChannelPrefs.framework' '$(dist_dest)/Contents/Frameworks'
+3 −3
Original line number Diff line number Diff line
@@ -43,10 +43,10 @@ function init() {
  }

  // Include the build ID and display warning if this is an "a#" (nightly or aurora) build
  let versionId = "aboutDialog-version";
  let versionId = "basebrowser-about-dialog-version";
  let versionAttributes = {
    version: AppConstants.MOZ_APP_VERSION_DISPLAY,
    bits: Services.appinfo.is64Bit ? 64 : 32,
    version: AppConstants.BASE_BROWSER_VERSION,
    firefoxVersion: AppConstants.MOZ_APP_VERSION_DISPLAY,
  };

  let version = Services.appinfo.version;
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@

    <html:link rel="localization" href="branding/brand.ftl"/>
    <html:link rel="localization" href="browser/aboutDialog.ftl"/>
    <html:link rel="localization" href="toolkit/global/base-browser.ftl"/>
  </linkset>

  <html:div id="aboutDialogContainer">
+3 −0
Original line number Diff line number Diff line
@@ -83,4 +83,7 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("windows", "gtk", "cocoa"):
if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("windows", "gtk"):
    DEFINES["MENUBAR_CAN_AUTOHIDE"] = 1

if CONFIG["BASE_BROWSER_UPDATE"]:
    DEFINES["BASE_BROWSER_UPDATE"] = True

JAR_MANIFESTS += ["jar.mn"]
+34 −2
Original line number Diff line number Diff line
@@ -42,6 +42,9 @@ ChromeUtils.defineLazyGetter(lazy, "gWindowsAlertsService", () => {
    ?.QueryInterface(Ci.nsIWindowsAlertsService);
});

const FORK_VERSION_PREF =
  "browser.startup.homepage_override.basebrowser.version";

// One-time startup homepage override configurations
const ONCE_DOMAINS = ["mozilla.org", "firefox.com"];
const ONCE_PREF = "browser.startup.homepage_override.once";
@@ -116,7 +119,7 @@ const OVERRIDE_NEW_BUILD_ID = 3;
 *       if this is the first run with a new profile.
 *     OVERRIDE_NEW_MSTONE
 *       if this is the first run with a build with a different Gecko milestone
 *       (i.e. right after an upgrade).
 *       or fork version (i.e. right after an upgrade).
 *     OVERRIDE_NEW_BUILD_ID
 *       if this is the first run with a new build ID of the same Gecko
 *       milestone (i.e. after a nightly upgrade).
@@ -135,6 +138,8 @@ function needHomepageOverride(updateMilestones = true) {

  var mstone = Services.appinfo.platformVersion;

  var savedForkVersion = Services.prefs.getCharPref(FORK_VERSION_PREF, null);

  var savedBuildID = Services.prefs.getCharPref(
    "browser.startup.homepage_override.buildID",
    ""
@@ -163,10 +168,28 @@ function needHomepageOverride(updateMilestones = true) {
        "browser.startup.homepage_override.buildID",
        buildID
      );
      Services.prefs.setCharPref(
        FORK_VERSION_PREF,
        AppConstants.BASE_BROWSER_VERSION
      );
    }
    return savedmstone ? OVERRIDE_NEW_MSTONE : OVERRIDE_NEW_PROFILE;
  }

  if (AppConstants.BASE_BROWSER_VERSION != savedForkVersion) {
    if (updateMilestones) {
      Services.prefs.setCharPref(
        "browser.startup.homepage_override.buildID",
        buildID
      );
      Services.prefs.setCharPref(
        FORK_VERSION_PREF,
        AppConstants.BASE_BROWSER_VERSION
      );
    }
    return OVERRIDE_NEW_MSTONE;
  }

  if (buildID != savedBuildID) {
    if (updateMilestones) {
      Services.prefs.setCharPref(
@@ -715,6 +738,10 @@ nsBrowserContentHandler.prototype = {
        "browser.startup.homepage_override.buildID",
        "unknown"
      );

      // We do the same for the fork version.
      let old_forkVersion = Services.prefs.getCharPref(FORK_VERSION_PREF, null);

      override = needHomepageOverride();
      if (override != OVERRIDE_NONE) {
        switch (override) {
@@ -795,9 +822,10 @@ nsBrowserContentHandler.prototype = {
              }
            }

            let old_version = old_forkVersion ? old_forkVersion : old_mstone;
            if (
              update &&
              Services.vc.compare(update.appVersion, old_mstone) > 0
              Services.vc.compare(update.appVersion, old_version) > 0
            ) {
              overridePage = getPostUpdateOverridePage(
                update,
@@ -827,6 +855,10 @@ nsBrowserContentHandler.prototype = {
            }

            overridePage = overridePage.replace("%OLD_VERSION%", old_mstone);
            overridePage = overridePage.replace(
              "%OLD_BASE_BROWSER_VERSION%",
              old_forkVersion
            );
            break;
          }
          case OVERRIDE_NEW_BUILD_ID:
Loading