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

Unified Diff: components/translate/content/renderer/translate_helper.h

Issue 2919343007: Check |errorCode| of translate.js and notify to Browser (Closed)
Patch Set: Addressed review comment. Proper order of enum variables in switch case. Created 3 years, 5 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
Index: components/translate/content/renderer/translate_helper.h
diff --git a/components/translate/content/renderer/translate_helper.h b/components/translate/content/renderer/translate_helper.h
index 58f2c8835d5e98b97be5095b06d0c644e258edf7..e5c5499fdb7b9a090bf2088fde93057297c147db 100644
--- a/components/translate/content/renderer/translate_helper.h
+++ b/components/translate/content/renderer/translate_helper.h
@@ -65,6 +65,9 @@ class TranslateHelper : public content::RenderFrameObserver,
// translation.
virtual bool HasTranslationFailed();
+ // Returns the error code generated in translate library.
+ virtual int64_t GetErrorCode();
+
// Starts the translation by calling the translate library. This method
// should only be called when the translate script has been injected in the
// page. Returns false if the call failed immediately.
@@ -99,6 +102,11 @@ class TranslateHelper : public content::RenderFrameObserver,
// run successfully. Otherwise, returns 0.0.
virtual double ExecuteScriptAndGetDoubleResult(const std::string& script);
+ // Executes the JavaScript code in |script| in the main frame of RenderView.
+ // and returns the integer value returned by the script evaluation if the
+ // script was run successfully. Otherwise, returns 0.
+ virtual int64_t ExecuteScriptAndGetIntegerResult(const std::string& script);
+
private:
FRIEND_TEST_ALL_PREFIXES(TranslateHelperTest, TestBuildTranslationScript);
« no previous file with comments | « chrome/renderer/translate/translate_helper_browsertest.cc ('k') | components/translate/content/renderer/translate_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698