diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-29 01:44:42 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-29 01:44:42 +0000 |
commit | d4a00a73c0349128e4ad9d5f30704ba2ec1d79d8 (patch) | |
tree | 800d83b966fbafbc8f18f442ced1fdd31e6b3536 /chrome/common/render_messages.h | |
parent | aef2da3e36d775461f71c104c28f3ca4ff8f7b9a (diff) | |
download | chromium_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/common/render_messages.h')
-rw-r--r-- | chrome/common/render_messages.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index ebc7af4..b50b0d1 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -581,6 +581,9 @@ struct ViewHostMsg_TranslateTextParam { // An id used to identify that specific translation. int work_id; + // The id of the page this translation originated from. + int page_id; + // The text chunks that need to be translated. std::vector<string16> text_chunks; @@ -2457,6 +2460,7 @@ struct ParamTraits<ViewHostMsg_TranslateTextParam> { static void Write(Message* m, const param_type& p) { WriteParam(m, p.routing_id); WriteParam(m, p.work_id); + WriteParam(m, p.page_id); WriteParam(m, p.text_chunks); WriteParam(m, p.from_language); WriteParam(m, p.to_language); @@ -2467,6 +2471,7 @@ struct ParamTraits<ViewHostMsg_TranslateTextParam> { return ReadParam(m, iter, &p->routing_id) && ReadParam(m, iter, &p->work_id) && + ReadParam(m, iter, &p->page_id) && ReadParam(m, iter, &p->text_chunks) && ReadParam(m, iter, &p->from_language) && ReadParam(m, iter, &p->to_language) && @@ -2478,6 +2483,8 @@ struct ParamTraits<ViewHostMsg_TranslateTextParam> { l->append(L", "); LogParam(p.work_id, l); l->append(L", "); + LogParam(p.page_id, l); + l->append(L", "); LogParam(p.text_chunks, l); l->append(L", "); LogParam(p.from_language, l); |