Chromium Code Reviews| 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 "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 // Overridden from FocusTraversable: | 55 // Overridden from FocusTraversable: |
| 56 virtual FocusSearch* GetFocusSearch() OVERRIDE; | 56 virtual FocusSearch* GetFocusSearch() OVERRIDE; |
| 57 virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE; | 57 virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE; |
| 58 virtual View* GetFocusTraversableParentView() OVERRIDE; | 58 virtual View* GetFocusTraversableParentView() OVERRIDE; |
| 59 | 59 |
| 60 protected: | 60 protected: |
| 61 // A subclass can override this to provide a default focusable child | 61 // A subclass can override this to provide a default focusable child |
| 62 // other than the first focusable child. | 62 // other than the first focusable child. |
| 63 virtual View* GetDefaultFocusableChild(); | 63 virtual View* GetDefaultFocusableChild(); |
| 64 | 64 |
| 65 // Returns the parent of |v|. Subclasses can override this if | |
| 66 // they need custom focus search behavior. | |
| 67 virtual View* GetParentForFocusSearch(View* v); | |
| 68 | |
| 69 // Returns true if |v| is contained within the hierarchy rooted at |root| | |
| 70 // for the purpose of focus searching. Subclasses can override this if | |
| 71 // they need custom focus search behavior. | |
| 72 virtual bool ContainsForFocusSearch(View* root, const View* v); | |
| 73 | |
| 65 // Remove pane focus. | 74 // Remove pane focus. |
| 66 virtual void RemovePaneFocus(); | 75 virtual void RemovePaneFocus(); |
| 67 | 76 |
| 68 void RestoreLastFocusedView(); | 77 void RestoreLastFocusedView(); |
| 69 | 78 |
| 70 View* GetFirstFocusableChild(); | 79 View* GetFirstFocusableChild(); |
| 71 View* GetLastFocusableChild(); | 80 View* GetLastFocusableChild(); |
| 72 | 81 |
| 73 bool pane_has_focus_; | 82 bool pane_has_focus_; |
|
sky
2012/09/18 21:46:06
Does all of this need to be protected? Style guide
dmazzoni
2012/09/19 00:23:40
Fixed. I just needed to add one accessor, everythi
| |
| 74 | 83 |
| 75 base::WeakPtrFactory<AccessiblePaneView> method_factory_; | 84 base::WeakPtrFactory<AccessiblePaneView> method_factory_; |
| 76 | 85 |
| 77 // Save the focus manager rather than calling GetFocusManager(), | 86 // Save the focus manager rather than calling GetFocusManager(), |
| 78 // so that we can remove focus listeners in the destructor. | 87 // so that we can remove focus listeners in the destructor. |
| 79 FocusManager* focus_manager_; | 88 FocusManager* focus_manager_; |
| 80 | 89 |
| 81 // Our custom focus search implementation that traps focus in this | 90 // Our custom focus search implementation that traps focus in this |
| 82 // pane and traverses all views that are focusable for accessibility, | 91 // pane and traverses all views that are focusable for accessibility, |
| 83 // not just those that are normally focusable. | 92 // not just those that are normally focusable. |
| 84 scoped_ptr<FocusSearch> focus_search_; | 93 scoped_ptr<FocusSearch> focus_search_; |
| 85 | 94 |
| 86 // Registered accelerators | 95 // Registered accelerators |
| 87 ui::Accelerator home_key_; | 96 ui::Accelerator home_key_; |
| 88 ui::Accelerator end_key_; | 97 ui::Accelerator end_key_; |
| 89 ui::Accelerator escape_key_; | 98 ui::Accelerator escape_key_; |
| 90 ui::Accelerator left_key_; | 99 ui::Accelerator left_key_; |
| 91 ui::Accelerator right_key_; | 100 ui::Accelerator right_key_; |
| 92 | 101 |
| 102 friend class AccessiblePaneViewFocusSearch; | |
| 103 | |
| 93 DISALLOW_COPY_AND_ASSIGN(AccessiblePaneView); | 104 DISALLOW_COPY_AND_ASSIGN(AccessiblePaneView); |
| 94 }; | 105 }; |
| 95 | 106 |
| 96 } // namespace views | 107 } // namespace views |
| 97 | 108 |
| 98 #endif // UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ | 109 #endif // UI_VIEWS_ACCESSIBLE_PANE_VIEW_H_ |
| OLD | NEW |