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

Unified Diff: chrome/browser/ui/views/profiles/new_avatar_button.cc

Issue 1136693002: Chrome user menu shouldn't close if a tab steals focus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address roger's comments Created 5 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/views/profiles/new_avatar_button.cc
diff --git a/chrome/browser/ui/views/profiles/new_avatar_button.cc b/chrome/browser/ui/views/profiles/new_avatar_button.cc
index 0fa981f6ef08fb36f9c2566b4ac52aaac0c5089a..9cd7ab9cee08c514c6e2ad69531f894dd69adbd6 100644
--- a/chrome/browser/ui/views/profiles/new_avatar_button.cc
+++ b/chrome/browser/ui/views/profiles/new_avatar_button.cc
@@ -120,8 +120,13 @@ NewAvatarButton::~NewAvatarButton() {
}
bool NewAvatarButton::OnMousePressed(const ui::MouseEvent& event) {
- // Prevent the bubble from being re-shown if it's already showing.
- suppress_mouse_released_action_ = ProfileChooserView::IsShowing();
+ // Prevent the bubble from being re-shown if it's already showing in current
+ // browser and Hide it if it's showing in another browser.
+ if (ProfileChooserView::IsShowingInBrowser(browser_) == IS_SHOWING)
+ suppress_mouse_released_action_ = true;
+ else if (ProfileChooserView::IsShowingInBrowser(browser_) ==
+ IS_SHOWING_IN_ANOTHER_BROWSER)
+ ProfileChooserView::Hide();
Roger Tawa OOO till Jul 10th 2015/05/15 14:29:17 Nit: need { and } around if and else blocks. Nit:
gogerald1 2015/05/19 23:35:12 Acknowledged. use local variable to save one funct
return LabelButton::OnMousePressed(event);
}

Powered by Google App Engine
This is Rietveld 408576698