This source file includes following definitions.
- EnableUIControls
- SendKeyPress
- SendKeyPressNotifyWhenDone
- SendMouseMove
- SendMouseMoveNotifyWhenDone
- SendMouseEvents
- SendMouseEventsNotifyWhenDone
- SendMouseClick
- RunClosureAfterAllPendingUIEvents
- InstallUIControlsAura
#include "ui/base/test/ui_controls_aura.h"
#include "base/logging.h"
namespace ui_controls {
namespace {
UIControlsAura* instance_ = NULL;
bool g_ui_controls_enabled = false;
}
void EnableUIControls() {
g_ui_controls_enabled = true;
}
bool SendKeyPress(gfx::NativeWindow window,
ui::KeyboardCode key,
bool control,
bool shift,
bool alt,
bool command) {
CHECK(g_ui_controls_enabled);
return instance_->SendKeyPress(
window, key, control, shift, alt, command);
}
bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
ui::KeyboardCode key,
bool control,
bool shift,
bool alt,
bool command,
const base::Closure& task) {
CHECK(g_ui_controls_enabled);
return instance_->SendKeyPressNotifyWhenDone(
window, key, control, shift, alt, command, task);
}
bool SendMouseMove(long x, long y) {
CHECK(g_ui_controls_enabled);
return instance_->SendMouseMove(x, y);
}
bool SendMouseMoveNotifyWhenDone(long x,
long y,
const base::Closure& task) {
CHECK(g_ui_controls_enabled);
return instance_->SendMouseMoveNotifyWhenDone(x, y, task);
}
bool SendMouseEvents(MouseButton type, int state) {
CHECK(g_ui_controls_enabled);
return instance_->SendMouseEvents(type, state);
}
bool SendMouseEventsNotifyWhenDone(MouseButton type,
int state,
const base::Closure& task) {
CHECK(g_ui_controls_enabled);
return instance_->SendMouseEventsNotifyWhenDone(type, state, task);
}
bool SendMouseClick(MouseButton type) {
CHECK(g_ui_controls_enabled);
return instance_->SendMouseClick(type);
}
void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) {
instance_->RunClosureAfterAllPendingUIEvents(closure);
}
UIControlsAura::UIControlsAura() {
}
UIControlsAura::~UIControlsAura() {
}
void InstallUIControlsAura(UIControlsAura* instance) {
delete instance_;
instance_ = instance;
}
}