| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/base/test/ui_controls.h" | 5 #include "ui/base/test/ui_controls.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace | 174 } // namespace |
| 175 | 175 |
| 176 namespace ui_controls { | 176 namespace ui_controls { |
| 177 | 177 |
| 178 void EnableUIControls() { | 178 void EnableUIControls() { |
| 179 g_ui_controls_enabled = true; | 179 g_ui_controls_enabled = true; |
| 180 } | 180 } |
| 181 | 181 |
| 182 bool IsUIControlsEnabled() { |
| 183 return g_ui_controls_enabled; |
| 184 } |
| 185 |
| 182 bool SendKeyPress(gfx::NativeWindow window, | 186 bool SendKeyPress(gfx::NativeWindow window, |
| 183 ui::KeyboardCode key, | 187 ui::KeyboardCode key, |
| 184 bool control, | 188 bool control, |
| 185 bool shift, | 189 bool shift, |
| 186 bool alt, | 190 bool alt, |
| 187 bool command) { | 191 bool command) { |
| 188 CHECK(g_ui_controls_enabled); | 192 CHECK(g_ui_controls_enabled); |
| 189 return SendKeyPressNotifyWhenDone(window, key, | 193 return SendKeyPressNotifyWhenDone(window, key, |
| 190 control, shift, alt, command, | 194 control, shift, alt, command, |
| 191 base::Closure()); | 195 base::Closure()); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) { | 339 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) { |
| 336 base::MessageLoop::current()->PostTask( | 340 base::MessageLoop::current()->PostTask( |
| 337 FROM_HERE, base::Bind(&EventQueueWatcher, closure)); | 341 FROM_HERE, base::Bind(&EventQueueWatcher, closure)); |
| 338 } | 342 } |
| 339 | 343 |
| 340 bool IsFullKeyboardAccessEnabled() { | 344 bool IsFullKeyboardAccessEnabled() { |
| 341 return [NSApp isFullKeyboardAccessEnabled]; | 345 return [NSApp isFullKeyboardAccessEnabled]; |
| 342 } | 346 } |
| 343 | 347 |
| 344 } // namespace ui_controls | 348 } // namespace ui_controls |
| OLD | NEW |