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

Side by Side Diff: ui/base/test/scoped_fake_nswindow_focus.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, 7 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_ 5 #ifndef UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_
6 #define UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_ 6 #define UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 11
12 namespace base { 12 namespace base {
13 namespace mac { 13 namespace mac {
14 class ScopedObjCClassSwizzler; 14 class ScopedObjCClassSwizzler;
15 } 15 }
16 } 16 }
17 17
18 namespace ui { 18 namespace ui {
19 namespace test { 19 namespace test {
20 20
21 // Simulates key and main status by listening for -makeKeyWindow and 21 // Simulates key and main status by listening for -makeKeyWindow,
22 // -makeMainWindow. This allows test coverage of code relying on window focus 22 // -makeMainWindow and -orderOut:. This allows test coverage of code relying on
23 // changes without resorting to an interactive_ui_test. 23 // window focus changes without resorting to an interactive_ui_test.
24 class ScopedFakeNSWindowFocus { 24 class ScopedFakeNSWindowFocus {
25 public: 25 public:
26 ScopedFakeNSWindowFocus(); 26 ScopedFakeNSWindowFocus();
27 ~ScopedFakeNSWindowFocus(); 27 ~ScopedFakeNSWindowFocus();
28 28
29 private: 29 private:
30 std::unique_ptr<base::mac::ScopedObjCClassSwizzler> is_main_swizzler_; 30 std::unique_ptr<base::mac::ScopedObjCClassSwizzler> is_main_swizzler_;
31 std::unique_ptr<base::mac::ScopedObjCClassSwizzler> make_main_swizzler_; 31 std::unique_ptr<base::mac::ScopedObjCClassSwizzler> make_main_swizzler_;
32 std::unique_ptr<base::mac::ScopedObjCClassSwizzler> is_key_swizzler_; 32 std::unique_ptr<base::mac::ScopedObjCClassSwizzler> is_key_swizzler_;
33 std::unique_ptr<base::mac::ScopedObjCClassSwizzler> make_key_swizzler_; 33 std::unique_ptr<base::mac::ScopedObjCClassSwizzler> make_key_swizzler_;
34 std::unique_ptr<base::mac::ScopedObjCClassSwizzler> order_out_swizzler_;
34 35
35 DISALLOW_COPY_AND_ASSIGN(ScopedFakeNSWindowFocus); 36 DISALLOW_COPY_AND_ASSIGN(ScopedFakeNSWindowFocus);
36 }; 37 };
37 38
38 } // namespace test 39 } // namespace test
39 } // namespace ui 40 } // namespace ui
40 41
41 #endif // UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_ 42 #endif // UI_BASE_TEST_SCOPED_FAKE_NSWINDOW_FOCUS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698