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

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_button.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/views/toolbar/toolbar_button.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc
index 2bd587a65f8909256a98fb46b3de2527e1fddad8..fd01ae30981975ceedf4082eca115254ae2371f7 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_button.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc
@@ -5,6 +5,9 @@
#include "chrome/browser/ui/views/toolbar/toolbar_button.h"
#include "base/bind.h"
+#include "base/location.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "ui/accessibility/ax_view_state.h"
#include "ui/base/l10n/l10n_util.h"
@@ -64,11 +67,10 @@ bool ToolbarButton::OnMousePressed(const ui::MouseEvent& event) {
// Schedule a task that will show the menu.
const int kMenuTimerDelay = 500;
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&ToolbarButton::ShowDropDownMenu,
- show_menu_factory_.GetWeakPtr(),
- ui::GetMenuSourceTypeForEvent(event)),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&ToolbarButton::ShowDropDownMenu,
+ show_menu_factory_.GetWeakPtr(),
+ ui::GetMenuSourceTypeForEvent(event)),
base::TimeDelta::FromMilliseconds(kMenuTimerDelay));
}
return LabelButton::OnMousePressed(event);

Powered by Google App Engine
This is Rietveld 408576698