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

Side by Side Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 166963002: TranslateManager is no longer a singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp
Patch Set: Fix TODO comment Created 6 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/translate/translate_infobar_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 TranslateManager* manager = translate_tab_helper->GetTranslateManager();
1835 source_web_contents_, original_lang, target_lang); 1835 DCHECK(manager);
1836 manager->TranslatePage(original_lang, target_lang);
1836 break; 1837 break;
1837 } 1838 }
1838 1839
1839 case IDC_CONTENT_CONTEXT_RELOADFRAME: 1840 case IDC_CONTENT_CONTEXT_RELOADFRAME:
1840 rvh->ReloadFrame(); 1841 rvh->ReloadFrame();
1841 break; 1842 break;
1842 1843
1843 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: 1844 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE:
1844 source_web_contents_->ViewFrameSource(params_.frame_url, 1845 source_web_contents_->ViewFrameSource(params_.frame_url,
1845 params_.frame_page_state); 1846 params_.frame_page_state);
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
2110 source_web_contents_->GetRenderViewHost()-> 2111 source_web_contents_->GetRenderViewHost()->
2111 ExecuteMediaPlayerActionAtLocation(location, action); 2112 ExecuteMediaPlayerActionAtLocation(location, action);
2112 } 2113 }
2113 2114
2114 void RenderViewContextMenu::PluginActionAt( 2115 void RenderViewContextMenu::PluginActionAt(
2115 const gfx::Point& location, 2116 const gfx::Point& location,
2116 const WebPluginAction& action) { 2117 const WebPluginAction& action) {
2117 source_web_contents_->GetRenderViewHost()-> 2118 source_web_contents_->GetRenderViewHost()->
2118 ExecutePluginActionAtLocation(location, action); 2119 ExecutePluginActionAtLocation(location, action);
2119 } 2120 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/translate/translate_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698