OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIEWS_FOCUS_FOCUS_MANAGER_TEST_H_ | 5 #ifndef UI_VIEWS_FOCUS_FOCUS_MANAGER_TEST_H_ |
6 #define UI_VIEWS_FOCUS_FOCUS_MANAGER_TEST_H_ | 6 #define UI_VIEWS_FOCUS_FOCUS_MANAGER_TEST_H_ |
7 | 7 |
8 #include "ui/views/focus/focus_manager.h" | 8 #include "ui/views/focus/focus_manager.h" |
9 #include "ui/views/focus/widget_focus_manager.h" | 9 #include "ui/views/focus/widget_focus_manager.h" |
10 #include "ui/views/test/views_test_base.h" | 10 #include "ui/views/test/views_test_base.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // Called after the Widget is initialized and the content view is added. | 36 // Called after the Widget is initialized and the content view is added. |
37 // Override to add controls to the layout. | 37 // Override to add controls to the layout. |
38 virtual void InitContentView(); | 38 virtual void InitContentView(); |
39 | 39 |
40 void AddFocusChangeListener(FocusChangeListener* listener); | 40 void AddFocusChangeListener(FocusChangeListener* listener); |
41 void AddWidgetFocusChangeListener(WidgetFocusChangeListener* listener); | 41 void AddWidgetFocusChangeListener(WidgetFocusChangeListener* listener); |
42 | 42 |
43 // For testing FocusManager::RotatePaneFocus(). | 43 // For testing FocusManager::RotatePaneFocus(). |
44 void SetAccessiblePanes(const std::vector<View*>& panes); | 44 void SetAccessiblePanes(const std::vector<View*>& panes); |
45 | 45 |
46 #if defined(OS_WIN) && !defined(USE_AURA) | |
47 // Mocks activating/deactivating the window. | |
48 void SimulateActivateWindow(); | |
49 void SimulateDeactivateWindow(); | |
50 | |
51 void PostKeyDown(ui::KeyboardCode key_code); | |
52 void PostKeyUp(ui::KeyboardCode key_code); | |
53 #endif | |
54 | |
55 private: | 46 private: |
56 View* contents_view_; | 47 View* contents_view_; |
57 FocusChangeListener* focus_change_listener_; | 48 FocusChangeListener* focus_change_listener_; |
58 WidgetFocusChangeListener* widget_focus_change_listener_; | 49 WidgetFocusChangeListener* widget_focus_change_listener_; |
59 std::vector<View*> accessible_panes_; | 50 std::vector<View*> accessible_panes_; |
60 | 51 |
61 DISALLOW_COPY_AND_ASSIGN(FocusManagerTest); | 52 DISALLOW_COPY_AND_ASSIGN(FocusManagerTest); |
62 }; | 53 }; |
63 | 54 |
64 typedef std::pair<View*, View*> ViewPair; | 55 typedef std::pair<View*, View*> ViewPair; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // Pairs of (focused_before, focused_now) parameters we've received via calls | 97 // Pairs of (focused_before, focused_now) parameters we've received via calls |
107 // to OnNativeFocusChange(), in oldest-to-newest-received order. | 98 // to OnNativeFocusChange(), in oldest-to-newest-received order. |
108 std::vector<NativeViewPair> focus_changes_; | 99 std::vector<NativeViewPair> focus_changes_; |
109 | 100 |
110 DISALLOW_COPY_AND_ASSIGN(TestWidgetFocusChangeListener); | 101 DISALLOW_COPY_AND_ASSIGN(TestWidgetFocusChangeListener); |
111 }; | 102 }; |
112 | 103 |
113 } // namespace views | 104 } // namespace views |
114 | 105 |
115 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_TEST_H_ | 106 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_TEST_H_ |
OLD | NEW |