| 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);
|
| } 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;
|
|
|