Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Side by Side Diff: ui/base/test/ui_controls_mac.mm

Issue 1782773002: MacViews: Fix ViewTest.HandleAccelerator by faking window activation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Faked activations for everyone! Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/base/test/ui_controls.h ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/base/test/ui_controls.h ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698