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

Unified Diff: components/dom_distiller/core/distilled_page_prefs.cc

Issue 1144153004: components: 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, 7 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: components/dom_distiller/core/distilled_page_prefs.cc
diff --git a/components/dom_distiller/core/distilled_page_prefs.cc b/components/dom_distiller/core/distilled_page_prefs.cc
index 01d1a07c96cea313b4f07fdd378af3febad7fc2f..fed24235060b6c23866c6f8e959ee938d2de0486 100644
--- a/components/dom_distiller/core/distilled_page_prefs.cc
+++ b/components/dom_distiller/core/distilled_page_prefs.cc
@@ -5,10 +5,12 @@
#include "components/dom_distiller/core/distilled_page_prefs.h"
#include "base/bind.h"
+#include "base/location.h"
#include "base/memory/weak_ptr.h"
-#include "base/message_loop/message_loop.h"
#include "base/observer_list.h"
#include "base/prefs/pref_service.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "components/pref_registry/pref_registry_syncable.h"
namespace {
@@ -44,11 +46,9 @@ void DistilledPagePrefs::RegisterProfilePrefs(
void DistilledPagePrefs::SetFontFamily(
DistilledPagePrefs::FontFamily new_font_family) {
pref_service_->SetInteger(kFontPref, new_font_family);
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&DistilledPagePrefs::NotifyOnChangeFontFamily,
- weak_ptr_factory_.GetWeakPtr(),
- new_font_family));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&DistilledPagePrefs::NotifyOnChangeFontFamily,
+ weak_ptr_factory_.GetWeakPtr(), new_font_family));
}
DistilledPagePrefs::FontFamily DistilledPagePrefs::GetFontFamily() {
@@ -64,11 +64,9 @@ DistilledPagePrefs::FontFamily DistilledPagePrefs::GetFontFamily() {
void DistilledPagePrefs::SetTheme(DistilledPagePrefs::Theme new_theme) {
pref_service_->SetInteger(kThemePref, new_theme);
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&DistilledPagePrefs::NotifyOnChangeTheme,
- weak_ptr_factory_.GetWeakPtr(),
- new_theme));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&DistilledPagePrefs::NotifyOnChangeTheme,
+ weak_ptr_factory_.GetWeakPtr(), new_theme));
}
DistilledPagePrefs::Theme DistilledPagePrefs::GetTheme() {
« no previous file with comments | « components/dom_distiller/core/distilled_content_store.cc ('k') | components/dom_distiller/core/distiller_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698