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

Unified Diff: chrome/browser/ui/views/translate/translate_bubble_view.cc

Issue 425223003: Translate: Have the bubble not to steal focus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky's review Created 6 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/views/translate/translate_bubble_view.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/views/translate/translate_bubble_view.cc
diff --git a/chrome/browser/ui/views/translate/translate_bubble_view.cc b/chrome/browser/ui/views/translate/translate_bubble_view.cc
index b79511690abcdd1123484ebd86e012950847a3c8..5d622aaa53b0df84133c8e7ca6dfe6ccd127333a 100644
--- a/chrome/browser/ui/views/translate/translate_bubble_view.cc
+++ b/chrome/browser/ui/views/translate/translate_bubble_view.cc
@@ -126,7 +126,18 @@ void TranslateBubbleView::ShowBubble(
model.Pass(),
error_type,
web_contents);
- views::BubbleDelegateView::CreateBubble(view)->Show();
+ if (is_user_gesture)
+ views::BubbleDelegateView::CreateBubble(view)->Show();
+ else
+ views::BubbleDelegateView::CreateBubble(view)->ShowInactive();
+}
+
+// static
+void TranslateBubbleView::CloseBubble() {
+ if (!IsShowing())
+ return;
+
+ translate_bubble_view_->GetWidget()->Close();
}
// static
« no previous file with comments | « chrome/browser/ui/views/translate/translate_bubble_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698