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

Unified Diff: chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm

Issue 1535183002: Call bubble delegate Close function when bubble is closed by tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address rsesek@'s comments Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm b/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm
index 3fd1c0abeefaee948816c1c55113567d00000012..2e8b819bf58c481519bbb60bad34214aa52dc2d6 100644
--- a/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm
+++ b/chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm
@@ -65,6 +65,7 @@ scoped_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() {
base::scoped_nsobject<NSTableView> tableView_;
base::scoped_nsobject<NSButton> connectButton_;
base::scoped_nsobject<NSButton> cancelButton_;
+ bool buttonPressed_;
Browser* browser_; // Weak.
ChooserBubbleDelegate* chooserBubbleDelegate_; // Weak.
@@ -168,6 +169,8 @@ scoped_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() {
removeObserver:self
name:NSWindowDidMoveNotification
object:nil];
+ if (!buttonPressed_)
+ chooserBubbleDelegate_->Close();
bridge_->OnBubbleClosing();
[super windowWillClose:notification];
}
@@ -444,12 +447,14 @@ scoped_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() {
}
- (void)onConnect:(id)sender {
+ buttonPressed_ = true;
NSInteger row = [tableView_ selectedRow];
chooserBubbleDelegate_->Select(row);
[self close];
}
- (void)onCancel:(id)sender {
+ buttonPressed_ = true;
chooserBubbleDelegate_->Cancel();
[self close];
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698