| Index: ui/ui_controls/ui_controls_win.cc
|
| diff --git a/ui/ui_controls/ui_controls_win.cc b/ui/ui_controls/ui_controls_win.cc
|
| index e411a1779bcb2c2eeb53baff8fa8272ad09c60d4..d895c7f7b83778cc65e32b02fa0f671e35d69665 100644
|
| --- a/ui/ui_controls/ui_controls_win.cc
|
| +++ b/ui/ui_controls/ui_controls_win.cc
|
| @@ -12,52 +12,71 @@
|
|
|
| namespace ui_controls {
|
|
|
| -bool SendKeyPress(gfx::NativeWindow window,
|
| - ui::KeyboardCode key,
|
| - bool control,
|
| - bool shift,
|
| - bool alt,
|
| - bool command) {
|
| - DCHECK(!command); // No command key on Windows
|
| - return internal::SendKeyPressImpl(window, key, control, shift, alt,
|
| - base::Closure());
|
| -}
|
| +namespace {
|
|
|
| -bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
|
| - ui::KeyboardCode key,
|
| - bool control,
|
| - bool shift,
|
| - bool alt,
|
| - bool command,
|
| - const base::Closure& task) {
|
| - DCHECK(!command); // No command key on Windows
|
| - return internal::SendKeyPressImpl(window, key, control, shift, alt, task);
|
| -}
|
| +class UIControlsWin : public UIControls {
|
| + public:
|
| + UIControlsWin() {}
|
| + virtual ~UIControlsWin() {}
|
|
|
| -bool SendMouseMove(long x, long y) {
|
| - return internal::SendMouseMoveImpl(x, y, base::Closure());
|
| -}
|
| + bool SendKeyPress(gfx::NativeWindow window,
|
| + ui::KeyboardCode key,
|
| + bool control,
|
| + bool shift,
|
| + bool alt,
|
| + bool command) OVERRIDE {
|
| + DCHECK(!command); // No command key on Windows
|
| + return internal::SendKeyPressImpl(window, key, control, shift, alt,
|
| + base::Closure());
|
| + }
|
|
|
| -bool SendMouseMoveNotifyWhenDone(long x, long y, const base::Closure& task) {
|
| - return internal::SendMouseMoveImpl(x, y, task);
|
| -}
|
| + bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
|
| + ui::KeyboardCode key,
|
| + bool control,
|
| + bool shift,
|
| + bool alt,
|
| + bool command,
|
| + const base::Closure& task) OVERRIDE {
|
| + DCHECK(!command); // No command key on Windows
|
| + return internal::SendKeyPressImpl(window, key, control, shift, alt, task);
|
| + }
|
|
|
| -bool SendMouseEvents(MouseButton type, int state) {
|
| - return internal::SendMouseEventsImpl(type, state, base::Closure());
|
| -}
|
| + bool SendMouseMove(long x, long y) OVERRIDE {
|
| + return internal::SendMouseMoveImpl(x, y, base::Closure());
|
| + }
|
|
|
| -bool SendMouseEventsNotifyWhenDone(MouseButton type, int state,
|
| - const base::Closure& task) {
|
| - return internal::SendMouseEventsImpl(type, state, task);
|
| -}
|
| + bool SendMouseMoveNotifyWhenDone(
|
| + long x, long y, const base::Closure& task) OVERRIDE {
|
| + return internal::SendMouseMoveImpl(x, y, task);
|
| + }
|
|
|
| -bool SendMouseClick(MouseButton type) {
|
| - return internal::SendMouseEventsImpl(type, UP | DOWN, base::Closure());
|
| -}
|
| + bool SendMouseEvents(MouseButton type, int state) OVERRIDE {
|
| + return internal::SendMouseEventsImpl(type, state, base::Closure());
|
| + }
|
| +
|
| + bool SendMouseEventsNotifyWhenDone(MouseButton type, int state,
|
| + const base::Closure& task) OVERRIDE {
|
| + return internal::SendMouseEventsImpl(type, state, task);
|
| + }
|
| +
|
| + bool SendMouseClick(MouseButton type) OVERRIDE {
|
| + return internal::SendMouseEventsImpl(type, UP | DOWN, base::Closure());
|
| + }
|
| +
|
| + void RunClosureAfterAllPendingUIEvents(
|
| + const base::Closure& closure) OVERRIDE {
|
| + // On windows, posting UI events is synchronous so just post the closure.
|
| + MessageLoopForUI::current()->PostTask(FROM_HERE, closure);
|
| + }
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(UIControlsWin);
|
| +};
|
| +
|
| +} // namespace
|
|
|
| -void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) {
|
| - // On windows, posting UI events is synchronous so just post the closure.
|
| - MessageLoopForUI::current()->PostTask(FROM_HERE, closure);
|
| +UIControls* CreateNativeUIControls() {
|
| + return new UIControlsWin;
|
| }
|
|
|
| } // namespace ui_controls
|
|
|