Chromium Code Reviews| Index: chrome/browser/translate/translate_manager.h |
| diff --git a/chrome/browser/translate/translate_manager.h b/chrome/browser/translate/translate_manager.h |
| index 78b3a3f856f87843ffab32ed8c9970689a7e4af0..9c05b97d76df4b20c63886ca3d8287db6dcb81e4 100644 |
| --- a/chrome/browser/translate/translate_manager.h |
| +++ b/chrome/browser/translate/translate_manager.h |
| @@ -86,13 +86,19 @@ class TranslateManager : public content::NotificationObserver, |
| // net::URLFetcherDelegate implementation: |
| virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| - // Used by unit-tests to override the default delay after which the translate |
| + // Used by unit-tests to override some defaults |
|
MAD
2013/05/09 14:05:24
Comments text should fill the line as much as poss
Miguel Garcia
2013/05/10 12:00:02
Done.
|
| + // Delay after which the translate |
|
MAD
2013/05/09 14:05:24
Delay -> delay.
Miguel Garcia
2013/05/10 12:00:02
Done.
|
| // script is fetched again from the translation server. |
| void set_translate_script_expiration_delay(int delay_ms) { |
| translate_script_expiration_delay_ = |
| base::TimeDelta::FromMilliseconds(delay_ms); |
| } |
| + // Number of attempts before waiting for a page to be full reloaded. |
|
MAD
2013/05/09 14:05:24
full -> fully
Miguel Garcia
2013/05/10 12:00:02
Done.
|
| + void set_translate_max_reload_attemps(int attempts) { |
| + max_reload_check_attempts_ = attempts; |
| + } |
| + |
| // Returns true if the URL can be translated. |
| static bool IsTranslatableURL(const GURL& url); |
| @@ -142,9 +148,8 @@ class TranslateManager : public content::NotificationObserver, |
| // If the tab identified by |process_id| and |render_id| has been closed, this |
| // does nothing, otherwise it calls InitiateTranslation. |
| - void InitiateTranslationPosted(int process_id, |
| - int render_id, |
| - const std::string& page_lang); |
| + void InitiateTranslationPosted(int process_id, int render_id, |
| + const std::string& page_lang, int attempt); |
| // Sends a translation request to the RenderView of |web_contents|. |
| void DoTranslatePage(content::WebContents* web_contents, |
| @@ -202,6 +207,10 @@ class TranslateManager : public content::NotificationObserver, |
| // from the translate server. |
| base::TimeDelta translate_script_expiration_delay_; |
| + // Max number of attempts before checking if a page has been |
|
MAD
2013/05/09 14:05:24
Should fit on a single line.
You could also add s
Miguel Garcia
2013/05/10 12:00:53
Done, added a case in the reload test as well
On
|
| + // reloaded. |
| + int max_reload_check_attempts_; |
| + |
| // Set when the translate JS is currently being retrieved. NULL otherwise. |
| scoped_ptr<net::URLFetcher> translate_script_request_pending_; |