OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_AUTOMATION_UI_CONTROLS_INTERNAL_H_ | 5 #ifndef CHROME_BROWSER_AUTOMATION_UI_CONTROLS_INTERNAL_H_ |
6 #define CHROME_BROWSER_AUTOMATION_UI_CONTROLS_INTERNAL_H_ | 6 #define CHROME_BROWSER_AUTOMATION_UI_CONTROLS_INTERNAL_H_ |
7 | 7 |
8 #include "base/task.h" | 8 #include "base/callback.h" |
9 #include "chrome/browser/automation/ui_controls.h" | 9 #include "chrome/browser/automation/ui_controls.h" |
10 | 10 |
11 namespace ui_controls { | 11 namespace ui_controls { |
12 | 12 |
13 // A utility class to send a mouse click event in a task. | 13 // A utility function to send a mouse click event in a closure. It's shared by |
14 // It's shared by ui_controls_linux.cc and ui_controls_mac.cc | 14 // ui_controls_linux.cc and ui_controls_mac.cc |
15 class ClickTask : public Task { | 15 void ClickTask(MouseButton button, int state, const base::Closure& followup) { |
awong
2011/10/11 01:18:04
Don't inline this function?
James Hawkins
2011/10/11 21:11:22
Done.
| |
16 public: | 16 if (!followup.is_null()) |
17 // A |followup| Task can be specified to notify the caller when the mouse | 17 SendMouseEventsNotifyWhenDone(button, state, followup); |
18 // click event is sent. If can be NULL if the caller does not care about it. | 18 else |
19 ClickTask(MouseButton button, int state, Task* followup); | 19 SendMouseEvents(button, state); |
20 virtual ~ClickTask(); | 20 } |
21 virtual void Run(); | |
22 | |
23 private: | |
24 MouseButton button_; | |
25 int state_; | |
26 Task* followup_; | |
27 }; | |
28 | 21 |
29 } // namespace ui_controls | 22 } // namespace ui_controls |
30 | 23 |
31 #endif // CHROME_BROWSER_AUTOMATION_UI_CONTROLS_INTERNAL_H_ | 24 #endif // CHROME_BROWSER_AUTOMATION_UI_CONTROLS_INTERNAL_H_ |
OLD | NEW |