Bug 818295 - [inspector] 'changes may be lost' notification should be on the browser, not the toolbox, r=paul
authorGirish Sharma <scrapmachines@gmail.com>
Sat, 22 Dec 2012 15:50:55 +0530
changeset 126686 2123f21f977a0455f9a39f0eb72ff4ab2bcd2d7a
parent 126685 eb2f66be4cc490052c8da3b5b676ed77747aab4a
child 126687 c7d1fb2a2248d83c74ee0f26006c7a434a5f8ea3
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaul
bugs818295
milestone20.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 818295 - [inspector] 'changes may be lost' notification should be on the browser, not the toolbox, r=paul
browser/devtools/inspector/InspectorPanel.jsm
--- a/browser/devtools/inspector/InspectorPanel.jsm
+++ b/browser/devtools/inspector/InspectorPanel.jsm
@@ -223,17 +223,25 @@ InspectorPanel.prototype = {
    */
   preventNavigateAway: function InspectorPanel_preventNavigateAway(event, request) {
     if (!this.isDirty) {
       return;
     }
 
     request.suspend();
 
-    let notificationBox = this._toolbox.getNotificationBox();
+    let notificationBox = null;
+    if (this.target.isLocalTab) {
+      let gBrowser = this.target.tab.ownerDocument.defaultView.gBrowser;
+      notificationBox = gBrowser.getNotificationBox();
+    }
+    else {
+      notificationBox = this._toolbox.getNotificationBox();
+    }
+
     let notification = notificationBox.
       getNotificationWithValue("inspector-page-navigation");
 
     if (notification) {
       notificationBox.removeNotification(notification, true);
     }
 
     let cancelRequest = function onCancelRequest() {