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

Unified Diff: chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.mm

Issue 2188623007: Fix DCHECK when opening two password bubbles one after another. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: overload Created 4 years, 5 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
« no previous file with comments | « chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.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/passwords/passwords_bubble_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.mm b/chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.mm
index edd89415c1601562f9d4260a267864059f77be7c..8c871a9b6d9b6df94372684c5ac80731118dc133 100644
--- a/chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.mm
+++ b/chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.mm
@@ -45,7 +45,6 @@ ManagePasswordsBubbleCocoa::ManagePasswordsBubbleCocoa(
ManagePasswordsIcon* icon)
: model_(webContents, displayReason),
icon_(icon),
- closing_(false),
controller_(nil),
webContents_(webContents),
bridge_(nil) {
@@ -88,11 +87,17 @@ void ManagePasswordsBubbleCocoa::Show(bool user_action) {
object:[controller_ window]];
}
-void ManagePasswordsBubbleCocoa::Close() {
- if (!closing_) {
- closing_ = true;
- [controller_ close];
+void ManagePasswordsBubbleCocoa::Close(bool no_animation) {
+ if (no_animation) {
+ InfoBubbleWindow* window = base::mac::ObjCCastStrict<InfoBubbleWindow>(
+ [controller_ window]);
+ [window setAllowedAnimations:info_bubble::kAnimateNone];
}
+ [controller_ close];
+}
+
+void ManagePasswordsBubbleCocoa::Close() {
+ Close(false);
}
void ManagePasswordsBubbleCocoa::OnClose() {
@@ -105,10 +110,7 @@ void ManagePasswordsBubbleCocoa::Show(content::WebContents* webContents,
if (bubble_) {
// The bubble is currently shown. It's to be reopened with the new content.
// Disable closing animation so that it's destroyed immediately.
- InfoBubbleWindow* window = base::mac::ObjCCastStrict<InfoBubbleWindow>(
- [bubble_->controller_ window]);
- [window setAllowedAnimations:info_bubble::kAnimateNone];
- bubble_->Close();
+ bubble_->Close(true);
}
DCHECK(!bubble_);
« no previous file with comments | « chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698