OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/callback.h" | 7 #include "base/callback.h" |
8 #include "chrome/browser/automation/ui_controls_internal.h" | 8 #include "chrome/browser/automation/ui_controls_internal.h" |
9 #include "ui/gfx/point.h" | 9 #include "ui/gfx/point.h" |
10 #include "views/view.h" | 10 #include "ui/views/view.h" |
11 | 11 |
12 namespace ui_controls { | 12 namespace ui_controls { |
13 | 13 |
14 bool SendKeyPress(gfx::NativeWindow window, | 14 bool SendKeyPress(gfx::NativeWindow window, |
15 ui::KeyboardCode key, | 15 ui::KeyboardCode key, |
16 bool control, | 16 bool control, |
17 bool shift, | 17 bool shift, |
18 bool alt, | 18 bool alt, |
19 bool command) { | 19 bool command) { |
20 DCHECK(!command); // No command key on Windows | 20 DCHECK(!command); // No command key on Windows |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const base::Closure& task) { | 59 const base::Closure& task) { |
60 DCHECK(view); | 60 DCHECK(view); |
61 DCHECK(view->GetWidget()); | 61 DCHECK(view->GetWidget()); |
62 gfx::Point view_center(view->width() / 2, view->height() / 2); | 62 gfx::Point view_center(view->width() / 2, view->height() / 2); |
63 views::View::ConvertPointToScreen(view, &view_center); | 63 views::View::ConvertPointToScreen(view, &view_center); |
64 SendMouseMove(view_center.x(), view_center.y()); | 64 SendMouseMove(view_center.x(), view_center.y()); |
65 SendMouseEventsNotifyWhenDone(button, state, task); | 65 SendMouseEventsNotifyWhenDone(button, state, task); |
66 } | 66 } |
67 | 67 |
68 } // ui_controls | 68 } // ui_controls |
OLD | NEW |