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

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

Issue 98213002: Don't show the bubble during auto-translating except for the first time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebasing Created 7 years 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 | « no previous file | 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 c0b4c52cde350609be1a01598421203618a3da87..61bde6358ab36bd34ecc904a06970fb70344c359 100644
--- a/chrome/browser/ui/views/translate/translate_bubble_view.cc
+++ b/chrome/browser/ui/views/translate/translate_bubble_view.cc
@@ -142,6 +142,17 @@ void TranslateBubbleView::ShowBubble(views::View* anchor_view,
content::WebContents* web_contents,
TranslateBubbleModel::ViewState type,
Browser* browser) {
+ // During auto-translating, the bubble should not be shown.
+ if (type == TranslateBubbleModel::VIEW_STATE_TRANSLATING ||
+ type == TranslateBubbleModel::VIEW_STATE_AFTER_TRANSLATE) {
+ TranslateTabHelper* translate_tab_helper =
+ TranslateTabHelper::FromWebContents(web_contents);
+ if (!translate_tab_helper ||
+ translate_tab_helper->language_state().InTranslateNavigation()) {
+ return;
+ }
+ }
+
if (IsShowing()) {
// When the user reads the advanced setting panel, the bubble should not be
// changed because he/she is focusing on the bubble.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698