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. |