Bug 824443 - Put the geolocation prompt's "Learn More" link in <popupnotificationcontent> rather than extending the popup notification's binding. r=gavin

This commit is contained in:
Dão Gottwald 2012-12-25 01:08:13 +01:00
Родитель 772a6743c1
Коммит 833d25db0d
6 изменённых файлов: 15 добавлений и 53 удалений

Просмотреть файл

@ -476,10 +476,6 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(.chromeclass-m
max-width: 280px;
}
#geolocation-notification {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#geolocation-notification");
}
#addon-progress-notification {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#addon-progress-notification");
}

Просмотреть файл

@ -464,6 +464,13 @@
</menulist>
</popupnotificationcontent>
</popupnotification>
<popupnotification id="geolocation-notification" hidden="true">
<popupnotificationcontent orient="vertical" align="start">
<separator class="thin"/>
<label id="geolocation-learnmore-link" class="text-link"/>
</popupnotificationcontent>
</popupnotification>
</popupset>
#ifdef CAN_DRAW_IN_TITLEBAR

Просмотреть файл

@ -707,13 +707,12 @@ function checkPopup(popup, notificationObj) {
is(notification.getAttribute("buttonlabel"), notificationObj.mainAction.label, "main action label matches");
is(notification.getAttribute("buttonaccesskey"), notificationObj.mainAction.accessKey, "main action accesskey matches");
}
let actualSecondaryActions = notification.childNodes;
let actualSecondaryActions = Array.filter(notification.childNodes,
function (child) child.nodeName == "menuitem");
let secondaryActions = notificationObj.secondaryActions || [];
let actualSecondaryActionsCount = actualSecondaryActions.length;
if (secondaryActions.length) {
let lastChild = actualSecondaryActions.item(actualSecondaryActions.length - 1);
is(lastChild.tagName, "menuseparator", "menuseparator exists");
actualSecondaryActionsCount--;
is(notification.lastChild.tagName, "menuseparator", "menuseparator exists");
}
is(actualSecondaryActionsCount, secondaryActions.length, actualSecondaryActions.length + " secondary actions");
secondaryActions.forEach(function (a, i) {

Просмотреть файл

@ -903,50 +903,6 @@
</implementation>
</binding>
<binding id="geolocation-notification" extends="chrome://global/content/bindings/notification.xml#popup-notification">
<content align="start">
<xul:image class="popup-notification-icon"
xbl:inherits="popupid,src=icon"/>
<xul:vbox flex="1">
<xul:description class="popup-notification-description"
xbl:inherits="xbl:text=label"/>
<xul:spacer flex="1"/>
<xul:hbox class="popup-notification-button-container"
pack="end" align="center">
<xul:label anonid="learnmore" class="text-link geolocation-text-link"/>
<xul:spacer flex="1"/>
<xul:button anonid="button"
type="menu-button"
class="popup-notification-menubutton"
xbl:inherits="oncommand=buttoncommand,label=buttonlabel,accesskey=buttonaccesskey">
<xul:menupopup anonid="menupopup"
xbl:inherits="oncommand=menucommand">
<children/>
<xul:menuitem class="menuitem-iconic popup-notification-closeitem"
label="&closeNotificationItem.label;"
xbl:inherits="oncommand=closeitemcommand"/>
</xul:menupopup>
</xul:button>
</xul:hbox>
</xul:vbox>
<xul:vbox pack="start">
<xul:toolbarbutton anonid="closebutton"
class="messageCloseButton popup-notification-closebutton tabbable"
xbl:inherits="oncommand=closebuttoncommand"
tooltiptext="&closeNotification.tooltip;"/>
</xul:vbox>
</content>
<implementation>
<constructor><![CDATA[
let link = document.getAnonymousElementByAttribute(this, "anonid", "learnmore");
link.value = gNavigatorBundle.getString("geolocation.learnMore");
let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
link.href = formatter.formatURLPref("browser.geolocation.warning.infoURL");
]]></constructor>
</implementation>
</binding>
<binding id="addon-progress-notification" extends="chrome://global/content/bindings/notification.xml#popup-notification">
<content align="start">
<xul:image class="popup-notification-icon"

Просмотреть файл

@ -1791,6 +1791,10 @@ ContentPermissionPrompt.prototype = {
}
}
var link = chromeWin.document.getElementById("geolocation-learnmore-link");
link.value = browserBundle.GetStringFromName("geolocation.learnMore");
link.href = Services.urlFormatter.formatURLPref("browser.geolocation.warning.infoURL");
var browser = chromeWin.gBrowser.getBrowserForDocument(requestingWindow.document);
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST);

Просмотреть файл

@ -3006,7 +3006,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
text-decoration: none;
}
.geolocation-text-link {
#geolocation-learnmore-link {
-moz-margin-start: 0; /* override default label margin to match description margin */
}