Bug 573536: add 'Learn more' link to geolocation notifications, r=gavin, a=blocking
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Mon, 30 Aug 2010 12:55:17 -0400
changeset 51926 ba1849f86ade7eb01563f67cc1c28fec9e7b5b46
parent 51925 2a26b596a01d34c6728ef7b3c0ffd7318db845b7
child 51927 b5538db7d5eb00c3e28184356680c87e1a426a29
push idunknown
push userunknown
push dateunknown
reviewersgavin, blocking
bugs573536
milestone2.0b6pre
Bug 573536: add 'Learn more' link to geolocation notifications, r=gavin, a=blocking
browser/base/content/browser.css
browser/base/content/urlbarBindings.xml
browser/themes/gnomestripe/browser/browser.css
browser/themes/pinstripe/browser/browser.css
browser/themes/winstripe/browser/browser.css
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -343,8 +343,12 @@ window[chromehidden~="toolbar"] toolbar:
   display: none;
   -moz-user-focus: normal;
 }
 
 #notification-popup-box[anchorid="geo-notification-icon"] > #geo-notification-icon,
 #notification-popup-box[anchorid="addons-notification-icon"] > #addons-notification-icon {
   display: -moz-box;
 }
+
+#geolocation-notification {
+  -moz-binding: url("chrome://browser/content/urlbarBindings.xml#geolocation-notification");
+}
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -683,9 +683,42 @@
             }
             return label;
           ]]>
         </body>
       </method>
 
     </implementation>
   </binding>
+
+  <binding id="geolocation-notification" extends="chrome://global/content/bindings/notification.xml#popup-notification">
+    <content>
+      <xul:image class="popup-notification-icon"
+                 xbl:inherits="popupid"/>
+      <xul:vbox>
+        <xul:description class="popup-notification-description"
+                         xbl:inherits="value=label"/>
+        <xul:spacer flex="1"/>
+        <xul:hbox pack="end">
+          <xul:label anonid="learnmore" class="text-link geolocation-text-link"/>
+          <xul:spacer flex="1"/>
+          <xul:button anonid="button"
+                      class="popup-notification-menubutton"
+                      xbl:inherits="oncommand=buttoncommand,label=buttonlabel,accesskey=buttonaccesskey,type=buttontype">
+            <xul:menupopup anonid="menupopup"
+                           xbl:inherits="oncommand=menucommand">
+              <children/>
+            </xul:menupopup>
+          </xul:button>
+        </xul:hbox>
+      </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>
 </bindings>
--- a/browser/themes/gnomestripe/browser/browser.css
+++ b/browser/themes/gnomestripe/browser/browser.css
@@ -1022,16 +1022,21 @@ toolbar[iconsize="small"] #fullscreen-bu
 .notification-anchor-icon:-moz-focusring {
   outline: 1px dotted -moz-DialogText;
 }
 
 #geo-notification-icon {
   list-style-image: url(chrome://browser/skin/Geolocation-16.png);
 }
 
+.geolocation-text-link {
+  -moz-padding-start: 13px;
+  padding-top: 10px;
+}
+
 #addons-notification-icon {
   list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric-16.png);
 }
 
 /* Feed icon */
 #feed-button,
 #feed-button > .button-box,
 #feed-button:hover:active > .button-box {
--- a/browser/themes/pinstripe/browser/browser.css
+++ b/browser/themes/pinstripe/browser/browser.css
@@ -1854,16 +1854,17 @@ toolbarbutton.chevron > .toolbarbutton-m
   background-color: transparent;
   margin-top: -3px;
   margin-left: -23px;
   min-width: 280px;
   -moz-border-image: url(chrome://browser/skin/hud-panel.png) 26 18 22 50 / 26px 18px 22px 50px repeat;
 }
 
 #notification-popup {
+  color: #fff;
   margin-top: -1px;
   margin-left: -27px;
 }
 
 #notification-popup-box {
   margin: 0 3px;
 }
 
@@ -1877,24 +1878,24 @@ toolbarbutton.chevron > .toolbarbutton-m
   -moz-box-shadow: 0 0 3px 1px -moz-mac-focusring inset,
                    0 0 3px 2px -moz-mac-focusring;
 }
 
 #geo-notification-icon {
   list-style-image: url(chrome://browser/skin/Geolocation-16.png);
 }
 
+.geolocation-text-link {
+  color: #fff;
+}
+
 #addons-notification-icon {
   list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric-16.png);
 }
 
-.popup-notification-description {
-  color: #fff;
-}
-
 .popup-notification-icon {
   width: 64px;
   height: 64px;
   -moz-margin-end: 10px;
 }
 
 .popup-notification-icon[popupid="geolocation"] {
   list-style-image: url(chrome://browser/skin/Geolocation-64.png);
--- a/browser/themes/winstripe/browser/browser.css
+++ b/browser/themes/winstripe/browser/browser.css
@@ -1802,16 +1802,20 @@ toolbarbutton.bookmark-item[dragover="tr
   height: 64px;
   -moz-margin-end: 10px;
 }
 
 .popup-notification-icon[popupid="geolocation"] {
   list-style-image: url(chrome://browser/skin/Geolocation-64.png);
 }
 
+.geolocation-text-link {
+  padding-top: 5px;
+}
+
 .popup-notification-icon[popupid="xpinstall-disabled"],
 .popup-notification-icon[popupid="addon-install-blocked"],
 .popup-notification-icon[popupid="addon-install-failed"],
 .popup-notification-icon[popupid="addon-install-complete"] {
   list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric.png);
   width: 32px;
   height: 32px;
 }