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

Unified Diff: chrome/browser/ui/app_list/app_list_service_impl.cc

Issue 1160073004: chrome/browser/ui: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/app_list_shower_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/app_list_service_impl.cc
diff --git a/chrome/browser/ui/app_list/app_list_service_impl.cc b/chrome/browser/ui/app_list/app_list_service_impl.cc
index 171c8a68209d7a7dabcb19fbd63f660333b6443e..56c71d22f93771650e1a4a9420d655399bf878ff 100644
--- a/chrome/browser/ui/app_list/app_list_service_impl.cc
+++ b/chrome/browser/ui/app_list/app_list_service_impl.cc
@@ -8,9 +8,12 @@
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/location.h"
#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/string16.h"
+#include "base/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_shutdown.h"
@@ -177,11 +180,9 @@ void RecordAppListDiscoverability(PrefService* local_state,
base::TimeDelta::FromMinutes(kDiscoverabilityTimeoutMinutes) -
base::Time::Now();
if (time_remaining > base::TimeDelta()) {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&RecordAppListDiscoverability,
- base::Unretained(local_state),
- false),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&RecordAppListDiscoverability,
+ base::Unretained(local_state), false),
time_remaining);
return;
}
@@ -420,11 +421,9 @@ void AppListServiceImpl::EnableAppList(Profile* initial_profile,
if (base::MessageLoop::current()) {
msw 2015/06/09 00:51:56 Shouldn't this now check base::ThreadTaskRunnerHan
Sami 2015/06/09 10:20:08 Well spotted, thanks. Fixed here, below and in app
// Ensure a value is recorded if the user "never" shows the app list. Note
// there is no message loop in unit tests.
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&RecordAppListDiscoverability,
- base::Unretained(local_state_),
- false),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&RecordAppListDiscoverability,
+ base::Unretained(local_state_), false),
base::TimeDelta::FromMinutes(kDiscoverabilityTimeoutMinutes));
}
}
@@ -449,8 +448,7 @@ void AppListServiceImpl::PerformStartupChecks(Profile* initial_profile) {
// Send app list usage stats after a delay.
const int kSendUsageStatsDelay = 5;
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&AppListServiceImpl::SendAppListStats),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&AppListServiceImpl::SendAppListStats),
base::TimeDelta::FromSeconds(kSendUsageStatsDelay));
}
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/app_list_shower_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698