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 622e7183fc6e8c11a6ab71b4fd263b0f8523f749..5b8a0735c7809e60232971e0f1521e36c71b38bd 100644 |
--- a/components/translate/content/renderer/translate_helper.h |
+++ b/components/translate/content/renderer/translate_helper.h |
@@ -64,6 +64,9 @@ class TranslateHelper : public content::RenderFrameObserver, |
// translation. |
virtual bool HasTranslationFailed(); |
+ // Returns the error code generated in translate library. |
+ virtual int64_t GetErrorCode(); |
napper
2017/06/16 12:41:51
Can this method (and the one below) be const?
Takashi Toyoshima
2017/06/16 16:14:17
IMHO, the method causes a side effect should not b
|
+ |
// 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. |
@@ -98,6 +101,12 @@ 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 |fallback| value. |
+ virtual int64_t ExecuteScriptAndGetIntegerResult(const std::string& script, |
+ int64_t fallback); |
+ |
private: |
// Converts language code to the one used in server supporting list. |
static void ConvertLanguageCodeSynonym(std::string* code); |