diff options
author | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-17 22:53:46 +0000 |
---|---|---|
committer | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-17 22:53:46 +0000 |
commit | 740f19ec5c056e340fae3343a7678448e897275f (patch) | |
tree | 43f18a3760ffa49586907800bc26eff073c04d1e /chrome/browser/tab_contents | |
parent | cf54865e9baedb5e2590a33f7f316e7c8d4e46d5 (diff) | |
download | chromium_src-740f19ec5c056e340fae3343a7678448e897275f.zip chromium_src-740f19ec5c056e340fae3343a7678448e897275f.tar.gz chromium_src-740f19ec5c056e340fae3343a7678448e897275f.tar.bz2 |
Revert 50148:
It causes the unit-test, ui-tests and more to fail with a not found symbol.
- Porting the infobars on Linux to the new TranslateInfobarDelegate2.
Each translate infobar is now its own class and most of the logic is in the delegate.
BUG=40828
TEST=Thoroughly test the translate feature on Linux.
Review URL: http://codereview.chromium.org/2836006
TBR=jcivelli@chromium.org
Review URL: http://codereview.chromium.org/2805016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/render_view_context_menu.cc | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index 63fc5f3..df97268 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -35,7 +35,7 @@ #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/translate/translate_manager.h" -#if defined(OS_WIN) || defined(OS_LINUX) +#if defined(OS_WIN) #include "chrome/browser/translate/translate_manager2.h" #endif #include "chrome/common/chrome_switches.h" @@ -449,11 +449,7 @@ void RenderViewContextMenu::AppendPageItems() { menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT); std::string locale = g_browser_process->GetApplicationLocale(); -#if defined(OS_WIN) || defined(OS_LINUX) - locale = TranslateManager2::GetLanguageCode(locale); -#else locale = TranslateManager::GetLanguageCode(locale); -#endif string16 language = l10n_util::GetDisplayNameForLocale(locale, locale, true); menu_model_.AddItem( IDC_CONTENT_CONTEXT_TRANSLATE, @@ -727,19 +723,11 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { std::string original_lang = source_tab_contents_->language_state().original_language(); std::string target_lang = g_browser_process->GetApplicationLocale(); -#if defined(OS_WIN) || defined(OS_LINUX) - target_lang = TranslateManager2::GetLanguageCode(target_lang); -#else target_lang = TranslateManager::GetLanguageCode(target_lang); -#endif return original_lang != target_lang && !source_tab_contents_->language_state().IsPageTranslated() && !source_tab_contents_->interstitial_page() && -#if defined(OS_WIN) || defined(OS_LINUX) - TranslateManager2::IsTranslatableURL(params_.page_url); -#else TranslateManager::IsTranslatableURL(params_.page_url); -#endif } case IDC_CONTENT_CONTEXT_OPENLINKNEWTAB: @@ -1144,17 +1132,13 @@ void RenderViewContextMenu::ExecuteCommand(int id) { std::string original_lang = source_tab_contents_->language_state().original_language(); std::string target_lang = g_browser_process->GetApplicationLocale(); -#if defined(OS_WIN) || defined(OS_LINUX) - target_lang = TranslateManager2::GetLanguageCode(target_lang); -#else target_lang = TranslateManager::GetLanguageCode(target_lang); -#endif // Since the user decided to translate for that language and site, clears // any preferences for not translating them. TranslatePrefs prefs(profile_->GetPrefs()); prefs.RemoveLanguageFromBlacklist(original_lang); prefs.RemoveSiteFromBlacklist(params_.page_url.HostNoBrackets()); -#if defined(OS_WIN) || defined(OS_LINUX) +#if defined(OS_WIN) Singleton<TranslateManager2>::get()->TranslatePage( source_tab_contents_, original_lang, target_lang); #else |