| 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 traversal starts at |starting_widget|. If both |
| 313 // |starting_view| and |starting_widget| are NULL, traversal starts at |
| 314 // |widget_|. |
| 315 View* GetNextFocusableView(View* starting_view, |
| 316 Widget* starting_widget, |
| 317 bool reverse, |
| 318 bool dont_loop); |
| 313 | 319 |
| 314 // Returns the focusable view found in the FocusTraversable specified starting | 320 // Returns the focusable view found in the FocusTraversable specified starting |
| 315 // at the specified view. This traverses down along the FocusTraversable | 321 // at the specified view. This traverses down along the FocusTraversable |
| 316 // hierarchy. | 322 // hierarchy. |
| 317 // Returns NULL if no focusable view were found. | 323 // Returns NULL if no focusable view were found. |
| 318 View* FindFocusableView(FocusTraversable* focus_traversable, | 324 View* FindFocusableView(FocusTraversable* focus_traversable, |
| 319 View* starting_view, | 325 View* starting_view, |
| 320 bool reverse); | 326 bool reverse); |
| 321 | 327 |
| 322 // Process arrow key traversal. Returns true if the event has been consumed | 328 // 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 | 360 |
| 355 // See description above getter. | 361 // See description above getter. |
| 356 bool is_changing_focus_; | 362 bool is_changing_focus_; |
| 357 | 363 |
| 358 DISALLOW_COPY_AND_ASSIGN(FocusManager); | 364 DISALLOW_COPY_AND_ASSIGN(FocusManager); |
| 359 }; | 365 }; |
| 360 | 366 |
| 361 } // namespace views | 367 } // namespace views |
| 362 | 368 |
| 363 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ | 369 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ |
| OLD | NEW |