OLD | NEW |
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_VIEWS_ACCESSIBLE_PANE_VIEW_H_ | 5 #ifndef UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ |
6 #define UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ | 6 #define UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ |
7 | 7 |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 allow_deactivate_on_esc_ = allow; | 94 allow_deactivate_on_esc_ = allow; |
95 } | 95 } |
96 | 96 |
97 private: | 97 private: |
98 bool pane_has_focus_; | 98 bool pane_has_focus_; |
99 | 99 |
100 // If true, the panel should be de-activated upon escape when no active view | 100 // If true, the panel should be de-activated upon escape when no active view |
101 // is known where to return to. | 101 // is known where to return to. |
102 bool allow_deactivate_on_esc_; | 102 bool allow_deactivate_on_esc_; |
103 | 103 |
104 base::WeakPtrFactory<AccessiblePaneView> method_factory_; | |
105 | |
106 // Save the focus manager rather than calling GetFocusManager(), | 104 // Save the focus manager rather than calling GetFocusManager(), |
107 // so that we can remove focus listeners in the destructor. | 105 // so that we can remove focus listeners in the destructor. |
108 FocusManager* focus_manager_; | 106 FocusManager* focus_manager_; |
109 | 107 |
110 // Our custom focus search implementation that traps focus in this | 108 // Our custom focus search implementation that traps focus in this |
111 // pane and traverses all views that are focusable for accessibility, | 109 // pane and traverses all views that are focusable for accessibility, |
112 // not just those that are normally focusable. | 110 // not just those that are normally focusable. |
113 scoped_ptr<FocusSearch> focus_search_; | 111 scoped_ptr<FocusSearch> focus_search_; |
114 | 112 |
115 // Registered accelerators | 113 // Registered accelerators |
116 ui::Accelerator home_key_; | 114 ui::Accelerator home_key_; |
117 ui::Accelerator end_key_; | 115 ui::Accelerator end_key_; |
118 ui::Accelerator escape_key_; | 116 ui::Accelerator escape_key_; |
119 ui::Accelerator left_key_; | 117 ui::Accelerator left_key_; |
120 ui::Accelerator right_key_; | 118 ui::Accelerator right_key_; |
121 | 119 |
122 // View storage id for the last focused view that's not within this pane. | 120 // View storage id for the last focused view that's not within this pane. |
123 int last_focused_view_storage_id_; | 121 int last_focused_view_storage_id_; |
124 | 122 |
125 friend class AccessiblePaneViewFocusSearch; | 123 friend class AccessiblePaneViewFocusSearch; |
126 | 124 |
| 125 base::WeakPtrFactory<AccessiblePaneView> method_factory_; |
| 126 |
127 DISALLOW_COPY_AND_ASSIGN(AccessiblePaneView); | 127 DISALLOW_COPY_AND_ASSIGN(AccessiblePaneView); |
128 }; | 128 }; |
129 | 129 |
130 } // namespace views | 130 } // namespace views |
131 | 131 |
132 #endif // UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ | 132 #endif // UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ |
OLD | NEW |