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

Unified Diff: chrome/renderer/translate/page_translator.h

Issue 577032: The translate feature was only translating the main frame of the page.... (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | chrome/renderer/translate/page_translator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/translate/page_translator.h
===================================================================
--- chrome/renderer/translate/page_translator.h (revision 38414)
+++ chrome/renderer/translate/page_translator.h (working copy)
@@ -48,16 +48,28 @@
PageTranslatorDelegate* delegate);
virtual ~PageTranslator();
- // Starts the translation process of |web_frame| from |source_lang| to
- // |target_lang| where the languages are the ISO codes (ex: en, fr...).
- void Translate(int page_id,
- WebKit::WebFrame* web_frame,
- std::string source_lang,
- std::string target_lang);
+ // Translate the text in the page contained in |main_frame|.
+ // It is translated from |source_lang| to |target_lang| where the languages
+ // are the ISO codes (ex: en, fr...).
+ // All sub-frames contained in |main_frame| are translated.
+ void TranslatePage(int page_id,
+ WebKit::WebFrame* main_frame,
+ std::string source_lang,
+ std::string target_lang);
- // Notification that the associated RenderView has navigated to a new page.
- void NavigatedToNewPage();
+ // Translates the contents of |frame| if it has not already been translated
+ // and if the main frame was previously translated.
+ // (Note this should not be called for the main frame, use TranslatePage for
+ // it).
+ void TranslateFrame(WebKit::WebFrame* frame);
+ // Notification that the main frame of the current page has navigated.
+ // This invalidates all our page states.
+ void MainFrameNavigated();
+
+ // Returns true if the current page has been translated.
+ bool IsPageTranslated();
+
// TextTranslator::Delegate implentation:
virtual void TranslationError(int work_id, int error_id);
virtual void TextTranslated(
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | chrome/renderer/translate/page_translator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698