Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: chrome/browser/automation/ui_controls_aurawin.cc

Issue 8585015: Implement ui_controls for aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698