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

Unified Diff: chrome/browser/ui/sync/one_click_signin_sync_observer.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: Review comments. 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/ui/sync/one_click_signin_sync_observer.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_sync_observer.cc b/chrome/browser/ui/sync/one_click_signin_sync_observer.cc
index e8ff4480f9ef9d65041156c0d7de1a2c96b4d11f..ff8169e68e5b1a665640012ba81486945f9ac252 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_observer.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_observer.cc
@@ -5,7 +5,9 @@
#include "chrome/browser/ui/sync/one_click_signin_sync_observer.h"
#include "base/bind.h"
-#include "base/message_loop/message_loop.h"
+#include "base/location.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/signin_promo.h"
#include "chrome/browser/sync/profile_sync_service.h"
@@ -42,10 +44,9 @@ OneClickSigninSyncObserver::OneClickSigninSyncObserver(
// important to pass a weak pointer rather than base::Unretained(this)
// because it's possible for e.g. WebContentsDestroyed() to be called
// before this task has a chance to run.
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&OneClickSigninSyncObserver::DeleteObserver,
- weak_ptr_factory_.GetWeakPtr()));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&OneClickSigninSyncObserver::DeleteObserver,
+ weak_ptr_factory_.GetWeakPtr()));
}
}
@@ -69,9 +70,8 @@ void OneClickSigninSyncObserver::OnStateChanged() {
if (signin::IsAutoCloseEnabledInURL(continue_url_)) {
// Close the Gaia sign-in tab via a task to make sure we aren't in the
// middle of any WebUI handler code.
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&CloseTab, base::Unretained(web_contents())));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&CloseTab, base::Unretained(web_contents())));
} else {
if (sync_service->FirstSetupInProgress()) {
// Sync setup has not completed yet. Wait for it to complete.
« no previous file with comments | « chrome/browser/ui/startup/default_browser_prompt.cc ('k') | chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698