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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 // is enabled, the arrow key movement within grouped views are disabled. | 301 // is enabled, the arrow key movement within grouped views are disabled. |
302 static void set_arrow_key_traversal_enabled(bool enabled) { | 302 static void set_arrow_key_traversal_enabled(bool enabled) { |
303 arrow_key_traversal_enabled_ = enabled; | 303 arrow_key_traversal_enabled_ = enabled; |
304 } | 304 } |
305 // Returns whether arrow key traversal is enabled. | 305 // Returns whether arrow key traversal is enabled. |
306 static bool arrow_key_traversal_enabled() { | 306 static bool arrow_key_traversal_enabled() { |
307 return arrow_key_traversal_enabled_; | 307 return arrow_key_traversal_enabled_; |
308 } | 308 } |
309 | 309 |
310 private: | 310 private: |
311 // Returns the next focusable view. | 311 // Returns the next focusable view. Traversal starts at |starting_view|. If |
312 View* GetNextFocusableView(View* starting_view, bool reverse, bool dont_loop); | 312 // |starting_view| is NULL |starting_widget| is consuled to determine which |
| 313 // Widget to start from. See |
| 314 // WidgetDelegate::ShouldAdvanceFocusToTopLevelWidget() for details. If both |
| 315 // |starting_view| and |starting_widget| are NULL, traversal starts at |
| 316 // |widget_|. |
| 317 View* GetNextFocusableView(View* starting_view, |
| 318 Widget* starting_widget, |
| 319 bool reverse, |
| 320 bool dont_loop); |
313 | 321 |
314 // Returns the focusable view found in the FocusTraversable specified starting | 322 // Returns the focusable view found in the FocusTraversable specified starting |
315 // at the specified view. This traverses down along the FocusTraversable | 323 // at the specified view. This traverses down along the FocusTraversable |
316 // hierarchy. | 324 // hierarchy. |
317 // Returns NULL if no focusable view were found. | 325 // Returns NULL if no focusable view were found. |
318 View* FindFocusableView(FocusTraversable* focus_traversable, | 326 View* FindFocusableView(FocusTraversable* focus_traversable, |
319 View* starting_view, | 327 View* starting_view, |
320 bool reverse); | 328 bool reverse); |
321 | 329 |
322 // Process arrow key traversal. Returns true if the event has been consumed | 330 // Process arrow key traversal. Returns true if the event has been consumed |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 | 362 |
355 // See description above getter. | 363 // See description above getter. |
356 bool is_changing_focus_; | 364 bool is_changing_focus_; |
357 | 365 |
358 DISALLOW_COPY_AND_ASSIGN(FocusManager); | 366 DISALLOW_COPY_AND_ASSIGN(FocusManager); |
359 }; | 367 }; |
360 | 368 |
361 } // namespace views | 369 } // namespace views |
362 | 370 |
363 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ | 371 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ |
OLD | NEW |