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

Unified Diff: chrome/browser/automation/ui_controls_internal.h

Issue 2986004: [Mac]Port browser_keyevents_browsertest.cc and browser_focus_uitest.cc to Mac. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Enable BrowserFocusTest and BrowserKeyEventsTests on Mac. Created 10 years, 5 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
« no previous file with comments | « chrome/browser/automation/ui_controls.h ('k') | chrome/browser/automation/ui_controls_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/ui_controls_internal.h
diff --git a/chrome/browser/automation/ui_controls_internal.h b/chrome/browser/automation/ui_controls_internal.h
new file mode 100644
index 0000000000000000000000000000000000000000..88631c963c70d4034f819fd3de7af58254971230
--- /dev/null
+++ b/chrome/browser/automation/ui_controls_internal.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_AUTOMATION_UI_CONTROLS_INTERNAL_H_
+#define CHROME_BROWSER_AUTOMATION_UI_CONTROLS_INTERNAL_H_
+
+#include "base/message_loop.h"
+#include "chrome/browser/automation/ui_controls.h"
+
+namespace ui_controls {
+
+// A utility class to send a mouse click event in a task.
+// It's shared by ui_controls_linux.cc and ui_controls_mac.cc
+class ClickTask : public Task {
+ public:
+ // A |followup| Task can be specified to notify the caller when the mouse
+ // click event is sent. If can be NULL if the caller does not care about it.
+ ClickTask(MouseButton button, int state, Task* followup)
+ : button_(button), state_(state), followup_(followup) {
+ }
+
+ virtual ~ClickTask() {}
+
+ virtual void Run() {
+ if (followup_)
+ SendMouseEventsNotifyWhenDone(button_, state_, followup_);
+ else
+ SendMouseEvents(button_, state_);
+ }
+
+ private:
+ MouseButton button_;
+ int state_;
+ Task* followup_;
+};
+
+} // ui_controls
+
+#endif // CHROME_BROWSER_AUTOMATION_UI_CONTROLS_INTERNAL_H_
« no previous file with comments | « chrome/browser/automation/ui_controls.h ('k') | chrome/browser/automation/ui_controls_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698