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

Unified Diff: chrome/browser/ui/views/browser_actions_container.cc

Issue 8301022: ui/views: Migrate usages of ScopedRunnableMethodFactory to base::WeakPtrFactory/base::Bind pair. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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/browser_actions_container.cc
diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc
index c544de8224dee80b631231efe7d24f69c5589ec7..697ce7c66748d14d199d4cad093cff78b845edf1 100644
--- a/chrome/browser/ui/views/browser_actions_container.cc
+++ b/chrome/browser/ui/views/browser_actions_container.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/browser_actions_container.h"
+#include "base/bind.h"
#include "base/stl_util.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
@@ -602,7 +603,7 @@ int BrowserActionsContainer::OnDragUpdated(
const views::DropTargetEvent& event) {
// First check if we are above the chevron (overflow) menu.
if (GetEventHandlerForPoint(event.location()) == chevron_) {
- if (show_menu_task_factory_.empty() && !overflow_menu_)
+ if (!show_menu_task_factory_.HasWeakPtrs() && !overflow_menu_)
StartShowFolderDropMenuTimer();
return ui::DragDropTypes::DRAG_MOVE;
}
@@ -1011,14 +1012,15 @@ void BrowserActionsContainer::CloseOverflowMenu() {
}
void BrowserActionsContainer::StopShowFolderDropMenuTimer() {
- show_menu_task_factory_.RevokeAll();
+ show_menu_task_factory_.InvalidateWeakPtrs();
}
void BrowserActionsContainer::StartShowFolderDropMenuTimer() {
int delay = views::GetMenuShowDelay();
- MessageLoop::current()->PostDelayedTask(FROM_HERE,
- show_menu_task_factory_.NewRunnableMethod(
- &BrowserActionsContainer::ShowDropFolder),
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&BrowserActionsContainer::ShowDropFolder,
+ show_menu_task_factory_.GetWeakPtr()),
delay);
}
« no previous file with comments | « chrome/browser/ui/views/browser_actions_container.h ('k') | chrome/browser/ui/views/download/download_item_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698