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

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

Issue 15295004: Translate: enable against unknown languages with server side detection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (rebase for dcommit) Created 7 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/resources/translate.js ('k') | chrome/browser/translate/translate_infobar_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/render_view_context_menu.cc
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 54a3e281f7c1dedb9612004029465d80d03a243d..145559f96d4d0a23c56a0b1242c737f66c5054d6 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -1198,13 +1198,8 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
// target languages are identical. This is to give a way to user to
// translate a page that might contains text fragments in a different
// language.
- return !!(params_.edit_flags & WebContextMenuData::CanTranslate) &&
+ return ((params_.edit_flags & WebContextMenuData::CanTranslate) != 0) &&
!original_lang.empty() && // Did we receive the page language yet?
- // Only allow translating languages we explitly support and the
- // unknown language (in which case the page language is detected on
- // the server side).
- (original_lang == chrome::kUnknownLanguageCode ||
- TranslateManager::IsSupportedLanguage(original_lang)) &&
!translate_tab_helper->language_state().IsPageTranslated() &&
!source_web_contents_->GetInterstitialPage() &&
// There are some application locales which can't be used as a
« no previous file with comments | « chrome/browser/resources/translate.js ('k') | chrome/browser/translate/translate_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698