Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3270)

Unified Diff: chrome/renderer/translate_helper.cc

Issue 9185026: Convert use of int ms to TimeDelta in files owned by brettw. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Explicitly include base/time.h in header file. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/net/renderer_net_predictor.cc ('k') | content/browser/browser_child_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « chrome/renderer/net/renderer_net_predictor.cc ('k') | content/browser/browser_child_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698