| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 5 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1824 std::string original_lang = | 1824 std::string original_lang = |
| 1825 translate_tab_helper->GetLanguageState().original_language(); | 1825 translate_tab_helper->GetLanguageState().original_language(); |
| 1826 std::string target_lang = g_browser_process->GetApplicationLocale(); | 1826 std::string target_lang = g_browser_process->GetApplicationLocale(); |
| 1827 target_lang = TranslateDownloadManager::GetLanguageCode(target_lang); | 1827 target_lang = TranslateDownloadManager::GetLanguageCode(target_lang); |
| 1828 // Since the user decided to translate for that language and site, clears | 1828 // Since the user decided to translate for that language and site, clears |
| 1829 // any preferences for not translating them. | 1829 // any preferences for not translating them. |
| 1830 scoped_ptr<TranslatePrefs> prefs( | 1830 scoped_ptr<TranslatePrefs> prefs( |
| 1831 TranslateTabHelper::CreateTranslatePrefs(profile_->GetPrefs())); | 1831 TranslateTabHelper::CreateTranslatePrefs(profile_->GetPrefs())); |
| 1832 prefs->UnblockLanguage(original_lang); | 1832 prefs->UnblockLanguage(original_lang); |
| 1833 prefs->RemoveSiteFromBlacklist(params_.page_url.HostNoBrackets()); | 1833 prefs->RemoveSiteFromBlacklist(params_.page_url.HostNoBrackets()); |
| 1834 TranslateManager::GetInstance()->TranslatePage( | 1834 translate_tab_helper->GetTranslateManager()->TranslatePage(original_lang, |
| 1835 source_web_contents_, original_lang, target_lang); | 1835 target_lang); |
| 1836 break; | 1836 break; |
| 1837 } | 1837 } |
| 1838 | 1838 |
| 1839 case IDC_CONTENT_CONTEXT_RELOADFRAME: | 1839 case IDC_CONTENT_CONTEXT_RELOADFRAME: |
| 1840 rvh->ReloadFrame(); | 1840 rvh->ReloadFrame(); |
| 1841 break; | 1841 break; |
| 1842 | 1842 |
| 1843 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: | 1843 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: |
| 1844 source_web_contents_->ViewFrameSource(params_.frame_url, | 1844 source_web_contents_->ViewFrameSource(params_.frame_url, |
| 1845 params_.frame_page_state); | 1845 params_.frame_page_state); |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2110 source_web_contents_->GetRenderViewHost()-> | 2110 source_web_contents_->GetRenderViewHost()-> |
| 2111 ExecuteMediaPlayerActionAtLocation(location, action); | 2111 ExecuteMediaPlayerActionAtLocation(location, action); |
| 2112 } | 2112 } |
| 2113 | 2113 |
| 2114 void RenderViewContextMenu::PluginActionAt( | 2114 void RenderViewContextMenu::PluginActionAt( |
| 2115 const gfx::Point& location, | 2115 const gfx::Point& location, |
| 2116 const WebPluginAction& action) { | 2116 const WebPluginAction& action) { |
| 2117 source_web_contents_->GetRenderViewHost()-> | 2117 source_web_contents_->GetRenderViewHost()-> |
| 2118 ExecutePluginActionAtLocation(location, action); | 2118 ExecutePluginActionAtLocation(location, action); |
| 2119 } | 2119 } |
| OLD | NEW |