| 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_FOCUS_FOCUS_SEARCH_H_ | 5 #ifndef UI_VIEWS_FOCUS_FOCUS_SEARCH_H_ |
| 6 #define UI_VIEWS_FOCUS_FOCUS_SEARCH_H_ | 6 #define UI_VIEWS_FOCUS_FOCUS_SEARCH_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/views/view.h" | 9 #include "ui/views/view.h" |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // Constructor. | 29 // Constructor. |
| 30 // - |root| is the root of the view hierarchy to traverse. Focus will be | 30 // - |root| is the root of the view hierarchy to traverse. Focus will be |
| 31 // trapped inside. | 31 // trapped inside. |
| 32 // - |cycle| should be true if you want FindNextFocusableView to cycle back | 32 // - |cycle| should be true if you want FindNextFocusableView to cycle back |
| 33 // to the first view within this root when the traversal reaches | 33 // to the first view within this root when the traversal reaches |
| 34 // the end. If this is true, then if you pass a valid starting | 34 // the end. If this is true, then if you pass a valid starting |
| 35 // view to FindNextFocusableView you will always get a valid view | 35 // view to FindNextFocusableView you will always get a valid view |
| 36 // out, even if it's the same view. | 36 // out, even if it's the same view. |
| 37 // - |accessibility_mode| should be true if full keyboard accessibility is | 37 // - |accessibility_mode| should be true if full keyboard accessibility is |
| 38 // needed and you want to check IsAccessibilityFocusableInRootView(), | 38 // needed and you want to check IsAccessibilityFocusableInRootView(), |
| 39 // rather than IsFocusableInRootView(). | 39 // rather than IsFocusable(). |
| 40 FocusSearch(View* root, bool cycle, bool accessibility_mode); | 40 FocusSearch(View* root, bool cycle, bool accessibility_mode); |
| 41 virtual ~FocusSearch() {} | 41 virtual ~FocusSearch() {} |
| 42 | 42 |
| 43 // Finds the next view that should be focused and returns it. If a | 43 // Finds the next view that should be focused and returns it. If a |
| 44 // FocusTraversable is found while searching for the focusable view, | 44 // FocusTraversable is found while searching for the focusable view, |
| 45 // returns NULL and sets |focus_traversable| to the FocusTraversable | 45 // returns NULL and sets |focus_traversable| to the FocusTraversable |
| 46 // and |focus_traversable_view| to the view associated with the | 46 // and |focus_traversable_view| to the view associated with the |
| 47 // FocusTraversable. | 47 // FocusTraversable. |
| 48 // | 48 // |
| 49 // Return NULL if the end of the focus loop is reached, unless this object | 49 // Return NULL if the end of the focus loop is reached, unless this object |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 View* root_; | 113 View* root_; |
| 114 bool cycle_; | 114 bool cycle_; |
| 115 bool accessibility_mode_; | 115 bool accessibility_mode_; |
| 116 | 116 |
| 117 DISALLOW_COPY_AND_ASSIGN(FocusSearch); | 117 DISALLOW_COPY_AND_ASSIGN(FocusSearch); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace views | 120 } // namespace views |
| 121 | 121 |
| 122 #endif // UI_VIEWS_FOCUS_FOCUS_SEARCH_H_ | 122 #endif // UI_VIEWS_FOCUS_FOCUS_SEARCH_H_ |
| OLD | NEW |