[Pkg-mozext-commits] [requestpolicy] 189/280: overlay: listen for "load" and "unload"

David Prévot taffit at moszumanska.debian.org
Sat May 2 20:30:23 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository requestpolicy.

commit bc6dc4f201c8051fadfc5259c0bdbceb3f3f6459
Author: Martin Kimmerle <dev at 256k.de>
Date:   Tue Jan 27 11:39:16 2015 +0100

    overlay: listen for "load" and "unload"
    
    partly fixes #502
---
 src/content/main/window-manager.jsm | 10 +++-------
 src/content/ui/overlay.js           |  5 +++++
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/content/main/window-manager.jsm b/src/content/main/window-manager.jsm
index 8f0210c..db7c6d5 100644
--- a/src/content/main/window-manager.jsm
+++ b/src/content/main/window-manager.jsm
@@ -110,10 +110,9 @@ let rpWindowManager = (function(self) {
     // # 5 : init the overlay
     // ----------------------
     try {
-      // init and onWindowLoad must be called last, because they assume that
+      // init must be called last, because it assumes that
       // everything else is ready
       window.requestpolicy.overlay.init();
-      window.requestpolicy.overlay.onWindowLoad();
     } catch (e) {
       Logger.warning(Logger.TYPE_ERROR,
                      "An error occurred while initializing the overlay: "+e, e);
@@ -121,11 +120,8 @@ let rpWindowManager = (function(self) {
   }
 
   function unloadFromWindow(window) {
-    // # 5 : "shutdown" the overlay
-    // ----------------------------
-    if (window.requestpolicy) {
-      window.requestpolicy.overlay.onWindowUnload();
-    }
+    // # 5 : the overlay cares itself about shutdown.
+    //       nothing to do here.
 
 
     // # 4 : remove the toolbarbutton
diff --git a/src/content/ui/overlay.js b/src/content/ui/overlay.js
index bbfa39e..ce16888 100644
--- a/src/content/ui/overlay.js
+++ b/src/content/ui/overlay.js
@@ -138,6 +138,11 @@ requestpolicy.overlay = (function() {
         RequestProcessor.addRequestObserver(self);
 
         //self.setContextMenuEnabled(rpPrefBranch.getBoolPref("contextMenu"));
+
+
+        OverlayEnvironment.elManager.addListener(window, "load",
+                                                 self.onWindowLoad);
+        OverlayEnvironment.shutdownOnUnload(window);
       }
     } catch (e) {
       Logger.severe(Logger.TYPE_ERROR,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git



More information about the Pkg-mozext-commits mailing list