Index: chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm |
diff --git a/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm b/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm |
index 1d67b3cedffdb6280760f5c27215b474202d9af7..6e2bb9c5dbac3632ba044036aaacdc66eb7d6b20 100644 |
--- a/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm |
+++ b/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm |
@@ -31,10 +31,7 @@ void PermissionBubbleCocoa::Show( |
bridge:this]; |
} |
- LocationBarViewMac* location_bar = |
- [[parent_window_ windowController] locationBarBridge]; |
- NSPoint anchor = location_bar->GetPageInfoBubblePoint(); |
- [bubbleController_ showAtAnchor:[parent_window_ convertBaseToScreen:anchor] |
+ [bubbleController_ showAtAnchor:AnchorPoint() |
withDelegate:delegate_ |
forRequests:requests |
acceptStates:accept_state |
@@ -45,6 +42,10 @@ void PermissionBubbleCocoa::Hide() { |
[bubbleController_ close]; |
} |
+bool PermissionBubbleCocoa::IsVisible() { |
+ return bubbleController_ != nil; |
+} |
+ |
void PermissionBubbleCocoa::SetDelegate(Delegate* delegate) { |
if (delegate_ == delegate) |
return; |
@@ -62,3 +63,14 @@ bool PermissionBubbleCocoa::CanAcceptRequestUpdate() { |
void PermissionBubbleCocoa::OnBubbleClosing() { |
bubbleController_ = nil; |
} |
+ |
+NSPoint PermissionBubbleCocoa::AnchorPoint() { |
+ LocationBarViewMac* location_bar = |
+ [[parent_window_ windowController] locationBarBridge]; |
+ NSPoint anchor = location_bar->GetPageInfoBubblePoint(); |
+ return [parent_window_ convertBaseToScreen:anchor]; |
+} |
+ |
+NSWindow* PermissionBubbleCocoa::window() { |
+ return [bubbleController_ window]; |
+} |