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

Unified Diff: chrome/browser/translate/translate_manager.cc

Issue 124833004: Translate New UX: Show bubble when clicking the icon within an automatic translate session (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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 | « no previous file | chrome/browser/ui/views/translate/translate_bubble_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/translate_manager.cc
diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc
index 8f7e85704c3f127a64955555f0cc4128f463d356..7ea609380b4eaad6a0ae0ddb21de746e2a1dfd1c 100644
--- a/chrome/browser/translate/translate_manager.cc
+++ b/chrome/browser/translate/translate_manager.cc
@@ -729,6 +729,17 @@ void TranslateManager::ShowBubble(WebContents* web_contents,
return;
}
+ // During auto-translating, the bubble should not be shown.
+ if (view_state == TranslateBubbleModel::VIEW_STATE_TRANSLATING ||
+ view_state == TranslateBubbleModel::VIEW_STATE_AFTER_TRANSLATE) {
+ TranslateTabHelper* translate_tab_helper =
+ TranslateTabHelper::FromWebContents(web_contents);
+ if (!translate_tab_helper ||
+ translate_tab_helper->language_state().InTranslateNavigation()) {
+ return;
+ }
+ }
+
TranslateBubbleFactory::Show(browser->window(), web_contents, view_state,
error_type);
#else
« no previous file with comments | « no previous file | chrome/browser/ui/views/translate/translate_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698