| Index: chrome/browser/automation/ui_controls_mac.mm
|
| diff --git a/chrome/browser/automation/ui_controls_mac.mm b/chrome/browser/automation/ui_controls_mac.mm
|
| index 6e38ef7ac8d081a870e08e62b9c36d32c931471a..ad2242ca457d6bc464a0787ecb5a444da6967013 100644
|
| --- a/chrome/browser/automation/ui_controls_mac.mm
|
| +++ b/chrome/browser/automation/ui_controls_mac.mm
|
| @@ -8,6 +8,7 @@
|
| #include <mach/mach_time.h>
|
| #include <vector>
|
|
|
| +#include "base/callback.h"
|
| #include "base/message_loop.h"
|
| #include "chrome/browser/automation/ui_controls_internal.h"
|
| #include "content/browser/browser_thread.h"
|
| @@ -189,10 +190,9 @@ void SynthesizeKeyEventsSequence(NSWindow* window,
|
|
|
| // A task class to watch for the event queue. The specific task will be fired
|
| // when there is no more event in the queue.
|
| -class EventQueueWatcher : public Task {
|
| +class EventQueueWatcher : public base::Closure {
|
| public:
|
| - EventQueueWatcher(Task* task) : task_(task) {}
|
| -
|
| + EventQueueWatcher(const base::Closure& task) : task_(task) {}
|
| virtual ~EventQueueWatcher() {}
|
|
|
| virtual void Run() {
|
| @@ -202,13 +202,13 @@ class EventQueueWatcher : public Task {
|
| dequeue:NO];
|
| // If there is still event in the queue, then we need to check again.
|
| if (event)
|
| - MessageLoop::current()->PostTask(FROM_HERE, new EventQueueWatcher(task_));
|
| + MessageLoop::current()->PostTask(FROM_HERE, EventQueueWatcher(task_));
|
| else
|
| MessageLoop::current()->PostTask(FROM_HERE, task_);
|
| }
|
|
|
| private:
|
| - Task* task_;
|
| + base::Closure task_;
|
| };
|
|
|
| // Stores the current mouse location on the screen. So that we can use it
|
| @@ -228,7 +228,7 @@ bool SendKeyPress(gfx::NativeWindow window,
|
| bool command) {
|
| return SendKeyPressNotifyWhenDone(window, key,
|
| control, shift, alt, command,
|
| - NULL);
|
| + base::Closure());
|
| }
|
|
|
| // Win and Linux implement a SendKeyPress() this as a
|
| @@ -239,7 +239,7 @@ bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
|
| bool shift,
|
| bool alt,
|
| bool command,
|
| - Task* task) {
|
| + const base::Closure& task) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| std::vector<NSEvent*> events;
|
| @@ -361,7 +361,7 @@ void MoveMouseToCenterAndPress(
|
| NSView* view,
|
| MouseButton button,
|
| int state,
|
| - Task* task) {
|
| + const base::Closure& task) {
|
| DCHECK(view);
|
| NSWindow* window = [view window];
|
| DCHECK(window);
|
| @@ -377,7 +377,7 @@ void MoveMouseToCenterAndPress(
|
| center = NSMakePoint(center.x, [screen frame].size.height - center.y);
|
|
|
| SendMouseMoveNotifyWhenDone(center.x, center.y,
|
| - new ClickTask(button, state, task));
|
| + ClickTask(button, state, task));
|
| }
|
|
|
| } // ui_controls
|
|
|