Bug 1162863 - part 1: rename originHost to displayOrigin. r=paolo sr=gavin
authorDão Gottwald <dao@mozilla.com>
Fri, 15 May 2015 14:34:50 +0200
changeset 244108 aa879a1564b53883b5cd5b4b62ea36049194e273
parent 244038 0d7a10374e0053a2f080deee8fc7c7ca06f946b7
child 244109 4b64468e4abcc7a57ca3b9085bb1ec849730834d
push id59841
push userkwierso@gmail.com
push dateSat, 16 May 2015 00:32:11 +0000
treeherdermozilla-inbound@c96edd321122 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaolo, gavin
bugs1162863
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1162863 - part 1: rename originHost to displayOrigin. r=paolo sr=gavin
browser/base/content/browser-addons.js
browser/base/content/test/general/browser_bug553455.js
toolkit/content/widgets/notification.xml
toolkit/modules/PopupNotifications.jsm
toolkit/themes/linux/global/notification.css
toolkit/themes/osx/global/notification.css
toolkit/themes/windows/global/notification.css
--- a/browser/base/content/browser-addons.js
+++ b/browser/base/content/browser-addons.js
@@ -44,17 +44,17 @@ const gXPInstallObserver = {
 
     var notificationID = aTopic;
     // Make notifications persist a minimum of 30 seconds
     var options = {
       timeout: Date.now() + 30000
     };
 
     try {
-      options.originHost = installInfo.originatingURI.host;
+      options.displayOrigin = installInfo.originatingURI.host;
     } catch (e) {
       // originatingURI might be missing or 'host' might throw for non-nsStandardURL nsIURIs.
     }
 
     switch (aTopic) {
     case "addon-install-disabled": {
       notificationID = "xpinstall-disabled";
 
@@ -73,17 +73,17 @@ const gXPInstallObserver = {
           }
         };
       }
 
       PopupNotifications.show(browser, notificationID, messageString, anchorID,
                               action, null, options);
       break; }
     case "addon-install-blocked": {
-      if (!options.originHost) {
+      if (!options.displayOrigin) {
         // Need to deal with missing originatingURI and with about:/data: URIs more gracefully,
         // see bug 1063418 - but for now, bail:
         return;
       }
       messageString = gNavigatorBundle.getFormattedString("xpinstallPromptMessage",
                         [brandShortName]);
 
       let secHistogram = Components.classes["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry).getHistogramById("SECURITY_UI");
@@ -133,17 +133,17 @@ const gXPInstallObserver = {
 
       let acceptButton = document.getElementById("addon-progress-accept");
       acceptButton.label = gNavigatorBundle.getString("addonInstall.acceptButton.label");
       acceptButton.accessKey = gNavigatorBundle.getString("addonInstall.acceptButton.accesskey");
       break; }
     case "addon-install-failed": {
       // TODO This isn't terribly ideal for the multiple failure case
       for (let install of installInfo.installs) {
-        let host = options.originHost;
+        let host = options.displayOrigin;
         if (!host)
           host = (install.sourceURI instanceof Ci.nsIStandardURL) &&
                  install.sourceURI.host;
 
         let error = (host || install.error == 0) ? "addonError" : "addonLocalError";
         if (install.error != 0)
           error += install.error;
         else if (install.addon.blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED)
--- a/browser/base/content/test/general/browser_bug553455.js
+++ b/browser/base/content/test/general/browser_bug553455.js
@@ -200,17 +200,17 @@ function test_disabled_install() {
   gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
 },
 
 function test_blocked_install() {
   // Wait for the blocked notification
   wait_for_notification("addon-install-blocked", function(aPanel) {
     let notification = aPanel.childNodes[0];
     is(notification.button.label, "Allow", "Should have seen the right button");
-    is(notification.getAttribute("originhost"), "example.com",
+    is(notification.getAttribute("origin"), "example.com",
        "Should have seen the right origin host");
     is(notification.getAttribute("label"),
        gApp + " prevented this site from asking you to install software on your computer.",
        "Should have seen the right message");
 
     // Wait for the install confirmation dialog
     wait_for_install_dialog(function() {
       // Wait for the complete notification
--- a/toolkit/content/widgets/notification.xml
+++ b/toolkit/content/widgets/notification.xml
@@ -473,18 +473,18 @@
     <content>
       <xul:vbox>
         <xul:image class="popup-notification-icon"
                    xbl:inherits="popupid,src=icon"/>
       </xul:vbox>
       <xul:vbox>
         <xul:hbox align="start">
           <xul:vbox flex="1">
-            <xul:label class="popup-notification-originHost header"
-                       xbl:inherits="value=originhost"
+            <xul:label class="popup-notification-origin header"
+                       xbl:inherits="value=origin"
                        crop="end"/>
             <xul:description class="popup-notification-description"
                              xbl:inherits="xbl:text=label,popupid"/>
           </xul:vbox>
           <xul:toolbarbutton anonid="closebutton"
                              class="messageCloseButton close-icon popup-notification-closebutton tabbable"
                              xbl:inherits="oncommand=closebuttoncommand"
                              tooltiptext="&closeNotification.tooltip;"/>
--- a/toolkit/modules/PopupNotifications.jsm
+++ b/toolkit/modules/PopupNotifications.jsm
@@ -265,18 +265,19 @@ PopupNotifications.prototype = {
    *        popupIconURL:
    *                     A string. URL of the image to be displayed in the popup.
    *                     Normally specified in CSS using list-style-image and the
    *                     .popup-notification-icon[popupid=...] selector.
    *        learnMoreURL:
    *                     A string URL. Setting this property will make the
    *                     prompt display a "Learn More" link that, when clicked,
    *                     opens the URL in a new tab.
-   *        originHost:  The host name of the page the notification came from.
-   *                     If present, this will be displayed above the message.
+   *        displayOrigin:
+   *                     The host name or file path of the page the notification came
+   *                     from. If present, this will be displayed above the message.
    * @returns the Notification object corresponding to the added notification.
    */
   show: function PopupNotifications_show(browser, id, message, anchorID,
                                          mainAction, secondaryActions, options) {
     function isInvalidAction(a) {
       return !a || !(typeof(a.callback) == "function") || !a.label || !a.accessKey;
     }
 
@@ -562,20 +563,20 @@ PopupNotifications.prototype = {
       if (n.options.popupIconURL)
         popupnotification.setAttribute("icon", n.options.popupIconURL);
 
       if (n.options.learnMoreURL)
         popupnotification.setAttribute("learnmoreurl", n.options.learnMoreURL);
       else
         popupnotification.removeAttribute("learnmoreurl");
 
-      if (n.options.originHost)
-        popupnotification.setAttribute("originhost", n.options.originHost);
+      if (n.options.displayOrigin)
+        popupnotification.setAttribute("origin", n.options.displayOrigin);
       else
-        popupnotification.removeAttribute("originhost");
+        popupnotification.removeAttribute("origin");
 
       popupnotification.notification = n;
 
       if (n.secondaryActions) {
         n.secondaryActions.forEach(function (a) {
           let item = doc.createElementNS(XUL_NS, "menuitem");
           item.setAttribute("label", a.label);
           item.setAttribute("accesskey", a.accessKey);
--- a/toolkit/themes/linux/global/notification.css
+++ b/toolkit/themes/linux/global/notification.css
@@ -62,22 +62,22 @@ notification[type="critical"] {
 }
 
 /* Popup notification */
 
 .popup-notification-description {
   max-width: 24em;
 }
 
-.popup-notification-originHost:not([value]),
+.popup-notification-origin:not([value]),
 .popup-notification-learnmore-link:not([href]) {
   display: none;
 }
 
-.popup-notification-originHost {
+.popup-notification-origin {
   margin-bottom: .3em !important;
 }
 
 .popup-notification-learnmore-link {
   margin-top: .5em !important;
 }
 
 .popup-notification-button-container {
--- a/toolkit/themes/osx/global/notification.css
+++ b/toolkit/themes/osx/global/notification.css
@@ -100,22 +100,22 @@ notification[type="info"]:not([value="tr
 }
 
 /* Popup notification */
 
 .popup-notification-description {
   max-width: 24em;
 }
 
-.popup-notification-originHost:not([value]),
+.popup-notification-origin:not([value]),
 .popup-notification-learnmore-link:not([href]) {
   display: none;
 }
 
-.popup-notification-originHost {
+.popup-notification-origin {
   margin-bottom: .3em !important;
   -moz-margin-start: 0 !important; /* override default label margin to match description margin */
 }
 
 .popup-notification-learnmore-link {
   margin-top: .5em !important;
   -moz-margin-start: 0 !important; /* override default label margin to match description margin */
 }
--- a/toolkit/themes/windows/global/notification.css
+++ b/toolkit/themes/windows/global/notification.css
@@ -57,22 +57,22 @@ notification[type="critical"] {
 }
 
 /* Popup notification */
 
 .popup-notification-description {
   max-width: 24em;
 }
 
-.popup-notification-originHost:not([value]),
+.popup-notification-origin:not([value]),
 .popup-notification-learnmore-link:not([href]) {
   display: none;
 }
 
-.popup-notification-originHost {
+.popup-notification-origin {
   margin-bottom: .3em !important;
 }
 
 .popup-notification-learnmore-link {
   margin-top: .5em !important;
 }
 
 .popup-notification-button-container {