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/ui/cocoa/website_settings/permission_bubble_controller.mm

Issue 2752623003: [Mac] Fix for the security chip (Closed)
Patch Set: . Created 3 years, 9 months 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/ui/cocoa/website_settings/permission_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm
index f100a7110681144913aaa613dd3a7c3a7d621f08..1c2c976c934085d32da3829a5670ff019069c608 100644
--- a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/website_settings/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/website_settings/permission_bubble_cocoa.h"
#include "chrome/browser/ui/cocoa/website_settings/permission_selector_button.h"
@@ -232,15 +233,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();
@@ -290,6 +282,22 @@ const NSInteger kFullscreenLeftOffset = 40;
[super windowWillClose:notification];
}
+- (void)showWindow:(id)sender {
Robert Sesek 2017/03/15 17:35:09 What about the ![self hasVisibileLocationBar] chec
spqchan 2017/03/15 21:18:47 Whoops, thanks for catching that!
+ decoration_ = [[self.parentWindow windowController] locationBarBridge]
+ ->GetPageInfoDecoration();
+ decoration_->SetActive(true);
+ [super showWindow:sender];
+}
+
+- (void)close {
Robert Sesek 2017/03/15 17:35:09 What's the destruction order of the bubble w.r.t.
spqchan 2017/03/15 21:18:47 The bubble will close before the decoration and th
+ if (decoration_) {
+ decoration_->SetActive(false);
+ decoration_ = nullptr;
+ }
+
+ [super close];
+}
+
- (void)parentWindowWillToggleFullScreen:(NSNotification*)notification {
// Override the base class implementation, which would have closed the bubble.
}

Powered by Google App Engine
This is Rietveld 408576698