| Index: chrome/renderer/translate/translate_helper.h
|
| diff --git a/chrome/renderer/translate/translate_helper.h b/chrome/renderer/translate/translate_helper.h
|
| index 88dd518cf69ab98019089428ef253b0121894002..b0cdb82e7ac9dfdbd20dea177418554e5cc9b33b 100644
|
| --- a/chrome/renderer/translate/translate_helper.h
|
| +++ b/chrome/renderer/translate/translate_helper.h
|
| @@ -12,6 +12,8 @@
|
| #include "base/time/time.h"
|
| #include "components/translate/core/common/translate_errors.h"
|
| #include "content/public/renderer/render_view_observer.h"
|
| +#include "ipc/ipc_platform_file.h"
|
| +#include "url/gurl.h"
|
|
|
| namespace blink {
|
| class WebDocument;
|
| @@ -29,6 +31,11 @@ class TranslateHelper : public content::RenderViewObserver {
|
| // Informs us that the page's text has been extracted.
|
| void PageCaptured(int page_id, const base::string16& contents);
|
|
|
| + // Lets the translation system know that we are preparing to navigate to
|
| + // the specified URL. If there is anything that can or should be done before
|
| + // this URL loads, this is the time to prepare for it.
|
| + void PrepareForUrl(const GURL& url);
|
| +
|
| protected:
|
| // The following methods are protected so they can be overridden in
|
| // unit-tests.
|
| @@ -148,6 +155,31 @@ class TranslateHelper : public content::RenderViewObserver {
|
| // Method factory used to make calls to TranslatePageImpl.
|
| base::WeakPtrFactory<TranslateHelper> weak_method_factory_;
|
|
|
| +#if defined(CLD2_DYNAMIC_MODE)
|
| + // Do not ask for CLD data any more.
|
| + void CancelCLD2DataFilePolling();
|
| + bool cld2_data_file_polling_canceled;
|
| +
|
| + bool deferred_page_capture_;
|
| + int deferred_page_id_;
|
| + base::string16 deferred_contents_;
|
| + void DeferPageCaptured(const int page_id, const base::string16& contents);
|
| +
|
| + // Immediately send an IPC request to the browser process to get the CLD
|
| + // data file. In most cases, the file will already exist and we will only
|
| + // poll once; but since the file might need to be downloaded first, we must
|
| + // poll indefinitely until a ChromeViewMsg_CLDDataAvailable message is
|
| + // received from the browser process.
|
| + // Polling will automatically halt as soon as the renderer obtains a
|
| + // reference to the data file.
|
| + void SendCLD2DataFileRequest(int delayMillis, int nextDelayMillis);
|
| +
|
| + // Invoked when a ChromeViewMsg_CLDDataAvailable message is received from
|
| + // the browser process, providing us with a file handle for the CLD data
|
| + // file.
|
| + void OnCLDDataAvailable(IPC::PlatformFileForTransit ipc_file_handle);
|
| + void LoadCLDDData(IPC::PlatformFileForTransit ipc_file_handle);
|
| +#endif
|
| DISALLOW_COPY_AND_ASSIGN(TranslateHelper);
|
| };
|
|
|
|
|