summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/render_view_host.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-29 01:44:42 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-29 01:44:42 +0000
commitd4a00a73c0349128e4ad9d5f30704ba2ec1d79d8 (patch)
tree800d83b966fbafbc8f18f442ced1fdd31e6b3536 /chrome/browser/renderer_host/render_view_host.cc
parentaef2da3e36d775461f71c104c28f3ca4ff8f7b9a (diff)
downloadchromium_src-d4a00a73c0349128e4ad9d5f30704ba2ec1d79d8.zip
chromium_src-d4a00a73c0349128e4ad9d5f30704ba2ec1d79d8.tar.gz
chromium_src-d4a00a73c0349128e4ad9d5f30704ba2ec1d79d8.tar.bz2
This CL makes the TranslationService class send the text to be translated to the translation
server. It groups requests as to limit the number of requests sent to the server. Also this CL adds a flag to automatically turn on translation on pages that are not in the language Chrome is configured in. BUG=None TEST=Run the unit-tests. Add the --auto-translate flag then navigate to pages in a language which is not the language Chrome is configured. They should get translated. Review URL: http://codereview.chromium.org/552216 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/render_view_host.cc')
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index a227ffa..652d253 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -1751,6 +1751,13 @@ void RenderViewHost::PerformCustomContextMenuAction(unsigned action) {
Send(new ViewMsg_CustomContextMenuAction(routing_id(), action));
}
+void RenderViewHost::TranslatePage(int page_id,
+ const std::string& source_lang,
+ const std::string& target_lang) {
+ Send(new ViewMsg_TranslatePage(routing_id(), page_id,
+ source_lang, target_lang));
+}
+
void RenderViewHost::OnExtensionPostMessage(
int port_id, const std::string& message) {
if (process()->profile()->GetExtensionMessageService()) {