зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
772a6743c1
Коммит
833d25db0d
|
@ -476,10 +476,6 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(.chromeclass-m
|
||||||
max-width: 280px;
|
max-width: 280px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#geolocation-notification {
|
|
||||||
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#geolocation-notification");
|
|
||||||
}
|
|
||||||
|
|
||||||
#addon-progress-notification {
|
#addon-progress-notification {
|
||||||
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#addon-progress-notification");
|
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#addon-progress-notification");
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,6 +464,13 @@
|
||||||
</menulist>
|
</menulist>
|
||||||
</popupnotificationcontent>
|
</popupnotificationcontent>
|
||||||
</popupnotification>
|
</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>
|
</popupset>
|
||||||
|
|
||||||
#ifdef CAN_DRAW_IN_TITLEBAR
|
#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("buttonlabel"), notificationObj.mainAction.label, "main action label matches");
|
||||||
is(notification.getAttribute("buttonaccesskey"), notificationObj.mainAction.accessKey, "main action accesskey 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 secondaryActions = notificationObj.secondaryActions || [];
|
||||||
let actualSecondaryActionsCount = actualSecondaryActions.length;
|
let actualSecondaryActionsCount = actualSecondaryActions.length;
|
||||||
if (secondaryActions.length) {
|
if (secondaryActions.length) {
|
||||||
let lastChild = actualSecondaryActions.item(actualSecondaryActions.length - 1);
|
is(notification.lastChild.tagName, "menuseparator", "menuseparator exists");
|
||||||
is(lastChild.tagName, "menuseparator", "menuseparator exists");
|
|
||||||
actualSecondaryActionsCount--;
|
|
||||||
}
|
}
|
||||||
is(actualSecondaryActionsCount, secondaryActions.length, actualSecondaryActions.length + " secondary actions");
|
is(actualSecondaryActionsCount, secondaryActions.length, actualSecondaryActions.length + " secondary actions");
|
||||||
secondaryActions.forEach(function (a, i) {
|
secondaryActions.forEach(function (a, i) {
|
||||||
|
|
|
@ -903,50 +903,6 @@
|
||||||
</implementation>
|
</implementation>
|
||||||
</binding>
|
</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">
|
<binding id="addon-progress-notification" extends="chrome://global/content/bindings/notification.xml#popup-notification">
|
||||||
<content align="start">
|
<content align="start">
|
||||||
<xul:image class="popup-notification-icon"
|
<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);
|
var browser = chromeWin.gBrowser.getBrowserForDocument(requestingWindow.document);
|
||||||
|
|
||||||
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST);
|
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST);
|
||||||
|
|
|
@ -3006,7 +3006,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.geolocation-text-link {
|
#geolocation-learnmore-link {
|
||||||
-moz-margin-start: 0; /* override default label margin to match description margin */
|
-moz-margin-start: 0; /* override default label margin to match description margin */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче