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_H_ | 5 #ifndef UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ |
6 #define UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ | 6 #define UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 // Get the reason why the focus most recently changed. | 178 // Get the reason why the focus most recently changed. |
179 FocusChangeReason focus_change_reason() const { | 179 FocusChangeReason focus_change_reason() const { |
180 return focus_change_reason_; | 180 return focus_change_reason_; |
181 } | 181 } |
182 | 182 |
183 // Clears the focused view. The window associated with the top root view gets | 183 // Clears the focused view. The window associated with the top root view gets |
184 // the native focus (so we still get keyboard events). | 184 // the native focus (so we still get keyboard events). |
185 void ClearFocus(); | 185 void ClearFocus(); |
186 | 186 |
| 187 // Tries to advance focus if the focused view has become unfocusable. If there |
| 188 // is no view available to advance focus to, focus will be cleared. |
| 189 void AdvanceFocusIfNecessary(); |
| 190 |
187 // Validates the focused view, clearing it if the window it belongs too is not | 191 // Validates the focused view, clearing it if the window it belongs too is not |
188 // attached to the window hierarchy anymore. | 192 // attached to the window hierarchy anymore. |
189 void ValidateFocusedView(); | 193 void ValidateFocusedView(); |
190 | 194 |
191 // Stores the focused view. Used when the widget loses activation. | 195 // Stores the focused view. Used when the widget loses activation. |
192 // |clear_native_focus| indicates whether this should invoke ClearFocus(). | 196 // |clear_native_focus| indicates whether this should invoke ClearFocus(). |
193 // Typically |true| should be passed in. | 197 // Typically |true| should be passed in. |
194 void StoreFocusedView(bool clear_native_focus); | 198 void StoreFocusedView(bool clear_native_focus); |
195 | 199 |
196 // Restore the view saved with a previous call to StoreFocusedView(). Used | 200 // Restore the view saved with a previous call to StoreFocusedView(). Used |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 376 |
373 // See description above getter. | 377 // See description above getter. |
374 bool is_changing_focus_; | 378 bool is_changing_focus_; |
375 | 379 |
376 DISALLOW_COPY_AND_ASSIGN(FocusManager); | 380 DISALLOW_COPY_AND_ASSIGN(FocusManager); |
377 }; | 381 }; |
378 | 382 |
379 } // namespace views | 383 } // namespace views |
380 | 384 |
381 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ | 385 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ |
OLD | NEW |