| Index: chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
|
| diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
|
| index 8303b9c1b900988d3395e20546503824045b82d5..4b31f66f74a3a3e14e70f3673e84733ad872a821 100644
|
| --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
|
| +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
|
| @@ -2,6 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "base/bind.h"
|
| +#include "base/callback.h"
|
| #include "base/compiler_specific.h"
|
| #include "base/string_number_conversions.h"
|
| #include "base/utf_string_conversions.h"
|
| @@ -472,7 +474,8 @@ VIEW_TEST(BookmarkBarViewTest3, Submenus)
|
| // the clipboard, which invokes the event loop.
|
| class ContextMenuNotificationObserver : public NotificationObserver {
|
| public:
|
| - explicit ContextMenuNotificationObserver(Task* task) : task_(task) {
|
| + explicit ContextMenuNotificationObserver(const base::Closure& task)
|
| + : task_(task) {
|
| registrar_.Add(this,
|
| chrome::NOTIFICATION_BOOKMARK_CONTEXT_MENU_SHOWN,
|
| NotificationService::AllSources());
|
| @@ -485,11 +488,11 @@ class ContextMenuNotificationObserver : public NotificationObserver {
|
| }
|
|
|
| // Sets the task that is posted when the context menu is shown.
|
| - void set_task(Task* task) { task_ = task; }
|
| + void set_task(const base::Closure& task) { task_ = task; }
|
|
|
| private:
|
| NotificationRegistrar registrar_;
|
| - Task* task_;
|
| + base::Closure task_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ContextMenuNotificationObserver);
|
| };
|
| @@ -527,7 +530,7 @@ class BookmarkBarViewTest4 : public BookmarkBarViewEventTestBase {
|
|
|
| // Right click on the first child to get its context menu.
|
| ui_controls::MoveMouseToCenterAndPress(child_menu, ui_controls::RIGHT,
|
| - ui_controls::DOWN | ui_controls::UP, NULL);
|
| + ui_controls::DOWN | ui_controls::UP, base::Closure());
|
| // Step3 will be invoked by ContextMenuNotificationObserver.
|
| }
|
|
|
| @@ -703,7 +706,7 @@ class BookmarkBarViewTest7 : public BookmarkBarViewEventTestBase {
|
|
|
| // Start a drag.
|
| ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(),
|
| - NewRunnableMethod(this, &BookmarkBarViewTest7::Step4));
|
| + base::Bind(&BookmarkBarViewTest7::Step4, this));
|
|
|
| // See comment above this method as to why we do this.
|
| ScheduleMouseMoveInBackground(loc.x(), loc.y());
|
| @@ -776,7 +779,7 @@ class BookmarkBarViewTest8 : public BookmarkBarViewEventTestBase {
|
|
|
| // Start a drag.
|
| ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(),
|
| - NewRunnableMethod(this, &BookmarkBarViewTest8::Step4));
|
| + base::Bind(&BookmarkBarViewTest8::Step4, this));
|
|
|
| // See comment above this method as to why we do this.
|
| ScheduleMouseMoveInBackground(loc.x(), loc.y());
|
| @@ -792,7 +795,7 @@ class BookmarkBarViewTest8 : public BookmarkBarViewEventTestBase {
|
| gfx::Point loc(button->width() / 2, button->height() / 2);
|
| views::View::ConvertPointToScreen(button, &loc);
|
| ui_controls::SendMouseMoveNotifyWhenDone(loc.x(), loc.y(),
|
| - NewRunnableMethod(this, &BookmarkBarViewTest8::Step5));
|
| + base::Bind(&BookmarkBarViewTest8::Step5, this));
|
| }
|
|
|
| void Step5() {
|
| @@ -866,7 +869,7 @@ class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase {
|
|
|
| void Step3() {
|
| MessageLoop::current()->PostDelayedTask(FROM_HERE,
|
| - NewRunnableMethod(this, &BookmarkBarViewTest9::Step4), 200);
|
| + base::Bind(&BookmarkBarViewTest9::Step4, this), 200);
|
| }
|
|
|
| void Step4() {
|
| @@ -882,7 +885,7 @@ class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase {
|
| // next execution loop.
|
| MessageLoop::current()->PostTask(
|
| FROM_HERE,
|
| - NewRunnableMethod(this, &ViewEventTestBase::Done));
|
| + base::Bind(&ViewEventTestBase::Done, this));
|
| }
|
|
|
| int start_y_;
|
| @@ -1031,7 +1034,7 @@ class BookmarkBarViewTest11 : public BookmarkBarViewEventTestBase {
|
|
|
| // Right click on the first child to get its context menu.
|
| ui_controls::MoveMouseToCenterAndPress(child_menu, ui_controls::RIGHT,
|
| - ui_controls::DOWN | ui_controls::UP, NULL);
|
| + ui_controls::DOWN | ui_controls::UP, base::Closure());
|
| // Step3 will be invoked by ContextMenuNotificationObserver.
|
| }
|
|
|
| @@ -1117,7 +1120,7 @@ class BookmarkBarViewTest12 : public BookmarkBarViewEventTestBase {
|
| menu->GetSubmenu()->GetMenuItemAt(0);
|
| ASSERT_TRUE(child_menu != NULL);
|
| ui_controls::MoveMouseToCenterAndPress(child_menu, ui_controls::LEFT,
|
| - ui_controls::DOWN | ui_controls::UP, NULL);
|
| + ui_controls::DOWN | ui_controls::UP, base::Closure());
|
|
|
| // Delay until we send tab, otherwise the message box doesn't appear
|
| // correctly.
|
| @@ -1186,7 +1189,7 @@ class BookmarkBarViewTest13 : public BookmarkBarViewEventTestBase {
|
|
|
| // Right click on the first child to get its context menu.
|
| ui_controls::MoveMouseToCenterAndPress(child_menu, ui_controls::RIGHT,
|
| - ui_controls::DOWN | ui_controls::UP, NULL);
|
| + ui_controls::DOWN | ui_controls::UP, base::Closure());
|
| // Step3 will be invoked by ContextMenuNotificationObserver.
|
| }
|
|
|
| @@ -1252,7 +1255,7 @@ class BookmarkBarViewTest14 : public BookmarkBarViewEventTestBase {
|
| // right mouse button.
|
| views::TextButton* button = GetBookmarkButton(0);
|
| ui_controls::MoveMouseToCenterAndPress(button, ui_controls::RIGHT,
|
| - ui_controls::DOWN | ui_controls::UP, NULL);
|
| + ui_controls::DOWN | ui_controls::UP, base::Closure());
|
| // Step2 will be invoked by ContextMenuNotificationObserver.
|
| }
|
|
|
| @@ -1311,7 +1314,7 @@ class BookmarkBarViewTest15 : public BookmarkBarViewEventTestBase {
|
|
|
| // Right click on the second child to get its context menu.
|
| ui_controls::MoveMouseToCenterAndPress(child_menu, ui_controls::RIGHT,
|
| - ui_controls::DOWN | ui_controls::UP, NULL);
|
| + ui_controls::DOWN | ui_controls::UP, base::Closure());
|
| // Step3 will be invoked by ContextMenuNotificationObserver.
|
| }
|
|
|
| @@ -1420,7 +1423,7 @@ class BookmarkBarViewTest17 : public BookmarkBarViewEventTestBase {
|
| views::MenuItemView* child_menu = menu->GetSubmenu()->GetMenuItemAt(2);
|
| ASSERT_TRUE(child_menu != NULL);
|
| ui_controls::MoveMouseToCenterAndPress(child_menu, ui_controls::RIGHT,
|
| - ui_controls::DOWN | ui_controls::UP, NULL);
|
| + ui_controls::DOWN | ui_controls::UP, base::Closure());
|
| // Step3 will be invoked by ContextMenuNotificationObserver.
|
| }
|
|
|
| @@ -1440,7 +1443,7 @@ class BookmarkBarViewTest17 : public BookmarkBarViewEventTestBase {
|
|
|
| observer_.set_task(CreateEventTask(this, &BookmarkBarViewTest17::Step4));
|
| ui_controls::MoveMouseToCenterAndPress(child_menu, ui_controls::RIGHT,
|
| - ui_controls::DOWN | ui_controls::UP, NULL);
|
| + ui_controls::DOWN | ui_controls::UP, base::Closure());
|
| // Step4 will be invoked by ContextMenuNotificationObserver.
|
| }
|
|
|
|
|