bug 878905 use document title for menuitem label in camera menu, r=dao
authorShane Caraveo <scaraveo@mozilla.com>
Mon, 03 Jun 2013 14:37:02 -0700
changeset 164443 a4c2df11b142bbca37f7fd5e878347a00fce8b3e
parent 164419 211337f7fb83f9549096d7ecbc95649103605bbb
child 164444 ff0cb6c1f106c3a5419bd0f7a9463d39421f7959
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs878905
milestone27.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 878905 use document title for menuitem label in camera menu, r=dao
browser/base/content/browser-webrtcUI.js
--- a/browser/base/content/browser-webrtcUI.js
+++ b/browser/base/content/browser-webrtcUI.js
@@ -19,19 +19,27 @@ let WebrtcIndicator = {
 
   updateButton: function () {
     this.button.hidden = !this.UIModule.showGlobalIndicator;
   },
 
   fillPopup: function (aPopup) {
     this._menuitemData = new WeakMap;
     for (let streamData of this.UIModule.activeStreams) {
+      let pageURI = Services.io.newURI(streamData.uri, null, null);
       let menuitem = document.createElement("menuitem");
-      menuitem.setAttribute("label", streamData.uri);
+      menuitem.setAttribute("class", "menuitem-iconic");
+      menuitem.setAttribute("label", streamData.browser.contentTitle || streamData.uri);
       menuitem.setAttribute("tooltiptext", streamData.uri);
+      PlacesUtils.favicons.getFaviconURLForPage(pageURI, function (aURI) {
+        if (aURI) {
+          let iconURL = PlacesUtils.favicons.getFaviconLinkForIcon(aURI).spec;
+          menuitem.setAttribute("image", iconURL);
+        }
+      });
 
       this._menuitemData.set(menuitem, streamData);
 
       aPopup.appendChild(menuitem);
     }
   },
 
   clearPopup: function (aPopup) {