1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_UI_CONTROLS_UI_CONTROLS_AURA_H_
6 #define UI_UI_CONTROLS_UI_CONTROLS_AURA_H_
8 #include "base/callback_forward.h"
9 #include "ui/base/keycodes/keyboard_codes.h"
10 #include "ui/base/ui_export.h"
11 #include "ui/gfx/native_widget_types.h"
12 #include "ui/ui_controls/ui_controls.h"
14 namespace ui_controls
{
16 // An interface to provide Aura implementation of UI control.
17 class UI_EXPORT UIControlsAura
{
20 virtual ~UIControlsAura();
22 virtual bool SendKeyPress(gfx::NativeWindow window
,
28 virtual bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window
,
34 const base::Closure
& task
) = 0;
36 // Simulate a mouse move. (x,y) are absolute screen coordinates.
37 virtual bool SendMouseMove(long x
, long y
) = 0;
38 virtual bool SendMouseMoveNotifyWhenDone(long x
,
40 const base::Closure
& task
) = 0;
42 // Sends a mouse down and/or up message. The click will be sent to wherever
43 // the cursor currently is, so be sure to move the cursor before calling this
44 // (and be sure the cursor has arrived!).
45 virtual bool SendMouseEvents(MouseButton type
, int state
) =0;
46 virtual bool SendMouseEventsNotifyWhenDone(MouseButton type
, int state
,
47 const base::Closure
& task
) = 0;
48 // Same as SendMouseEvents with BUTTON_UP | BUTTON_DOWN.
49 virtual bool SendMouseClick(MouseButton type
) = 0;
51 // Runs |closure| after processing all pending ui events.
52 virtual void RunClosureAfterAllPendingUIEvents(
53 const base::Closure
& closure
) = 0;
56 } // namespace ui_controls
58 #endif // UI_UI_CONTROLS_UI_CONTROLS_AURA_H_