Backed out changeset 2d0174d68cec (bug 1497087) for mochitest failure on caps/tests/mochitest/test_bug292789.html
authorDorel Luca <dluca@mozilla.com>
Mon, 22 Oct 2018 20:57:41 +0300
changeset 490790 c141c2c31ca1eaacdb62b0be052f742b084b9e56
parent 490789 ae1d789f73409413b98a6f7e7d21d8974e8abd98
child 490791 71f45c79522edff38d673f89b5d00f7f32e1b3fc
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
bugs1497087, 292789
milestone65.0a1
backs out2d0174d68cec998537cb529f688c96cfa729a892
Backed out changeset 2d0174d68cec (bug 1497087) for mochitest failure on caps/tests/mochitest/test_bug292789.html
toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties
toolkit/mozapps/extensions/content/eula.js
toolkit/mozapps/extensions/content/eula.xul
toolkit/mozapps/extensions/content/extensions.xml
toolkit/mozapps/extensions/jar.mn
toolkit/themes/osx/mozapps/extensions/eula.css
toolkit/themes/osx/mozapps/jar.mn
toolkit/themes/shared/non-mac.jar.inc.mn
toolkit/themes/windows/mozapps/extensions/eula.css
--- a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
+++ b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
@@ -192,16 +192,21 @@
 <!ENTITY addon.updateAvailable.label          "An update is available">
 <!ENTITY addon.checkingForUpdates.label       "Checking for updates…">
 <!ENTITY addon.releaseNotes.label             "Release Notes:">
 <!ENTITY addon.loadingReleaseNotes.label      "Loading…">
 <!ENTITY addon.errorLoadingReleaseNotes.label "Sorry, but there was an error loading the release notes.">
 
 <!ENTITY addon.createdBy.label                "By ">
 
+<!ENTITY eula.title                           "End-User License Agreement">
+<!ENTITY eula.width                           "560px">
+<!ENTITY eula.height                          "400px">
+<!ENTITY eula.accept                          "Accept and Install…">
+
 <!ENTITY settings.path.button.label           "Browse…">
 
 <!ENTITY setting.learnmore "Learn More…">
 
 <!ENTITY disabledUnsigned.heading "Some add-ons have been disabled">
 <!-- LOCALIZATION NOTE (disabledUnsigned.description.start, disabledUnsigned.description.findAddonsLink, disabledUnsigned.description.end):
      These entities form a sentence, with
      disabledUnsigned.description.findAddonsLink being a link to an external site. -->
--- a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties
+++ b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties
@@ -86,16 +86,19 @@ details.notification.gmpPending=%1$S wil
 
 installFromFile.dialogTitle=Select add-on to install
 installFromFile.filterName=Add-ons
 
 uninstallAddonTooltip=Uninstall this add-on
 enableAddonTooltip=Enable this add-on
 disableAddonTooltip=Disable this add-on
 
+#LOCALIZATION NOTE (eulaHeader) %S is name of the add-on asking the user to agree to the EULA
+eulaHeader=%S requires that you accept the following End User License Agreement before installation can proceed:
+
 type.extension.name=Extensions
 type.themes.name=Themes
 type.locale.name=Languages
 type.plugin.name=Plugins
 type.dictionary.name=Dictionaries
 type.service.name=Services
 type.legacy.name=Legacy Extensions
 type.unsupported.name=Unsupported
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/content/eula.js
@@ -0,0 +1,26 @@
+// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
+
+/* 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/. */
+
+"use strict";
+
+/* exported Startup */
+
+ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
+
+function Startup() {
+  var bundle = document.getElementById("extensionsStrings");
+  var addon = window.arguments[0].addon;
+
+  document.documentElement.setAttribute("addontype", addon.type);
+
+  var iconURL = AddonManager.getPreferredIconURL(addon, 48, window);
+  if (iconURL)
+    document.getElementById("icon").src = iconURL;
+
+  var label = document.createTextNode(bundle.getFormattedString("eulaHeader", [addon.name]));
+  document.getElementById("heading").appendChild(label);
+  document.getElementById("eula").value = addon.eula;
+}
new file mode 100644
--- /dev/null
+++ b/toolkit/mozapps/extensions/content/eula.xul
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+
+<!-- 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/. -->
+
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://mozapps/skin/extensions/eula.css" type="text/css"?>
+
+<!DOCTYPE window [
+<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
+%brandDTD;
+<!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd">
+%extensionsDTD;
+]>
+
+<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        title="&eula.title;" width="&eula.width;" height="&eula.height;"
+        buttons="accept,cancel" buttonlabelaccept="&eula.accept;"
+        ondialogaccept="window.arguments[0].accepted = true"
+        onload="Startup();">
+
+  <script type="application/javascript" src="chrome://mozapps/content/extensions/eula.js"/>
+  
+  <stringbundleset id="extensionsSet">
+    <stringbundle id="extensionsStrings" src="chrome://mozapps/locale/extensions/extensions.properties"/>
+  </stringbundleset>
+
+  <hbox id="heading-container">
+    <image id="icon"/>
+    <label id="heading" flex="1"/>
+  </hbox>
+  
+  <textbox id="eula" multiline="true" readonly="true" flex="1"/>
+</dialog>
--- a/toolkit/mozapps/extensions/content/extensions.xml
+++ b/toolkit/mozapps/extensions/content/extensions.xml
@@ -431,16 +431,27 @@
         ]]></body>
       </method>
 
       <method name="installRemote">
         <body><![CDATA[
           if (this.mControl.getAttribute("remote") != "true")
             return;
 
+          if (this.mControl.mAddon.eula) {
+            var data = {
+              addon: this.mControl.mAddon,
+              accepted: false,
+            };
+            window.openDialog("chrome://mozapps/content/extensions/eula.xul", "_blank",
+                              "chrome,dialog,modal,centerscreen,resizable=no", data);
+            if (!data.accepted)
+              return;
+          }
+
           delete this.mControl.mAddon;
           this.mControl.mInstall = this.mInstall;
           this.mControl.setAttribute("status", "installing");
           let prompt = Services.prefs.getBoolPref("extensions.webextPermissionPrompts", false);
           if (prompt) {
             this.mInstall.promptHandler = info => new Promise((resolve, reject) => {
               // Skip prompts for non-webextensions
               if (!info.addon.userPermissions) {
--- a/toolkit/mozapps/extensions/jar.mn
+++ b/toolkit/mozapps/extensions/jar.mn
@@ -10,12 +10,14 @@ toolkit.jar:
   content/mozapps/extensions/extensions.css                     (content/extensions.css)
   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/blocklist.xul                      (content/blocklist.xul)
   content/mozapps/extensions/blocklist.js                       (content/blocklist.js)
   content/mozapps/extensions/blocklist.css                      (content/blocklist.css)
   content/mozapps/extensions/blocklist.xml                      (content/blocklist.xml)
+  content/mozapps/extensions/eula.xul                           (content/eula.xul)
+  content/mozapps/extensions/eula.js                            (content/eula.js)
   content/mozapps/extensions/pluginPrefs.xul                    (content/pluginPrefs.xul)
   content/mozapps/extensions/pluginPrefs.js                     (content/pluginPrefs.js)
   content/mozapps/extensions/OpenH264-license.txt               (content/OpenH264-license.txt)
 #endif
new file mode 100644
--- /dev/null
+++ b/toolkit/themes/osx/mozapps/extensions/eula.css
@@ -0,0 +1,43 @@
+/* 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/. */
+
+#icon {
+  list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.svg");
+  max-width: 48px;
+  max-height: 48px;
+  margin-inline-end: 6px;
+}
+
+#eula-dialog[addontype="theme"] #icon {
+  list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.svg");
+}
+
+#eula-dialog[addontype="locale"] #icon {
+  list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.svg");
+}
+
+#eula-dialog[addontype="plugin"] #icon {
+  list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.svg");
+}
+
+#eula-dialog[addontype="dictionary"] #icon {
+  list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.svg");
+}
+
+#heading-container {
+  -moz-box-align: center;
+}
+
+#heading {
+  font-size: 120%;
+}
+
+#eula {
+  -moz-appearance: none;
+  color: -moz-FieldText;
+  background-color: -moz-Field;
+  margin: 1em;
+  border: 1px solid ActiveBorder;
+}
+
--- a/toolkit/themes/osx/mozapps/jar.mn
+++ b/toolkit/themes/osx/mozapps/jar.mn
@@ -8,14 +8,15 @@ toolkit.jar:
   skin/classic/mozapps/downloads/unknownContentType.css           (downloads/unknownContentType.css)
   skin/classic/mozapps/extensions/discover-logo.png               (extensions/discover-logo.png)
   skin/classic/mozapps/extensions/rating-won.png                  (extensions/rating-won.png)
   skin/classic/mozapps/extensions/rating-not-won.png              (extensions/rating-not-won.png)
   skin/classic/mozapps/extensions/cancel.png                      (extensions/cancel.png)
   skin/classic/mozapps/extensions/toolbarbutton-dropmarker.png    (extensions/toolbarbutton-dropmarker.png)
   skin/classic/mozapps/extensions/heart.png                       (extensions/heart.png)
 * skin/classic/mozapps/extensions/extensions.css                  (extensions/extensions.css)
+  skin/classic/mozapps/extensions/eula.css                        (extensions/eula.css)
   skin/classic/mozapps/extensions/blocklist.css                   (extensions/blocklist.css)
   skin/classic/mozapps/plugins/pluginHelp-16.png                  (plugins/pluginHelp-16.png)
   skin/classic/mozapps/profile/profileSelection.css               (profile/profileSelection.css)
   skin/classic/mozapps/update/buttons.png                         (update/buttons.png)
 * skin/classic/mozapps/update/updates.css                         (update/updates.css)
   skin/classic/mozapps/handling/handling.css                      (handling/handling.css)
--- a/toolkit/themes/shared/non-mac.jar.inc.mn
+++ b/toolkit/themes/shared/non-mac.jar.inc.mn
@@ -34,14 +34,15 @@
 
   skin/classic/mozapps/downloads/downloadButtons.png         (../../windows/mozapps/downloads/downloadButtons.png)
   skin/classic/mozapps/downloads/unknownContentType.css      (../../windows/mozapps/downloads/unknownContentType.css)
   skin/classic/mozapps/extensions/blocklist.css              (../../windows/mozapps/extensions/blocklist.css)
   skin/classic/mozapps/extensions/discover-logo.png          (../../windows/mozapps/extensions/discover-logo.png)
   skin/classic/mozapps/extensions/rating-won.png             (../../windows/mozapps/extensions/rating-won.png)
   skin/classic/mozapps/extensions/rating-not-won.png         (../../windows/mozapps/extensions/rating-not-won.png)
   skin/classic/mozapps/extensions/cancel.png                 (../../windows/mozapps/extensions/cancel.png)
+  skin/classic/mozapps/extensions/eula.css                   (../../windows/mozapps/extensions/eula.css)
   skin/classic/mozapps/handling/handling.css                 (../../windows/mozapps/handling/handling.css)
   skin/classic/mozapps/plugins/pluginHelp-16.png             (../../windows/mozapps/plugins/pluginHelp-16.png)
   skin/classic/mozapps/profile/profileSelection.css          (../../windows/mozapps/profile/profileSelection.css)
   skin/classic/mozapps/update/downloadButtons.png            (../../windows/mozapps/update/downloadButtons.png)
 
 % override chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png       chrome://mozapps/skin/extensions/extensionGeneric.svg
new file mode 100644
--- /dev/null
+++ b/toolkit/themes/windows/mozapps/extensions/eula.css
@@ -0,0 +1,43 @@
+/* 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/. */
+
+#icon {
+  list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.svg");
+  max-width: 48px;
+  max-height: 48px;
+  margin-inline-end: 6px;
+}
+
+#eula-dialog[addontype="theme"] #icon {
+  list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.svg");
+}
+
+#eula-dialog[addontype="locale"] #icon {
+  list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.svg");
+}
+
+#eula-dialog[addontype="plugin"] #icon {
+  list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.svg");
+}
+
+#eula-dialog[addontype="dictionary"] #icon {
+  list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.svg");
+}
+
+#heading-container {
+  -moz-box-align: center;
+}
+
+#heading {
+  font-size: 120%;
+}
+
+#eula {
+  -moz-appearance: none;
+  color: -moz-FieldText;
+  background-color: -moz-Field;
+  margin: 1em;
+  border: 1px solid ActiveBorder;
+}
+