summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/translate/page_translator.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/renderer/translate/page_translator.h')
-rw-r--r--chrome/renderer/translate/page_translator.h36
1 files changed, 9 insertions, 27 deletions
diff --git a/chrome/renderer/translate/page_translator.h b/chrome/renderer/translate/page_translator.h
index 68d18d4..14139227 100644
--- a/chrome/renderer/translate/page_translator.h
+++ b/chrome/renderer/translate/page_translator.h
@@ -31,24 +31,15 @@ class WebString;
// and delegates the actual text translation to a TextTranslator.
class PageTranslator : public TextTranslator::Delegate {
public:
- class Delegate {
- public:
- virtual ~Delegate() {}
- virtual void PageTranslated(int page_id,
- const std::string& original_lang,
- const std::string& target_lang) = 0;
- };
-
// The caller remains the owner of |text_translator|.
- PageTranslator(TextTranslator* text_translator, Delegate* delegate);
+ explicit PageTranslator(TextTranslator* text_translator);
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);
+ // Starts the translation process of |web_frame| from |from_lang| to |to_lang|
+ // where the languages are the ISO codes (ex: en, fr...).
+ void Translate(WebKit::WebFrame* web_frame,
+ std::string from_lang,
+ std::string to_lang);
// Notification that the associated RenderView has navigated to a new page.
void NavigatedToNewPage();
@@ -89,10 +80,10 @@ class PageTranslator : public TextTranslator::Delegate {
void ClearNodeZone(int work_id);
// Clears all the states related to the page's contents.
- void ResetPageStates();
+ void ResetPageState();
- // Our delegate (notified when a page is translated).
- Delegate* delegate_;
+ // The RenderView we are providing translations for.
+ RenderView* render_view_;
// The TextTranslator is responsible for translating the actual text chunks
// from one language to another.
@@ -107,15 +98,6 @@ class PageTranslator : public TextTranslator::Delegate {
// Mapping from a translation engine work id to the associated nodes.
std::map<int, NodeList*> pending_translations_;
- // The language the page was in originally.
- std::string original_language_;
-
- // The language the page was translated to.
- std::string current_language_;
-
- // The page id of the page last time we translated.
- int page_id_;
-
// The list of text nodes in the current page with their original text.
// Used to undo the translation.
typedef std::pair<WebKit::WebNode, WebKit::WebString> NodeTextPair;