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

Unified Diff: chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm

Issue 2558443004: [Mac] Fixed the content settings bubble (Closed)
Patch Set: Created 4 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
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/content_setting_decoration.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
index 9023fa56e19d727de9188a90d645104284b1f709..65f422262d1e3a2414e9eb3398d5ecb9fa092fab 100644
--- a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
@@ -309,11 +309,19 @@ bool ContentSettingDecoration::OnMousePressed(NSRect frame, NSPoint location) {
[web_contents->GetTopLevelNativeWindow() contentView],
model, web_contents, origin);
Avi (use Gerrit) 2016/12/06 20:01:38 Does the bug show in MacViews?
} else {
- [ContentSettingBubbleController showForModel:model
- webContents:web_contents
- parentWindow:[field window]
- decoration:this
- anchoredAt:anchor];
+ // If the bubble is already opened, close it. Otherwise, open a new bubble.
+ if (bubbleWindow_ && [bubbleWindow_ isVisible]) {
+ [bubbleWindow_ close];
+ bubbleWindow_.reset();
+ } else {
+ ContentSettingBubbleController* bubbleController =
+ [ContentSettingBubbleController showForModel:model
+ webContents:web_contents
+ parentWindow:[field window]
+ decoration:this
+ anchoredAt:anchor];
+ bubbleWindow_.reset([[bubbleController window] retain]);
+ }
}
return true;
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/content_setting_decoration.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698