Don't show the bubble during auto-translating except for the first time

BUG=324169
TEST=manual

Review URL: https://codereview.chromium.org/98213002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238322 0039d316-1c4b-4281-b951-d872f2087c98
parent 5530e081
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment