Chromium Code Reviews| 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----------------------------------------------------------- |