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