| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |