Bug 1447831: Part 2 - Remove support for restart-required install prompts. r?aswan draft
authorKris Maglione <maglione.k@gmail.com>
Wed, 21 Mar 2018 15:19:49 -0700
changeset 770863 36a286eb245513d73e3b513accd0db048d8c4f07
parent 770862 3d7c9291315c304e584e052851dbc309b7756ea4
push id103519
push usermaglione.k@gmail.com
push dateWed, 21 Mar 2018 22:31:20 +0000
reviewersaswan
bugs1447831
milestone61.0a1
Bug 1447831: Part 2 - Remove support for restart-required install prompts. r?aswan MozReview-Commit-ID: JMIiF54Cikm
browser/base/content/browser-addons.js
browser/locales/en-US/chrome/browser/browser.properties
browser/themes/shared/addons/addon-install-restart.svg
browser/themes/shared/jar.inc.mn
browser/themes/shared/notification-icons.inc.css
--- a/browser/base/content/browser-addons.js
+++ b/browser/base/content/browser-addons.js
@@ -431,61 +431,29 @@ var gXPInstallObserver = {
               showNotification();
           }, securityDelay);
           break;
         }
       }
       showNotification();
       break; }
     case "addon-install-complete": {
-      let needsRestart = installInfo.installs.some(function(i) {
-        return i.addon.pendingOperations != AddonManager.PENDING_NONE;
-      });
-
       let secondaryActions = null;
       let numAddons = installInfo.installs.length;
 
-      if (needsRestart) {
-        notificationID = "addon-install-restart";
-        if (numAddons == 1) {
-          messageString = gNavigatorBundle.getFormattedString("addonInstalledNeedsRestart",
-                                                              [installInfo.installs[0].name, brandShortName]);
-        } else {
-          messageString = gNavigatorBundle.getString("addonsGenericInstalledNeedsRestart");
-          messageString = PluralForm.get(numAddons, messageString);
-          messageString = messageString.replace("#1", numAddons);
-          messageString = messageString.replace("#2", brandShortName);
-        }
-        action = {
-          label: gNavigatorBundle.getString("addonInstallRestartButton"),
-          accessKey: gNavigatorBundle.getString("addonInstallRestartButton.accesskey"),
-          callback() {
-            BrowserUtils.restartApplication();
-          }
-        };
-        secondaryActions = [{
-          label: gNavigatorBundle.getString("addonInstallRestartIgnoreButton"),
-          accessKey: gNavigatorBundle.getString("addonInstallRestartIgnoreButton.accesskey"),
-          callback: () => {},
-        }];
+      if (numAddons == 1) {
+        messageString = gNavigatorBundle.getFormattedString("addonInstalled",
+                                                            [installInfo.installs[0].name]);
       } else {
-        if (numAddons == 1) {
-          messageString = gNavigatorBundle.getFormattedString("addonInstalled",
-                                                              [installInfo.installs[0].name]);
-        } else {
-          messageString = gNavigatorBundle.getString("addonsGenericInstalled");
-          messageString = PluralForm.get(numAddons, messageString);
-          messageString = messageString.replace("#1", numAddons);
-        }
-        action = null;
+        messageString = gNavigatorBundle.getString("addonsGenericInstalled");
+        messageString = PluralForm.get(numAddons, messageString);
+        messageString = messageString.replace("#1", numAddons);
       }
+      action = null;
 
-      // Remove notification on dismissal, since it's possible to cancel the
-      // install through the addons manager UI, making the "restart" prompt
-      // irrelevant.
       options.removeOnDismissal = true;
       options.persistent = false;
 
       PopupNotifications.show(browser, notificationID, messageString, anchorID,
                               action, secondaryActions, options);
       break; }
     }
   },
@@ -664,41 +632,16 @@ var LightWeightThemeWebInstaller = {
       if (answer) {
         LightWeightThemeWebInstaller._install(data, notify);
       }
     });
   },
 
   _install(newLWTheme, notify) {
     let listener = {
-      onEnabling(aAddon, aRequiresRestart) {
-        if (!aRequiresRestart) {
-          return;
-        }
-
-        let messageString = gNavigatorBundle.getFormattedString("lwthemeNeedsRestart.message",
-          [aAddon.name], 1);
-
-        let action = {
-          label: gNavigatorBundle.getString("lwthemeNeedsRestart.button"),
-          accessKey: gNavigatorBundle.getString("lwthemeNeedsRestart.accesskey"),
-          callback() {
-            BrowserUtils.restartApplication();
-          }
-        };
-
-        let options = {
-          persistent: true
-        };
-
-        PopupNotifications.show(gBrowser.selectedBrowser, "addon-theme-change",
-                                messageString, "addons-notification-icon",
-                                action, null, options);
-      },
-
       onEnabled(aAddon) {
         if (notify) {
           ExtensionsUI.showInstallNotification(gBrowser.selectedBrowser, newLWTheme);
         }
       }
     };
 
     AddonManager.addAddonListener(listener);
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -197,28 +197,16 @@ addonConfirmInstallSomeUnsigned.message=
 # LOCALIZATION NOTE (addonInstalled):
 # %S is the name of the add-on
 addonInstalled=%S has been installed successfully.
 # LOCALIZATION NOTE (addonsGenericInstalled):
 # Semicolon-separated list of plural forms. See:
 # http://developer.mozilla.org/en/docs/Localization_and_Plurals
 # #1 number of add-ons
 addonsGenericInstalled=#1 add-on has been installed successfully.;#1 add-ons have been installed successfully.
-# LOCALIZATION NOTE (addonInstalledNeedsRestart):
-# %1$S is the name of the add-on, %2$S is the application's name
-addonInstalledNeedsRestart=%1$S will be installed after you restart %2$S.
-# LOCALIZATION NOTE (addonsGenericInstalledNeedsRestart):
-# Semicolon-separated list of plural forms. See:
-# http://developer.mozilla.org/en/docs/Localization_and_Plurals
-# #1 number of add-ons. #2 application's name
-addonsGenericInstalledNeedsRestart=#1 add-on will be installed after you restart #2.;#1 add-ons will be installed after you restart #2.
-addonInstallRestartButton=Restart Now
-addonInstallRestartButton.accesskey=R
-addonInstallRestartIgnoreButton=Not Now
-addonInstallRestartIgnoreButton.accesskey=N
 
 # LOCALIZATION NOTE (addonInstallError-1, addonInstallError-2, addonInstallError-3, addonInstallError-4, addonInstallError-5, addonLocalInstallError-1, addonLocalInstallError-2, addonLocalInstallError-3, addonLocalInstallError-4, addonLocalInstallError-5):
 # %1$S is the application name, %2$S is the add-on name
 addonInstallError-1=The add-on could not be downloaded because of a connection failure.
 addonInstallError-2=The add-on could not be installed because it does not match the add-on %1$S expected.
 addonInstallError-3=The add-on downloaded from this site could not be installed because it appears to be corrupt.
 addonInstallError-4=%2$S could not be installed because %1$S cannot modify the needed file.
 addonInstallError-5=%1$S has prevented this site from installing an unverified add-on.
@@ -248,22 +236,16 @@ darkTheme.name=Dark
 darkTheme.description=A theme with a dark color scheme.
 
 # LOCALIZATION NOTE (lwthemeInstallRequest.message2): %S will be replaced with
 # the host name of the site.
 lwthemeInstallRequest.message2=This site (%S) attempted to install a theme.
 lwthemeInstallRequest.allowButton2=Allow
 lwthemeInstallRequest.allowButton.accesskey2=a
 
-# LOCALIZATION NOTE (lwthemeNeedsRestart.message):
-# %S will be replaced with the new theme name.
-lwthemeNeedsRestart.message=%S will be installed after you restart.
-lwthemeNeedsRestart.button=Restart Now
-lwthemeNeedsRestart.accesskey=R
-
 # LOCALIZATION NOTE (popupWarning.message): Semicolon-separated list of plural forms.
 # See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
 # #1 is brandShortName and #2 is the number of pop-ups blocked.
 popupWarning.message=#1 prevented this site from opening a pop-up window.;#1 prevented this site from opening #2 pop-up windows.
 popupWarningButton=Options
 popupWarningButton.accesskey=O
 popupWarningButtonUnix=Preferences
 popupWarningButtonUnix.accesskey=P
deleted file mode 100644
--- a/browser/themes/shared/addons/addon-install-restart.svg
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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/. -->
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
-     width="64" height="64" viewBox="0 0 64 64">
-  <defs>
-    <style>
-      .style-puzzle-piece {
-        fill: url('#gradient-linear-puzzle-piece');
-        fill-opacity: .25;
-      }
-      .style-puzzle-piece-outline {
-        fill: none;
-        stroke-width: 2;
-        stroke: #52b33e;
-        stroke-dasharray: 4 2;
-      }
-      .style-badge-shadow {
-        fill: #0d131a;
-        fill-opacity: .15;
-      }
-      .style-badge-background {
-        fill: #fff;
-      }
-      .style-badge-inside {
-        fill: #00a1e5;
-      }
-      .style-badge-icon {
-        fill: #fff;
-      }
-    </style>
-    <linearGradient id="gradient-linear-puzzle-piece" x1="0%" y1="0%" x2="0%" y2="100%">
-      <stop offset="0%" stop-color="#66cc52" stop-opacity="1"/>
-      <stop offset="100%" stop-color="#60bf4c" stop-opacity="1"/>
-    </linearGradient>
-  </defs>
-  <path class="style-puzzle-piece" d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4-2.5,2.4-5.1c0-3.3-3.9-5.5-7.6-5.5 c-4.6,0-7.4,2.8-7.4,5.5c0,2.6,1.4,4,2.5,5.1c1,1,1.5,1.6,1.5,2.6c0,3.1-3.4,3.4-4.9,3.4c-0.2,0-0.3,0-0.3,0l0,0h0H6 c-1.6,0-3-1.3-3-3l0-12.2l0,0l0,0c0,0-0.1-2.5,1.1-3.9c0.6-0.6,1.3-0.9,2.3-0.9c0.9,0,1.5,0.5,2.3,1.5c1,1.2,2.3,2.6,4.9,2.6 c3.3,0,5-3.6,5-7.3c0-3.4-1.6-7-5-7c-2.6,0-3.9,1.4-4.9,2.6c-0.9,1-1.4,1.5-2.3,1.5c-1,0-1.7-0.3-2.3-0.9C2.8,32.6,3,29.9,3,29.9 l0,0l0,0L3,22c0-1.7,1.3-3,3-3h9.7h0.1l0.1,0c1.6-0.3,4.3-1.4,4.3-4c0-1.4-0.9-2.3-1.6-3.1c-0.9-1-1.8-1.9-1.8-4.1 C16.6,4.6,18.9,3,23.6,3"/>
-  <svg width="32" height="32" x="32" y="0">
-    <ellipse class="style-badge-shadow"     rx="14" ry="15" cx="16" cy="17" />
-    <circle  class="style-badge-background" r="15"  cy="15" cx="16" />
-    <circle  class="style-badge-inside"     r="12"  cy="15" cx="16" />
-    <path    class="style-badge-icon" d="M21,15h-6l2.4-2.4c-0.6-0.4-1.2-0.6-1.9-0.6c-2,0-3.5,1.6-3.5,3.5 c0,2,1.6,3.5,3.5,3.5c1,0,2-0.5,2.6-1.2l1.7,1c-1,1.3-2.6,2.1-4.3,2.1c-3,0-5.5-2.5-5.5-5.5c0-3,2.5-5.5,5.5-5.5 c1.3,0,2.4,0.4,3.3,1.2L21,9V15z"/>
-  </svg>
-</svg>
--- a/browser/themes/shared/jar.inc.mn
+++ b/browser/themes/shared/jar.inc.mn
@@ -13,17 +13,16 @@
 * skin/classic/browser/aboutSessionRestore.css                 (../shared/aboutSessionRestore.css)
   skin/classic/browser/aboutTabCrashed.css                     (../shared/aboutTabCrashed.css)
   skin/classic/browser/aboutWelcomeBack.css                    (../shared/aboutWelcomeBack.css)
   skin/classic/browser/addons/addon-install-blocked.svg        (../shared/addons/addon-install-blocked.svg)
   skin/classic/browser/addons/addon-install-confirm.svg        (../shared/addons/addon-install-confirm.svg)
   skin/classic/browser/addons/addon-install-downloading.svg    (../shared/addons/addon-install-downloading.svg)
   skin/classic/browser/addons/addon-install-error.svg          (../shared/addons/addon-install-error.svg)
   skin/classic/browser/addons/addon-install-installed.svg      (../shared/addons/addon-install-installed.svg)
-  skin/classic/browser/addons/addon-install-restart.svg        (../shared/addons/addon-install-restart.svg)
   skin/classic/browser/addons/addon-install-warning.svg        (../shared/addons/addon-install-warning.svg)
   skin/classic/browser/controlcenter/conn-not-secure.svg       (../shared/controlcenter/conn-not-secure.svg)
   skin/classic/browser/controlcenter/connection.svg            (../shared/controlcenter/connection.svg)
   skin/classic/browser/controlcenter/mcb-disabled.svg          (../shared/controlcenter/mcb-disabled.svg)
   skin/classic/browser/controlcenter/extension.svg             (../shared/controlcenter/extension.svg)
   skin/classic/browser/controlcenter/permissions.svg           (../shared/controlcenter/permissions.svg)
   skin/classic/browser/controlcenter/tracking-protection.svg   (../shared/controlcenter/tracking-protection.svg)
   skin/classic/browser/controlcenter/warning-gray.svg          (../shared/controlcenter/warning-gray.svg)
--- a/browser/themes/shared/notification-icons.inc.css
+++ b/browser/themes/shared/notification-icons.inc.css
@@ -223,19 +223,16 @@ html|*#webRTC-previewVideo {
 #addon-install-confirmation-notification[warning] .popup-notification-icon[popupid="addon-install-confirmation"] {
   list-style-image: url(chrome://browser/skin/addons/addon-install-warning.svg);
 }
 
 .popup-notification-icon[popupid="addon-install-complete"] {
   list-style-image: url(chrome://browser/skin/addons/addon-install-installed.svg);
 }
 
-.popup-notification-icon[popupid="addon-install-restart"] {
-  list-style-image: url(chrome://browser/skin/addons/addon-install-restart.svg);
-}
 /* OFFLINE APPS */
 
 .popup-notification-icon[popupid*="offline-app-requested"],
 .popup-notification-icon[popupid="offline-app-usage"] {
   list-style-image: url(chrome://global/skin/icons/question-64.png);
 }
 
 /* PLUGINS */