Index: chrome/renderer/translate_helper.cc |
diff --git a/chrome/renderer/translate_helper.cc b/chrome/renderer/translate_helper.cc |
index 36e1e4c087aee1e8c06c3069b37608d0e506537d..34a396f6ee26b8c0136c79dcd153a4d7aeb2fec3 100644 |
--- a/chrome/renderer/translate_helper.cc |
+++ b/chrome/renderer/translate_helper.cc |
@@ -28,7 +28,7 @@ using WebKit::WebScriptSource; |
using WebKit::WebString; |
using WebKit::WebView; |
-// The delay in millliseconds that we'll wait before checking to see if the |
+// The delay in milliseconds that we'll wait before checking to see if the |
// translate library injected in the page is ready. |
static const int kTranslateInitCheckDelayMs = 150; |
@@ -339,10 +339,12 @@ void TranslateHelper::CheckTranslateStatus() { |
} |
// The translation is still pending, check again later. |
- MessageLoop::current()->PostDelayedTask(FROM_HERE, |
+ MessageLoop::current()->PostDelayedTask( |
+ FROM_HERE, |
base::Bind(&TranslateHelper::CheckTranslateStatus, |
weak_method_factory_.GetWeakPtr()), |
- DontDelayTasks() ? 0 : kTranslateStatusCheckDelayMs); |
+ base::TimeDelta::FromMilliseconds( |
+ DontDelayTasks() ? 0 : kTranslateStatusCheckDelayMs)); |
} |
bool TranslateHelper::ExecuteScript(const std::string& script) { |
@@ -401,10 +403,12 @@ void TranslateHelper::TranslatePageImpl(int count) { |
NotifyBrowserTranslationFailed(TranslateErrors::INITIALIZATION_ERROR); |
return; |
} |
- MessageLoop::current()->PostDelayedTask(FROM_HERE, |
+ MessageLoop::current()->PostDelayedTask( |
+ FROM_HERE, |
base::Bind(&TranslateHelper::TranslatePageImpl, |
weak_method_factory_.GetWeakPtr(), count), |
- DontDelayTasks() ? 0 : count * kTranslateInitCheckDelayMs); |
+ base::TimeDelta::FromMilliseconds( |
+ DontDelayTasks() ? 0 : count * kTranslateInitCheckDelayMs)); |
return; |
} |
@@ -413,10 +417,12 @@ void TranslateHelper::TranslatePageImpl(int count) { |
return; |
} |
// Check the status of the translation. |
- MessageLoop::current()->PostDelayedTask(FROM_HERE, |
+ MessageLoop::current()->PostDelayedTask( |
+ FROM_HERE, |
base::Bind(&TranslateHelper::CheckTranslateStatus, |
weak_method_factory_.GetWeakPtr()), |
- DontDelayTasks() ? 0 : kTranslateStatusCheckDelayMs); |
+ base::TimeDelta::FromMilliseconds( |
+ DontDelayTasks() ? 0 : kTranslateStatusCheckDelayMs)); |
} |
void TranslateHelper::NotifyBrowserTranslationFailed( |