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

Unified Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 1374583003: Unnecessary 'translate to English' option is displayed in context menu in PDF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_context_menu/render_view_context_menu.cc
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index 5a4ab40131b9e7646e31a3ba46e0a045871eb86b..6bcd32668f3ccedab7d7aa8d94ba9d5545b6baf9 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -1167,8 +1167,12 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
case IDC_CONTENT_CONTEXT_TRANSLATE: {
ChromeTranslateClient* chrome_translate_client =
ChromeTranslateClient::FromWebContents(embedder_web_contents_);
- if (!chrome_translate_client)
+ // If no |chrome_translate_client| attached with this webcontent or we're
lazyboy 2015/09/29 04:41:58 s/webcontent/WebContents
Deepak 2015/09/29 07:57:23 Done.
+ // viewing in a MimeHandlerViewGuest translate will be disabled.
+ if (!chrome_translate_client ||
+ guest_view::GuestViewBase::IsGuest(source_web_contents_)) {
lazyboy 2015/09/29 04:41:58 GuestViewBase seems too broad, to narrow it to mim
Deepak 2015/09/29 07:57:23 Done.
return false;
+ }
std::string original_lang =
chrome_translate_client->GetLanguageState().original_language();
std::string target_lang = g_browser_process->GetApplicationLocale();
« 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