OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EVENTS_TEST_COCOA_TEST_EVENT_UTILS_H_ | 5 #ifndef UI_EVENTS_TEST_COCOA_TEST_EVENT_UTILS_H_ |
6 #define UI_EVENTS_TEST_COCOA_TEST_EVENT_UTILS_H_ | 6 #define UI_EVENTS_TEST_COCOA_TEST_EVENT_UTILS_H_ |
7 | 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 #import <objc/objc-class.h> |
8 #include <utility> | 10 #include <utility> |
9 | 11 |
10 #import <objc/objc-class.h> | 12 #include "base/basictypes.h" |
11 | 13 |
12 #include "base/basictypes.h" | 14 @class NSEvent; |
| 15 @class NSWindow; |
| 16 typedef NSUInteger NSEventType; |
13 | 17 |
14 // Within a given scope, replace the selector |selector| on |target| with that | 18 // Within a given scope, replace the selector |selector| on |target| with that |
15 // from |source|. | 19 // from |source|. |
16 class ScopedClassSwizzler { | 20 class ScopedClassSwizzler { |
17 public: | 21 public: |
18 ScopedClassSwizzler(Class target, Class source, SEL selector); | 22 ScopedClassSwizzler(Class target, Class source, SEL selector); |
19 ~ScopedClassSwizzler(); | 23 ~ScopedClassSwizzler(); |
20 | 24 |
21 private: | 25 private: |
22 Method old_selector_impl_; | 26 Method old_selector_impl_; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 60 |
57 // Returns a mouse enter/exit event with the given type. | 61 // Returns a mouse enter/exit event with the given type. |
58 NSEvent* EnterExitEventWithType(NSEventType event_type); | 62 NSEvent* EnterExitEventWithType(NSEventType event_type); |
59 | 63 |
60 // Return an "other" event with the given type. | 64 // Return an "other" event with the given type. |
61 NSEvent* OtherEventWithType(NSEventType event_type); | 65 NSEvent* OtherEventWithType(NSEventType event_type); |
62 | 66 |
63 } // namespace cocoa_test_event_utils | 67 } // namespace cocoa_test_event_utils |
64 | 68 |
65 #endif // UI_EVENTS_TEST_COCOA_TEST_EVENT_UTILS_H_ | 69 #endif // UI_EVENTS_TEST_COCOA_TEST_EVENT_UTILS_H_ |
OLD | NEW |