summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/extensions
diff options
context:
space:
mode:
authorandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-21 21:55:36 +0000
committerandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-21 21:55:36 +0000
commit7101d7b13c6a3318e573c3f358853a0d67d5adc9 (patch)
tree4c93e45ae0121241eee17605f1e091584bae9215 /chrome/browser/cocoa/extensions
parentc916426ad0439af17dfb864d7731bfff11badaac (diff)
downloadchromium_src-7101d7b13c6a3318e573c3f358853a0d67d5adc9.zip
chromium_src-7101d7b13c6a3318e573c3f358853a0d67d5adc9.tar.gz
chromium_src-7101d7b13c6a3318e573c3f358853a0d67d5adc9.tar.bz2
[Mac] Fixes a bug where an ExtensionPopupController object's pointer was never being nil'd out when it resigned its key state, leading to a obj_msgSend from a dirty pointer. Also makes sure that other areas of Page Action code are properly using nil instead of NULL where necessary.
BUG=none TEST=none Review URL: http://codereview.chromium.org/508010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/extensions')
-rw-r--r--chrome/browser/cocoa/extensions/browser_actions_controller.mm10
-rw-r--r--chrome/browser/cocoa/extensions/extension_popup_controller.mm6
2 files changed, 11 insertions, 5 deletions
diff --git a/chrome/browser/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/cocoa/extensions/browser_actions_controller.mm
index 66b0d5b..ac6ae70 100644
--- a/chrome/browser/cocoa/extensions/browser_actions_controller.mm
+++ b/chrome/browser/cocoa/extensions/browser_actions_controller.mm
@@ -281,11 +281,13 @@ class ExtensionsServiceObserverBridge : public NotificationObserver {
[owner_ browserActionVisibilityHasChanged];
break;
}
- case NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE:
- if (Details<ExtensionHost>([[owner_ popup] host]) != details)
- return;
- [owner_ hidePopup];
+ case NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE: {
+ ExtensionPopupController* popup = [owner_ popup];
+ if (popup && Details<ExtensionHost>([popup host]) == details)
+ [owner_ hidePopup];
+
break;
+ }
default:
NOTREACHED() << L"Unexpected notification";
}
diff --git a/chrome/browser/cocoa/extensions/extension_popup_controller.mm b/chrome/browser/cocoa/extensions/extension_popup_controller.mm
index b2bc489..204c755 100644
--- a/chrome/browser/cocoa/extensions/extension_popup_controller.mm
+++ b/chrome/browser/cocoa/extensions/extension_popup_controller.mm
@@ -13,6 +13,7 @@
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/profile.h"
+#include "chrome/common/notification_service.h"
// The minimum/maximum dimensions of the popup.
// The minimum is just a little larger than the size of the button itself.
@@ -95,7 +96,10 @@ const NSTimeInterval kAnimationDuration = 0.2;
- (void)windowDidResignKey:(NSNotification *)notification {
DCHECK_EQ([notification object], [self window]);
- [self close];
+ NotificationService::current()->Notify(
+ NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE,
+ Source<Profile>(host_->profile()),
+ Details<ExtensionHost>(host_.get()));
}
- (void)close {