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 <memory> |
| 9 |
8 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
12 #include "ui/base/accelerators/accelerator.h" | 13 #include "ui/base/accelerators/accelerator.h" |
13 #include "ui/views/focus/focus_manager.h" | 14 #include "ui/views/focus/focus_manager.h" |
14 #include "ui/views/view.h" | 15 #include "ui/views/view.h" |
15 | 16 |
16 namespace views { | 17 namespace views { |
17 class FocusSearch; | 18 class FocusSearch; |
18 | 19 |
19 // This class provides keyboard access to any view that extends it, typically | 20 // This class provides keyboard access to any view that extends it, typically |
20 // a toolbar. The user sets focus to a control in this view by pressing | 21 // a toolbar. The user sets focus to a control in this view by pressing |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // is known where to return to. | 100 // is known where to return to. |
100 bool allow_deactivate_on_esc_; | 101 bool allow_deactivate_on_esc_; |
101 | 102 |
102 // Save the focus manager rather than calling GetFocusManager(), | 103 // Save the focus manager rather than calling GetFocusManager(), |
103 // so that we can remove focus listeners in the destructor. | 104 // so that we can remove focus listeners in the destructor. |
104 FocusManager* focus_manager_; | 105 FocusManager* focus_manager_; |
105 | 106 |
106 // Our custom focus search implementation that traps focus in this | 107 // Our custom focus search implementation that traps focus in this |
107 // pane and traverses all views that are focusable for accessibility, | 108 // pane and traverses all views that are focusable for accessibility, |
108 // not just those that are normally focusable. | 109 // not just those that are normally focusable. |
109 scoped_ptr<FocusSearch> focus_search_; | 110 std::unique_ptr<FocusSearch> focus_search_; |
110 | 111 |
111 // Registered accelerators | 112 // Registered accelerators |
112 ui::Accelerator home_key_; | 113 ui::Accelerator home_key_; |
113 ui::Accelerator end_key_; | 114 ui::Accelerator end_key_; |
114 ui::Accelerator escape_key_; | 115 ui::Accelerator escape_key_; |
115 ui::Accelerator left_key_; | 116 ui::Accelerator left_key_; |
116 ui::Accelerator right_key_; | 117 ui::Accelerator right_key_; |
117 | 118 |
118 // View storage id for the last focused view that's not within this pane. | 119 // View storage id for the last focused view that's not within this pane. |
119 int last_focused_view_storage_id_; | 120 int last_focused_view_storage_id_; |
120 | 121 |
121 friend class AccessiblePaneViewFocusSearch; | 122 friend class AccessiblePaneViewFocusSearch; |
122 | 123 |
123 base::WeakPtrFactory<AccessiblePaneView> method_factory_; | 124 base::WeakPtrFactory<AccessiblePaneView> method_factory_; |
124 | 125 |
125 DISALLOW_COPY_AND_ASSIGN(AccessiblePaneView); | 126 DISALLOW_COPY_AND_ASSIGN(AccessiblePaneView); |
126 }; | 127 }; |
127 | 128 |
128 } // namespace views | 129 } // namespace views |
129 | 130 |
130 #endif // UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ | 131 #endif // UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ |
OLD | NEW |