Bug 617539 - Remove _MOZILLA_2_0 interfaces, mobile-browser fixup, r=mfinkle
authorBenjamin Smedberg <benjamin@smedbergs.us>
Thu, 24 Mar 2011 14:44:07 -0400
changeset 2940 63d00153d34791b8b6b47d8359a8a621ac2c99c2
parent 2939 8fd524f25466a2b3ab791312488890250376832d
child 2941 5d77401196ed642b1abc80a03be31e42cada935f
push id2480
push userbsmedberg@mozilla.com
push dateFri, 25 Mar 2011 15:04:18 +0000
reviewersmfinkle
bugs617539
Bug 617539 - Remove _MOZILLA_2_0 interfaces, mobile-browser fixup, r=mfinkle
chrome/content/bindings/browser.js
chrome/content/browser-ui.js
chrome/content/browser.js
--- a/chrome/content/bindings/browser.js
+++ b/chrome/content/bindings/browser.js
@@ -328,18 +328,17 @@ let ContentScroll =  {
         if (json.id == 1)
           rootCwu.setResolution(json.scale, json.scale);
 
         let displayport = new Rect(json.x, json.y, json.w, json.h);
         if (displayport.isEmpty())
           break;
 
         // Map ID to element
-        let cwu20 = rootCwu.QueryInterface(Ci.nsIDOMWindowUtils_MOZILLA_2_0_BRANCH);
-        let element = cwu20.findElementWithViewId(json.id);
+        let element = rootCwu.findElementWithViewId(json.id);
         if (!element)
           break;
 
         // Set the scroll offset for this element if specified
         if (json.scrollX >= 0 && json.scrollY >= 0) {
           this.setScrollOffsetForElement(element, json.scrollX, json.scrollY)
           if (json.id == 1)
             this._scrollOffset = this.getScrollOffset(content);
@@ -353,26 +352,25 @@ let ContentScroll =  {
 
         if (json.id == 1) {
           x = Math.round(x * json.scale) / json.scale;
           y = Math.round(y * json.scale) / json.scale;
         }
 
         let win = element.ownerDocument.defaultView;
         let winCwu = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
-        let winCwu20 = winCwu.QueryInterface(Ci.nsIDOMWindowUtils_MOZILLA_2_0_BRANCH);
-        winCwu20.setDisplayPortForElement(x, y, displayport.width, displayport.height, element);
+        winCwu.setDisplayPortForElement(x, y, displayport.width, displayport.height, element);
 
         // XXX If we scrolled during this displayport update, then it is the
         //     end of a pan. Due to bug 637852, there may be seaming issues
         //     with the visible content, so we need to redraw.
         if (json.id == 1 && json.scrollX >= 0 && json.scrollY >= 0)
           win.setTimeout(
             function() {
-              winCwu20.redraw();
+              winCwu.redraw();
             }, 0);
 
         break;
       }
 
       case "Content:SetWindowSize": {
         let cwu = content.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
         cwu.setCSSViewport(json.width, json.height);
@@ -439,18 +437,17 @@ let ContentActive =  {
   },
 
   receiveMessage: function(aMessage) {
     let json = aMessage.json;
     switch (aMessage.name) {
       case "Content:Deactivate":
         docShell.isActive = false;
         let cwu = content.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
-        let cwu20 = cwu.QueryInterface(Ci.nsIDOMWindowUtils_MOZILLA_2_0_BRANCH);
-        cwu20.setDisplayPortForElement(0,0,0,0,content.document.documentElement);
+        cwu.setDisplayPortForElement(0,0,0,0,content.document.documentElement);
         break;
 
       case "Content:Activate":
         docShell.isActive = true;
         break;
     }
   }
 };
--- a/chrome/content/browser-ui.js
+++ b/chrome/content/browser-ui.js
@@ -564,17 +564,17 @@ var BrowserUI = {
     panels.addEventListener("ToolPanelShown", function(aEvent) {
       let viewName = panelViews[panels.selectedPanel.id];
       if (viewName)
         window[viewName].delayedInit();
     }, true);
 
 #ifndef MOZ_OFFICIAL_BRANDING
       setTimeout(function() {
-        let startup = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup_MOZILLA_2_0).getStartupInfo();
+        let startup = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup).getStartupInfo();
         for (let name in startup) {
           if (name != "process")
             Services.console.logStringMessage("[timing] " + name + ": " + (startup[name] - startup.process) + "ms");
         }
       }, 3000);
 #endif
   },
 
--- a/chrome/content/browser.js
+++ b/chrome/content/browser.js
@@ -2591,20 +2591,18 @@ Tab.prototype = {
 
     // Append the browser to the document, which should start the page load
     notification.appendChild(browser);
     Elements.browsers.insertBefore(notification, aInsertBefore);
 
     // stop about:blank from loading
     browser.stop();
 
-    const i = Ci.nsIFrameLoader_MOZILLA_2_0_BRANCH;
     let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
-    let enabler = fl.QueryInterface(i);
-    enabler.renderMode = i.RENDER_MODE_ASYNC_SCROLL;
+    fl.renderMode = Ci.nsIFrameLoader.RENDER_MODE_ASYNC_SCROLL;
 
     return browser;
   },
 
   _destroyBrowser: function _destroyBrowser() {
     if (this._browser) {
       let notification = this._notification;
       let browser = this._browser;