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

Unified Diff: chrome/browser/search/hotword_service.cc

Issue 1143343005: chrome/browser: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 6 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
Index: chrome/browser/search/hotword_service.cc
diff --git a/chrome/browser/search/hotword_service.cc b/chrome/browser/search/hotword_service.cc
index 5b08027ef4c198480f703a9420a55068e88aa435..30d12f010a324afa2f8ce4716b43c627ca5502fb 100644
--- a/chrome/browser/search/hotword_service.cc
+++ b/chrome/browser/search/hotword_service.cc
@@ -8,12 +8,15 @@
#include "base/command_line.h"
#include "base/i18n/case_conversion.h"
+#include "base/location.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/metrics/sparse_histogram.h"
#include "base/path_service.h"
#include "base/prefs/pref_service.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h"
@@ -370,17 +373,15 @@ HotwordService::HotwordService(Profile* profile)
// for the hotword extension to be installed.
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kEnableExperimentalHotwordHardware)) {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&HotwordService::ShowHotwordNotification,
- weak_factory_.GetWeakPtr()),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&HotwordService::ShowHotwordNotification,
+ weak_factory_.GetWeakPtr()),
base::TimeDelta::FromSeconds(5));
} else if (!profile_->GetPrefs()->GetBoolean(
prefs::kHotwordAlwaysOnNotificationSeen)) {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&HotwordService::ShowHotwordNotification,
- weak_factory_.GetWeakPtr()),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&HotwordService::ShowHotwordNotification,
+ weak_factory_.GetWeakPtr()),
base::TimeDelta::FromMinutes(10));
}
}

Powered by Google App Engine
This is Rietveld 408576698