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

Side by Side Diff: ui/base/test/scoped_fake_full_keyboard_access.h

Issue 1690543004: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_BASE_TEST_SCOPED_FAKE_FULL_KEYBOARD_ACCESS_H_
6 #define UI_BASE_TEST_SCOPED_FAKE_FULL_KEYBOARD_ACCESS_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11
12 namespace base {
13 namespace mac {
14 class ScopedObjCClassSwizzler;
15 }
16 }
17
18 namespace ui {
19 namespace test {
20
21 // Swizzles [NSApplication isFullKeyboardAccessEnabled] so that it returns the
22 // value set using SetFullKeyboardAccessState.
23 class ScopedFakeFullKeyboardAccess {
24 public:
25 ScopedFakeFullKeyboardAccess();
26 ~ScopedFakeFullKeyboardAccess();
27
28 // Set the value to be returned by
29 // [NSApplication isFullKeyboardAccessEnabled].
30 void SetFullKeyboardAccessState(bool new_state);
31
32 private:
33 std::unique_ptr<base::mac::ScopedObjCClassSwizzler> swizzler_;
34
35 DISALLOW_COPY_AND_ASSIGN(ScopedFakeFullKeyboardAccess);
36 };
37
38 } // namespace test
39 } // namespace ui
40
41 #endif // UI_BASE_TEST_SCOPED_FAKE_FULL_KEYBOARD_ACCESS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698