Index: chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller.mm |
diff --git a/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller.mm b/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller.mm |
index 3c82471808102e4994e0d35bd7cbc7d61f5d630c..bb71b28d4adf1e5a6b6041ca672f389cf5fec65d 100644 |
--- a/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller.mm |
+++ b/chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller.mm |
@@ -21,6 +21,7 @@ |
#import "chrome/browser/ui/cocoa/hover_close_button.h" |
#import "chrome/browser/ui/cocoa/info_bubble_view.h" |
#import "chrome/browser/ui/cocoa/info_bubble_window.h" |
+#import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h" |
#import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
#include "chrome/browser/ui/cocoa/page_info/permission_selector_button.h" |
#include "chrome/browser/ui/cocoa/page_info/split_block_button.h" |
@@ -233,15 +234,6 @@ const NSInteger kFullscreenLeftOffset = 40; |
return self; |
} |
-- (LocationBarDecoration*)decorationForBubble { |
- if (![self hasVisibleLocationBar]) |
- return nullptr; |
- |
- LocationBarViewMac* location_bar = |
- [[self.parentWindow windowController] locationBarBridge]; |
- return location_bar->GetPageInfoDecoration(); |
-} |
- |
+ (NSPoint)getAnchorPointForBrowser:(Browser*)browser { |
NSPoint anchor; |
NSWindow* parentWindow = browser->window()->GetNativeWindow(); |
@@ -291,6 +283,25 @@ const NSInteger kFullscreenLeftOffset = 40; |
[super windowWillClose:notification]; |
} |
+- (void)showWindow:(id)sender { |
+ if ([self hasVisibleLocationBar]) { |
+ decoration_ = [[self.parentWindow windowController] locationBarBridge] |
+ ->GetPageInfoDecoration(); |
+ decoration_->SetActive(true); |
+ } |
+ |
+ [super showWindow:sender]; |
+} |
+ |
+- (void)close { |
+ if (decoration_) { |
+ decoration_->SetActive(false); |
+ decoration_ = nullptr; |
+ } |
+ |
+ [super close]; |
+} |
+ |
- (void)parentWindowWillToggleFullScreen:(NSNotification*)notification { |
// Override the base class implementation, which would have closed the bubble. |
} |