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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 289983002: Show the Translate bubble when the content web view is not focused (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/translate/translate_tab_helper.cc ('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/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 505532d439824ed66747a8df37029e7bba67a2fc..834239433175a9fbeb64957d272d4452b41834eb 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1159,6 +1159,13 @@ void BrowserView::ShowBookmarkAppBubble(
void BrowserView::ShowTranslateBubble(content::WebContents* web_contents,
translate::TranslateStep step,
TranslateErrors::Type error_type) {
+ if (contents_web_view_->HasFocus() &&
+ !GetLocationBarView()->IsMouseHovered()) {
sky 2014/05/15 16:34:56 Why the hovered check? What about users that are u
hajimehoshi 2014/05/16 03:49:50 It's because when an input element is focused and
sky 2014/05/16 17:00:54 Sorry, I still don't get it. Could you outline in
+ content::RenderViewHost* rvh = web_contents->GetRenderViewHost();
+ if (rvh->IsFocusedElementEditable())
+ return;
+ }
+
TranslateTabHelper* translate_tab_helper =
TranslateTabHelper::FromWebContents(web_contents);
LanguageState& language_state = translate_tab_helper->GetLanguageState();
« no previous file with comments | « chrome/browser/translate/translate_tab_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698