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

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

Issue 1894383002: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SetFocusBehavior
Patch Set: Rebased. 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 [NSApp isFullKeyboardAccessEnabled] so that it returns the value set
22 // using SetFullKeyboardAccessState.
23 class ScopedFakeFullKeyboardAccess {
24 public:
25 ScopedFakeFullKeyboardAccess();
26 ~ScopedFakeFullKeyboardAccess();
27
28 // Set the value to be returned by [NSApp isFullKeyboardAccessEnabled].
29 void SetFullKeyboardAccessState(bool new_state);
30
31 private:
32 std::unique_ptr<base::mac::ScopedObjCClassSwizzler> swizzler_;
33
34 DISALLOW_COPY_AND_ASSIGN(ScopedFakeFullKeyboardAccess);
35 };
36
37 } // namespace test
38 } // namespace ui
39
40 #endif // UI_BASE_TEST_SCOPED_FAKE_FULL_KEYBOARD_ACCESS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698