| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/automation/ui_controls.h" | 5 #include "chrome/browser/automation/ui_controls.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "base/task.h" | 10 #include "base/task.h" |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 320 |
| 321 return true; | 321 return true; |
| 322 } | 322 } |
| 323 | 323 |
| 324 } // namespace | 324 } // namespace |
| 325 | 325 |
| 326 // public functions ----------------------------------------------------------- | 326 // public functions ----------------------------------------------------------- |
| 327 | 327 |
| 328 bool SendKeyPress(gfx::NativeWindow window, ui::KeyboardCode key, | 328 bool SendKeyPress(gfx::NativeWindow window, ui::KeyboardCode key, |
| 329 bool control, bool shift, bool alt, bool command) { | 329 bool control, bool shift, bool alt, bool command) { |
| 330 DCHECK(command == false); // No command key on Windows | 330 DCHECK_EQ(command, false); // No command key on Windows |
| 331 return SendKeyPressImpl(key, control, shift, alt, NULL); | 331 return SendKeyPressImpl(key, control, shift, alt, NULL); |
| 332 } | 332 } |
| 333 | 333 |
| 334 bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, | 334 bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, |
| 335 ui::KeyboardCode key, | 335 ui::KeyboardCode key, |
| 336 bool control, bool shift, bool alt, | 336 bool control, bool shift, bool alt, |
| 337 bool command, | 337 bool command, |
| 338 Task* task) { | 338 Task* task) { |
| 339 DCHECK(command == false); // No command key on Windows | 339 DCHECK_EQ(command, false); // No command key on Windows |
| 340 return SendKeyPressImpl(key, control, shift, alt, task); | 340 return SendKeyPressImpl(key, control, shift, alt, task); |
| 341 } | 341 } |
| 342 | 342 |
| 343 bool SendMouseMove(long x, long y) { | 343 bool SendMouseMove(long x, long y) { |
| 344 return SendMouseMoveImpl(x, y, NULL); | 344 return SendMouseMoveImpl(x, y, NULL); |
| 345 } | 345 } |
| 346 | 346 |
| 347 bool SendMouseMoveNotifyWhenDone(long x, long y, Task* task) { | 347 bool SendMouseMoveNotifyWhenDone(long x, long y, Task* task) { |
| 348 return SendMouseMoveImpl(x, y, task); | 348 return SendMouseMoveImpl(x, y, task); |
| 349 } | 349 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 364 int state, Task* task) { | 364 int state, Task* task) { |
| 365 DCHECK(view); | 365 DCHECK(view); |
| 366 DCHECK(view->GetWidget()); | 366 DCHECK(view->GetWidget()); |
| 367 gfx::Point view_center(view->width() / 2, view->height() / 2); | 367 gfx::Point view_center(view->width() / 2, view->height() / 2); |
| 368 views::View::ConvertPointToScreen(view, &view_center); | 368 views::View::ConvertPointToScreen(view, &view_center); |
| 369 SendMouseMove(view_center.x(), view_center.y()); | 369 SendMouseMove(view_center.x(), view_center.y()); |
| 370 SendMouseEventsNotifyWhenDone(button, state, task); | 370 SendMouseEventsNotifyWhenDone(button, state, task); |
| 371 } | 371 } |
| 372 | 372 |
| 373 } // ui_controls | 373 } // ui_controls |
| OLD | NEW |