Chromium Code Reviews| Index: chrome/browser/automation/ui_controls_aurawin.cc |
| diff --git a/chrome/browser/automation/ui_controls_aura.cc b/chrome/browser/automation/ui_controls_aurawin.cc |
| similarity index 56% |
| rename from chrome/browser/automation/ui_controls_aura.cc |
| rename to chrome/browser/automation/ui_controls_aurawin.cc |
| index d3bbb96c101294011eb45e9d46868e78dd28e9e6..5ac42c665572193ee7b965c7e7a9a248d81f3e69 100644 |
| --- a/chrome/browser/automation/ui_controls_aura.cc |
| +++ b/chrome/browser/automation/ui_controls_aurawin.cc |
| @@ -5,6 +5,8 @@ |
| #include "chrome/browser/automation/ui_controls.h" |
| #include "base/logging.h" |
| +#include "chrome/browser/automation/ui_controls_internal.h" |
| +#include "ui/aura/desktop.h" |
| #include "views/view.h" |
| namespace ui_controls { |
| @@ -15,9 +17,8 @@ bool SendKeyPress(gfx::NativeWindow window, |
| bool shift, |
| bool alt, |
| bool command) { |
| - // http://crbug.com/104396 |
| - NOTIMPLEMENTED(); |
| - return true; |
| + DCHECK(!command); // No command key on Aura |
| + return internal::SendKeyPressImpl(key, control, shift, alt, base::Closure()); |
| } |
| bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, |
| @@ -27,34 +28,29 @@ bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, |
| bool alt, |
| bool command, |
| const base::Closure& task) { |
| - // http://crbug.com/104396 |
| - NOTIMPLEMENTED(); |
| - return true; |
| + DCHECK(!command); // No command key on Aura |
| + return internal::SendKeyPressImpl(key, control, shift, alt, task); |
| } |
| bool SendMouseMove(long x, long y) { |
| - // http://crbug.com/104396 |
| - NOTIMPLEMENTED(); |
| - return true; |
| + gfx::Point point(x, y); |
| + aura::Desktop::GetInstance()->ConvertPointToNativeScreen(&point); |
| + return internal::SendMouseMoveImpl(point.x(), point.y(), base::Closure()); |
| } |
| bool SendMouseMoveNotifyWhenDone(long x, long y, const base::Closure& task) { |
| - // http://crbug.com/104396 |
| - NOTIMPLEMENTED(); |
| - return true; |
| + gfx::Point point(x, y); |
| + aura::Desktop::GetInstance()->ConvertPointToNativeScreen(&point); |
| + return internal::SendMouseMoveImpl(point.x(), point.y(), task); |
| } |
| bool SendMouseEvents(MouseButton type, int state) { |
| - // http://crbug.com/104396 |
| - NOTIMPLEMENTED(); |
| - return true; |
| + return internal::SendMouseEventsImpl(type, state, base::Closure()); |
| } |
| bool SendMouseEventsNotifyWhenDone(MouseButton type, int state, |
| const base::Closure& task) { |
| - // http://crbug.com/104396 |
| - NOTIMPLEMENTED(); |
| - return true; |
| + return internal::SendMouseEventsImpl(type, state, task); |
| } |
| bool SendMouseClick(MouseButton type) { |
| @@ -63,8 +59,12 @@ bool SendMouseClick(MouseButton type) { |
| void MoveMouseToCenterAndPress(views::View* view, MouseButton button, |
|
sky
2011/11/22 00:28:33
nit: each param on its own line.
oshima
2011/11/22 01:36:10
Done.
|
| int state, const base::Closure& task) { |
| - // http://crbug.com/104396 |
| - NOTIMPLEMENTED(); |
| + DCHECK(view); |
| + DCHECK(view->GetWidget()); |
| + gfx::Point view_center(view->width() / 2, view->height() / 2); |
| + views::View::ConvertPointToScreen(view, &view_center); |
| + SendMouseMove(view_center.x(), view_center.y()); |
| + SendMouseEventsNotifyWhenDone(button, state, task); |
| } |
| } // namespace ui_controls |