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

Side by Side Diff: chrome/renderer/translate/text_translator_impl.cc

Issue 552216: This CL makes the TranslationService class send the text to be translated to ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/renderer/translate/text_translator_impl.h" 5 #include "chrome/renderer/translate/text_translator_impl.h"
6 6
7 #include "chrome/common/render_messages.h" 7 #include "chrome/common/render_messages.h"
8 #include "chrome/renderer/render_view.h" 8 #include "chrome/renderer/render_view.h"
9 9
10 TextTranslatorImpl::TextTranslatorImpl(RenderView* render_view) 10 TextTranslatorImpl::TextTranslatorImpl(RenderView* render_view)
(...skipping 10 matching lines...) Expand all
21 render_view_->page_translator()->TextTranslated(work_id, text_chunks); 21 render_view_->page_translator()->TextTranslated(work_id, text_chunks);
22 } 22 }
23 23
24 int TextTranslatorImpl::Translate(const std::vector<string16>& text, 24 int TextTranslatorImpl::Translate(const std::vector<string16>& text,
25 std::string from_lang, 25 std::string from_lang,
26 std::string to_lang, 26 std::string to_lang,
27 bool secure, 27 bool secure,
28 TextTranslator::Delegate* delegate) { 28 TextTranslator::Delegate* delegate) {
29 ViewHostMsg_TranslateTextParam param; 29 ViewHostMsg_TranslateTextParam param;
30 param.routing_id = render_view_->routing_id(); 30 param.routing_id = render_view_->routing_id();
31 param.page_id = render_view_->page_id();
31 param.work_id = work_id_counter_++; 32 param.work_id = work_id_counter_++;
32 param.from_language = from_lang; 33 param.from_language = from_lang;
33 param.to_language = to_lang; 34 param.to_language = to_lang;
34 param.text_chunks = text; 35 param.text_chunks = text;
35 param.secure = secure; 36 param.secure = secure;
36 37
37 render_view_->Send(new ViewHostMsg_TranslateText(param)); 38 render_view_->Send(new ViewHostMsg_TranslateText(param));
38 39
39 return param.work_id; 40 return param.work_id;
40 } 41 }
OLDNEW
« chrome/browser/tab_contents/tab_contents.cc ('K') | « chrome/renderer/translate/page_translator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698