| Index: ui/views/win/hwnd_message_handler.cc
|
| diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
| index f20524e60ae1e585feae4a7ace8576aef4fbe00e..d8c14ee9b2776f12091f4af804e3da9a69df6ff0 100644
|
| --- a/ui/views/win/hwnd_message_handler.cc
|
| +++ b/ui/views/win/hwnd_message_handler.cc
|
| @@ -14,7 +14,10 @@
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| #include "base/debug/alias.h"
|
| +#include "base/location.h"
|
| #include "base/macros.h"
|
| +#include "base/single_thread_task_runner.h"
|
| +#include "base/threading/thread_task_runner_handle.h"
|
| #include "base/trace_event/trace_event.h"
|
| #include "base/win/scoped_gdi_object.h"
|
| #include "base/win/windows_version.h"
|
| @@ -422,7 +425,7 @@ void HWNDMessageHandler::Close() {
|
| // may delete ourselves on destroy and the ATL callback would still
|
| // dereference us when the callback returns).
|
| waiting_for_close_now_ = true;
|
| - base::MessageLoop::current()->PostTask(
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| FROM_HERE,
|
| base::Bind(&HWNDMessageHandler::CloseNow, weak_factory_.GetWeakPtr()));
|
| }
|
| @@ -1252,11 +1255,9 @@ void HWNDMessageHandler::ForceRedrawWindow(int attempts) {
|
| // unavailable.
|
| if (--attempts <= 0)
|
| return;
|
| - base::MessageLoop::current()->PostDelayedTask(
|
| - FROM_HERE,
|
| - base::Bind(&HWNDMessageHandler::ForceRedrawWindow,
|
| - weak_factory_.GetWeakPtr(),
|
| - attempts),
|
| + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
|
| + FROM_HERE, base::Bind(&HWNDMessageHandler::ForceRedrawWindow,
|
| + weak_factory_.GetWeakPtr(), attempts),
|
| base::TimeDelta::FromMilliseconds(500));
|
| return;
|
| }
|
| @@ -2115,7 +2116,7 @@ void HWNDMessageHandler::OnSize(UINT param, const gfx::Size& size) {
|
| // don't get nested WM_SIZE messages.
|
| if (needs_scroll_styles_ && !in_size_loop_) {
|
| ShowScrollBar(hwnd(), SB_BOTH, FALSE);
|
| - base::MessageLoop::current()->PostTask(
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| FROM_HERE, base::Bind(&AddScrollStylesToWindow, hwnd()));
|
| }
|
| }
|
| @@ -2227,10 +2228,9 @@ LRESULT HWNDMessageHandler::OnTouchEvent(UINT message,
|
| GenerateTouchEvent(ui::ET_TOUCH_PRESSED, touch_point, touch_id,
|
| event_time, &touch_events);
|
| touch_down_contexts_++;
|
| - base::MessageLoop::current()->PostDelayedTask(
|
| - FROM_HERE,
|
| - base::Bind(&HWNDMessageHandler::ResetTouchDownContext,
|
| - weak_factory_.GetWeakPtr()),
|
| + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
|
| + FROM_HERE, base::Bind(&HWNDMessageHandler::ResetTouchDownContext,
|
| + weak_factory_.GetWeakPtr()),
|
| base::TimeDelta::FromMilliseconds(kTouchDownContextResetTimeout));
|
| } else {
|
| if (input[i].dwFlags & TOUCHEVENTF_MOVE) {
|
| @@ -2249,10 +2249,9 @@ LRESULT HWNDMessageHandler::OnTouchEvent(UINT message,
|
| // Handle the touch events asynchronously. We need this because touch
|
| // events on windows don't fire if we enter a modal loop in the context of
|
| // a touch event.
|
| - base::MessageLoop::current()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&HWNDMessageHandler::HandleTouchEvents,
|
| - weak_factory_.GetWeakPtr(), touch_events));
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| + FROM_HERE, base::Bind(&HWNDMessageHandler::HandleTouchEvents,
|
| + weak_factory_.GetWeakPtr(), touch_events));
|
| }
|
| CloseTouchInputHandle(reinterpret_cast<HTOUCHINPUT>(l_param));
|
| SetMsgHandled(FALSE);
|
| @@ -2320,10 +2319,9 @@ void HWNDMessageHandler::OnWindowPosChanging(WINDOWPOS* window_pos) {
|
| // likes to (incorrectly) recalculate what our position/size should be
|
| // and send us further updates.
|
| ignore_window_pos_changes_ = true;
|
| - base::MessageLoop::current()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&HWNDMessageHandler::StopIgnoringPosChanges,
|
| - weak_factory_.GetWeakPtr()));
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| + FROM_HERE, base::Bind(&HWNDMessageHandler::StopIgnoringPosChanges,
|
| + weak_factory_.GetWeakPtr()));
|
| }
|
| last_monitor_ = monitor;
|
| last_monitor_rect_ = monitor_rect;
|
|
|