diff options
Diffstat (limited to 'chrome/renderer/render_view.cc')
-rw-r--r-- | chrome/renderer/render_view.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index d4c1c36..5eea4b3 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -312,7 +312,7 @@ RenderView::RenderView(RenderThreadBase* render_thread, webkit_preferences_(webkit_preferences), session_storage_namespace_id_(session_storage_namespace_id), ALLOW_THIS_IN_INITIALIZER_LIST(text_translator_(this)) { - page_translator_.reset(new PageTranslator(&text_translator_)); + page_translator_.reset(new PageTranslator(&text_translator_, this)); } RenderView::~RenderView() { @@ -2872,6 +2872,13 @@ void RenderView::DidStopLoadingForPlugin() { didStopLoading(); } +void RenderView::PageTranslated(int page_id, + const std::string& original_lang, + const std::string& target_lang) { + Send(new ViewHostMsg_PageTranslated(routing_id_, page_id_, + original_lang, target_lang)); +} + void RenderView::ShowModalHTMLDialogForPlugin( const GURL& url, const gfx::Size& size, @@ -3376,7 +3383,7 @@ void RenderView::OnTranslatePage(int page_id, WebFrame* main_frame = webview()->mainFrame(); if (!main_frame) return; - page_translator_->Translate(main_frame, source_lang, target_lang); + page_translator_->Translate(page_id, main_frame, source_lang, target_lang); } void RenderView::OnTranslateTextResponse( |