OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/ui_controls/ui_controls.h" | 5 #include "ui/ui_controls/ui_controls.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #include <mach/mach_time.h> | 8 #include <mach/mach_time.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 base::Bind(&EventQueueWatcher, task)); | 202 base::Bind(&EventQueueWatcher, task)); |
203 } else { | 203 } else { |
204 MessageLoop::current()->PostTask(FROM_HERE, task); | 204 MessageLoop::current()->PostTask(FROM_HERE, task); |
205 } | 205 } |
206 } | 206 } |
207 | 207 |
208 // Stores the current mouse location on the screen. So that we can use it | 208 // Stores the current mouse location on the screen. So that we can use it |
209 // when firing keyboard and mouse click events. | 209 // when firing keyboard and mouse click events. |
210 NSPoint g_mouse_location = { 0, 0 }; | 210 NSPoint g_mouse_location = { 0, 0 }; |
211 | 211 |
212 } // anonymous namespace | 212 } // namespace |
213 | 213 |
214 namespace ui_controls { | 214 namespace ui_controls { |
215 | 215 |
216 bool SendKeyPress(gfx::NativeWindow window, | 216 bool SendKeyPress(gfx::NativeWindow window, |
217 ui::KeyboardCode key, | 217 ui::KeyboardCode key, |
218 bool control, | 218 bool control, |
219 bool shift, | 219 bool shift, |
220 bool alt, | 220 bool alt, |
221 bool command) { | 221 bool command) { |
222 return SendKeyPressNotifyWhenDone(window, key, | 222 return SendKeyPressNotifyWhenDone(window, key, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 } | 351 } |
352 | 352 |
353 return true; | 353 return true; |
354 } | 354 } |
355 | 355 |
356 bool SendMouseClick(MouseButton type) { | 356 bool SendMouseClick(MouseButton type) { |
357 return SendMouseEventsNotifyWhenDone(type, UP|DOWN, base::Closure()); | 357 return SendMouseEventsNotifyWhenDone(type, UP|DOWN, base::Closure()); |
358 } | 358 } |
359 | 359 |
360 } // namespace ui_controls | 360 } // namespace ui_controls |
OLD | NEW |