Bug 856406 Tabbed browser should use favicon service in a privacy-aware way r=Ratty a=IanN
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Fri, 05 Apr 2013 21:56:31 +0100
changeset 14970 73971e6fef8d05c63e78cb8a77d41bf289a97c58
parent 14967 6ef37899b559fa3971f35c625f4bd01115912dac
child 14971 186f171a3d401b11b4981f9e817e4edd6395c79e
push id870
push userneil@parkwaycc.co.uk
push dateFri, 05 Apr 2013 21:17:14 +0000
treeherdercomm-beta@997fbd08ee62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRatty, IanN
bugs856406
Bug 856406 Tabbed browser should use favicon service in a privacy-aware way r=Ratty a=IanN
suite/browser/navigator.js
suite/browser/tabbrowser.xml
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -470,16 +470,17 @@ function Startup()
     gPrivate = window;
     document.documentElement.setAttribute("windowtype", "navigator:private");
     var titlemodifier = document.documentElement.getAttribute("titlemodifier");
     if (titlemodifier)
       titlemodifier += " ";
     titlemodifier += document.documentElement.getAttribute("titleprivate");
     document.documentElement.setAttribute("titlemodifier", titlemodifier);
     document.title = titlemodifier;
+    gBrowser.mFaviconFlags = gBrowser.mFaviconService.FAVICON_LOAD_PRIVATE;
   }
 
   // initialize observers and listeners
   var xw = lc.QueryInterface(Components.interfaces.nsIDocShellTreeItem)
              .treeOwner
              .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
              .getInterface(Components.interfaces.nsIXULWindow);
   xw.XULBrowserWindow = window.XULBrowserWindow = new nsBrowserStatusHandler();
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -154,18 +154,18 @@
         new Array()
       </field>
       <field name="mTabFilters">
         new Array()
       </field>
       <field name="mLastRelatedIndex">
         0
       </field>
-      <field name="mMissedIconCache">
-        null
+      <field name="mFaviconFlags">
+        this.mFaviconService.FAVICON_LOAD_NON_PRIVATE
       </field>
       <field name="mContextTab">
         null
       </field>
       <field name="_keyEventHandler" readonly="true">
       <![CDATA[({
         handleEvent: function handleEvent(aEvent) {
           if (aEvent.altKey)
@@ -702,17 +702,17 @@
             var browser = aTab.linkedBrowser;
             if (!(aURI instanceof Components.interfaces.nsIURI))
               aURI = this.mIOService.newURI(aURI, null, null);
             browser.mIconURL = aURI.spec;
 
             if (aURI && this.mFaviconService) {
               this.mFaviconService.setAndFetchFaviconForPage(browser.currentURI,
                                                              aURI, false,
-                                                             this.mFaviconService.FAVICON_LOAD_NON_PRIVATE);
+                                                             this.mFaviconFlags);
             }
 
             this.updateIcon(aTab);
 
             this._callProgressListeners(browser, "onLinkIconAvailable",
                                         [browser.mIconURL]);
           ]]>
         </body>
@@ -774,17 +774,17 @@
         <parameter name="aURI"/>
         <parameter name="aAttr"/>
         <parameter name="aElt"/>
         <body>
           <![CDATA[
             var iconURL = this.buildFavIconString(aURI);
             if (this.mFaviconService) {
               let uri = this.mIOService.newURI(iconURL, null, null);
-              this.mFaviconService.setAndFetchFaviconForPage(aURI, uri, false, this.mFaviconService.FAVICON_LOAD_NON_PRIVATE);
+              this.mFaviconService.setAndFetchFaviconForPage(aURI, uri, false, this.mFaviconFlags);
               if (this.mFaviconService.isFailedFavicon(uri))
                 return;
             }
             aElt.setAttribute(aAttr, iconURL);
           ]]>
         </body>
       </method>