Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Unified Diff: chrome/browser/cocoa/location_bar_view_mac.mm

Issue 508010: [Mac] Fixes a bug where an ExtensionPopupController object's pointer was neve... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/cocoa/location_bar_view_mac.mm
===================================================================
--- chrome/browser/cocoa/location_bar_view_mac.mm (revision 35091)
+++ chrome/browser/cocoa/location_bar_view_mac.mm (working copy)
@@ -486,6 +486,7 @@
: owner_(owner),
profile_(profile),
page_action_(page_action),
+ popup_controller_(nil),
current_tab_id_(-1),
preview_enabled_(false) {
Extension* extension = profile->GetExtensionsService()->GetExtensionById(
@@ -530,7 +531,7 @@
// Adjust the anchor point to be at the center of the page action icon.
arrowPoint.x += [GetImage() size].width / 2;
- popupController_ =
+ popup_controller_ =
[ExtensionPopupController showURL:page_action_->popup_url()
inBrowser:BrowserList::GetLastActive()
anchoredAt:arrowPoint
@@ -623,10 +624,11 @@
switch (type.value) {
case NotificationType::EXTENSION_HOST_VIEW_SHOULD_CLOSE:
// If we aren't the host of the popup, then disregard the notification.
- if (popupController_ &&
- Details<ExtensionHost>([popupController_ host]) == details) {
- HidePopup();
+ if (popup_controller_ == nil ||
Mark Mentovai 2009/12/21 20:54:32 Same comment about early returns applies here.
Bons 2009/12/21 21:01:41 Done.
+ Details<ExtensionHost>([popup_controller_ host]) != details) {
+ return;
}
+ HidePopup();
break;
default:
NOTREACHED() << "Unexpected notification";
@@ -635,8 +637,8 @@
}
void LocationBarViewMac::PageActionImageView::HidePopup() {
- [popupController_ close];
- popupController_ = nil;
+ [popup_controller_ close];
+ popup_controller_ = nil;
}
// PageActionViewList-----------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698