| 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..fb7d1e4c9bb539949eeb7742432a3aec97791314 100644
|
| --- a/components/translate/content/renderer/translate_helper.h
|
| +++ b/components/translate/content/renderer/translate_helper.h
|
| @@ -64,6 +64,10 @@ class TranslateHelper : public content::RenderFrameObserver,
|
| // translation.
|
| virtual bool HasTranslationFailed();
|
|
|
| + // Returns the error code generated in translate library if there was an
|
| + // error. Otherwise, returns |fallback| value.
|
| + virtual int64_t GetErrorCodeWithFallback(TranslateErrors::Type fallback);
|
| +
|
| // 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 +102,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);
|
|
|