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

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

Issue 2018013002: Refresh the password bubble if it's open when the second request comes in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 7 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/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 dbdcbb34a71f321c12c4e4edfdafe57a4de9c0a5..edd89415c1601562f9d4260a267864059f77be7c 100644
--- a/chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.mm
+++ b/chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.mm
@@ -4,9 +4,11 @@
#import "chrome/browser/ui/cocoa/passwords/passwords_bubble_cocoa.h"
+#include "base/mac/foundation_util.h"
#include "base/mac/scoped_block.h"
#include "chrome/browser/ui/browser_finder.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
+#import "chrome/browser/ui/cocoa/info_bubble_window.h"
#include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
#include "chrome/browser/ui/cocoa/location_bar/manage_passwords_decoration.h"
#import "chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.h"
@@ -100,13 +102,15 @@ void ManagePasswordsBubbleCocoa::OnClose() {
// static
void ManagePasswordsBubbleCocoa::Show(content::WebContents* webContents,
bool user_action) {
- if (bubble_ && (bubble_->webContents_ != webContents)) {
- // The bubble is currently shown for some other tab. We should close it now
- // and open for |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();
}
- if (bubble_)
- return;
+ DCHECK(!bubble_);
NSWindow* window = [webContents->GetNativeView() window];
if (!window) {

Powered by Google App Engine
This is Rietveld 408576698