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

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

Issue 8953037: Aura needs event translation for Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Nico's comment #5. Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_COCOA_TEST_EVENT_UTILS_H_ 5 #ifndef UI_BASE_TEST_COCOA_TEST_EVENT_UTILS_H_
6 #define UI_BASE_TEST_COCOA_TEST_EVENT_UTILS_H_ 6 #define UI_BASE_TEST_COCOA_TEST_EVENT_UTILS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 14 matching lines...) Expand all
25 25
26 DISALLOW_COPY_AND_ASSIGN(ScopedClassSwizzler); 26 DISALLOW_COPY_AND_ASSIGN(ScopedClassSwizzler);
27 }; 27 };
28 28
29 namespace cocoa_test_event_utils { 29 namespace cocoa_test_event_utils {
30 30
31 // Create synthetic mouse events for testing. Currently these are very 31 // Create synthetic mouse events for testing. Currently these are very
32 // basic, flesh out as needed. Points are all in window coordinates; 32 // basic, flesh out as needed. Points are all in window coordinates;
33 // where the window is not specified, coordinate system is undefined 33 // where the window is not specified, coordinate system is undefined
34 // (but will be repeated when the event is queried). 34 // (but will be repeated when the event is queried).
35 NSEvent* MakeMouseEvent(NSEventType type, NSUInteger modifiers); 35 NSEvent* MouseEventWithType(NSEventType type, NSUInteger modifiers);
36 NSEvent* MouseEventAtPoint(NSPoint point, NSEventType type, 36 NSEvent* MouseEventAtPoint(NSPoint point, NSEventType type,
37 NSUInteger modifiers); 37 NSUInteger modifiers);
38 NSEvent* LeftMouseDownAtPoint(NSPoint point); 38 NSEvent* LeftMouseDownAtPoint(NSPoint point);
39 NSEvent* LeftMouseDownAtPointInWindow(NSPoint point, NSWindow* window); 39 NSEvent* LeftMouseDownAtPointInWindow(NSPoint point, NSWindow* window);
40 40
41 // Return a mouse down and an up event with the given |clickCount| at 41 // Return a mouse down and an up event with the given |clickCount| at
42 // |view|'s midpoint. 42 // |view|'s midpoint.
43 std::pair<NSEvent*, NSEvent*> MouseClickInView(NSView* view, 43 std::pair<NSEvent*, NSEvent*> MouseClickInView(NSView* view,
44 NSUInteger clickCount); 44 NSUInteger clickCount);
45 45
46 // Returns a key event with the given character. 46 // Returns a key event with the given character.
47 NSEvent* KeyEventWithCharacter(unichar c); 47 NSEvent* KeyEventWithCharacter(unichar c);
48 48
49 // Returns a key event with the given type and modifier flags.
50 NSEvent* KeyEventWithType(NSEventType event_type, NSUInteger modifiers);
51
52 // Returns a mouse enter/exit event with the given type.
53 NSEvent* EnterExitEventWithType(NSEventType event_type);
54
55 // Return an "other" event with the given type.
56 NSEvent* OtherEventWithType(NSEventType event_type);
57
49 } // namespace cocoa_test_event_utils 58 } // namespace cocoa_test_event_utils
50 59
51 #endif // UI_BASE_TEST_COCOA_TEST_EVENT_UTILS_H_ 60 #endif // UI_BASE_TEST_COCOA_TEST_EVENT_UTILS_H_
OLDNEW
« no previous file with comments | « ui/base/keycodes/keyboard_code_conversion_mac.mm ('k') | ui/base/test/cocoa_test_event_utils.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698