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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 2262913002: fix TranslateBubble toggle off by omnibar icon Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment Created 4 years, 4 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/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 7526dfab7fc0b4cdd8e14626161cb70dec198e1c..dcba089bc5186506f2cbc043ccd305a44c86fd41 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -1609,6 +1609,11 @@ bool IsTabDetachingInFullscreenEnabled() {
}
return;
}
+ if ((base::Time::Now() - translateBubbleClosedTime_).InMilliseconds() < 10) {
+ // The TranslateBubble was just cloed within 10 ms. Do not open it.
+ // It was closed by focus lost when user click on the icon to toggle it off.
+ return;
+ }
std::string sourceLanguage;
std::string targetLanguage;
@@ -1650,6 +1655,7 @@ bool IsTabDetachingInFullscreenEnabled() {
name:NSWindowWillCloseNotification
object:[translateBubbleController_ window]];
translateBubbleController_ = nil;
+ translateBubbleClosedTime_ = base::Time::Now();
}
// If the browser is in incognito mode or has multi-profiles, install the image

Powered by Google App Engine
This is Rietveld 408576698