| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "ui/aura/root_window.h" | 8 #include "ui/aura/root_window.h" |
| 9 #include "ui/aura/test/ui_controls_factory_aura.h" | 9 #include "ui/aura/test/ui_controls_factory_aura.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 bool control, | 47 bool control, |
| 48 bool shift, | 48 bool shift, |
| 49 bool alt, | 49 bool alt, |
| 50 bool command, | 50 bool command, |
| 51 const base::Closure& task) { | 51 const base::Closure& task) { |
| 52 DCHECK(!command); // No command key on Aura | 52 DCHECK(!command); // No command key on Aura |
| 53 HWND window = | 53 HWND window = |
| 54 native_window->GetDispatcher()->host()->GetAcceleratedWidget(); | 54 native_window->GetDispatcher()->host()->GetAcceleratedWidget(); |
| 55 return SendKeyPressImpl(window, key, control, shift, alt, task); | 55 return SendKeyPressImpl(window, key, control, shift, alt, task); |
| 56 } | 56 } |
| 57 virtual bool SendMouseMove(long x, long y) { | 57 virtual bool SendMouseMove(long screen_x, long screen_y) { |
| 58 gfx::Point point(x, y); | 58 return SendMouseMoveImpl(screen_x, screen_y, base::Closure()); |
| 59 return SendMouseMoveImpl(point.x(), point.y(), base::Closure()); | |
| 60 } | 59 } |
| 61 virtual bool SendMouseMoveNotifyWhenDone(long x, | 60 virtual bool SendMouseMoveNotifyWhenDone(long screen_x, |
| 62 long y, | 61 long screen_y, |
| 63 const base::Closure& task) { | 62 const base::Closure& task) { |
| 64 gfx::Point point(x, y); | 63 return SendMouseMoveImpl(screen_x, screen_y, task); |
| 65 return SendMouseMoveImpl(point.x(), point.y(), task); | |
| 66 } | 64 } |
| 67 virtual bool SendMouseEvents(MouseButton type, int state) { | 65 virtual bool SendMouseEvents(MouseButton type, int state) { |
| 68 return SendMouseEventsImpl(type, state, base::Closure()); | 66 return SendMouseEventsImpl(type, state, base::Closure()); |
| 69 } | 67 } |
| 70 virtual bool SendMouseEventsNotifyWhenDone(MouseButton type, | 68 virtual bool SendMouseEventsNotifyWhenDone(MouseButton type, |
| 71 int state, | 69 int state, |
| 72 const base::Closure& task) { | 70 const base::Closure& task) { |
| 73 return SendMouseEventsImpl(type, state, task); | 71 return SendMouseEventsImpl(type, state, task); |
| 74 } | 72 } |
| 75 virtual bool SendMouseClick(MouseButton type) { | 73 virtual bool SendMouseClick(MouseButton type) { |
| 76 return SendMouseEvents(type, UP | DOWN); | 74 return SendMouseEvents(type, UP | DOWN); |
| 77 } | 75 } |
| 78 virtual void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) { | 76 virtual void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) { |
| 79 // On windows, posting UI events is synchronous so just post the closure. | 77 // On windows, posting UI events is synchronous so just post the closure. |
| 80 base::MessageLoopForUI::current()->PostTask(FROM_HERE, closure); | 78 base::MessageLoopForUI::current()->PostTask(FROM_HERE, closure); |
| 81 } | 79 } |
| 82 | 80 |
| 83 private: | 81 private: |
| 84 DISALLOW_COPY_AND_ASSIGN(UIControlsWin); | 82 DISALLOW_COPY_AND_ASSIGN(UIControlsWin); |
| 85 }; | 83 }; |
| 86 | 84 |
| 87 } // namespace | 85 } // namespace |
| 88 | 86 |
| 89 UIControlsAura* CreateUIControlsAura(aura::RootWindow* root_window) { | 87 UIControlsAura* CreateUIControlsAura(aura::RootWindow* root_window) { |
| 90 return new UIControlsWin(); | 88 return new UIControlsWin(); |
| 91 } | 89 } |
| 92 | 90 |
| 93 } // namespace test | 91 } // namespace test |
| 94 } // namespace aura | 92 } // namespace aura |
| OLD | NEW |