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_VIEW_H_ | 5 #ifndef UI_VIEWS_VIEW_H_ |
6 #define UI_VIEWS_VIEW_H_ | 6 #define UI_VIEWS_VIEW_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 // Returns the view that should be selected next when pressing Shift-Tab. | 800 // Returns the view that should be selected next when pressing Shift-Tab. |
801 View* GetPreviousFocusableView(); | 801 View* GetPreviousFocusableView(); |
802 | 802 |
803 // Sets the component that should be selected next when pressing Tab, and | 803 // Sets the component that should be selected next when pressing Tab, and |
804 // makes the current view the precedent view of the specified one. | 804 // makes the current view the precedent view of the specified one. |
805 // Note that by default views are linked in the order they have been added to | 805 // Note that by default views are linked in the order they have been added to |
806 // their container. Use this method if you want to modify the order. | 806 // their container. Use this method if you want to modify the order. |
807 // IMPORTANT NOTE: loops in the focus hierarchy are not supported. | 807 // IMPORTANT NOTE: loops in the focus hierarchy are not supported. |
808 void SetNextFocusableView(View* view); | 808 void SetNextFocusableView(View* view); |
809 | 809 |
810 // Sets |focus_behavior| and advances focus if necessary. | 810 // Gets/sets |focus_behavior|. SetFocusBehavior() advances focus if necessary. |
| 811 FocusBehavior focus_behavior() const { return focus_behavior_; } |
811 void SetFocusBehavior(FocusBehavior focus_behavior); | 812 void SetFocusBehavior(FocusBehavior focus_behavior); |
812 | 813 |
813 // Returns true if this view is focusable, |enabled_| and drawn. | 814 // Returns true if this view is focusable, |enabled_| and drawn. |
814 bool IsFocusable() const; | 815 bool IsFocusable() const; |
815 | 816 |
816 // Return whether this view is focusable when the user requires full keyboard | 817 // Return whether this view is focusable when the user requires full keyboard |
817 // access, even though it may not be normally focusable. | 818 // access, even though it may not be normally focusable. |
818 bool IsAccessibilityFocusable() const; | 819 bool IsAccessibilityFocusable() const; |
819 | 820 |
820 // Convenience method to retrieve the FocusManager associated with the | 821 // Convenience method to retrieve the FocusManager associated with the |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 // example where a subclass may override this method is when it wants to clip | 1193 // example where a subclass may override this method is when it wants to clip |
1193 // the child by adding its own layer. | 1194 // the child by adding its own layer. |
1194 virtual void OnChildLayerChanged(View* child); | 1195 virtual void OnChildLayerChanged(View* child); |
1195 | 1196 |
1196 // Input --------------------------------------------------------------------- | 1197 // Input --------------------------------------------------------------------- |
1197 | 1198 |
1198 virtual DragInfo* GetDragInfo(); | 1199 virtual DragInfo* GetDragInfo(); |
1199 | 1200 |
1200 // Focus --------------------------------------------------------------------- | 1201 // Focus --------------------------------------------------------------------- |
1201 | 1202 |
1202 // Returns last set focus behavior. | |
1203 FocusBehavior focus_behavior() const { return focus_behavior_; } | |
1204 | |
1205 // Override to be notified when focus has changed either to or from this View. | 1203 // Override to be notified when focus has changed either to or from this View. |
1206 virtual void OnFocus(); | 1204 virtual void OnFocus(); |
1207 virtual void OnBlur(); | 1205 virtual void OnBlur(); |
1208 | 1206 |
1209 // Handle view focus/blur events for this view. | 1207 // Handle view focus/blur events for this view. |
1210 void Focus(); | 1208 void Focus(); |
1211 void Blur(); | 1209 void Blur(); |
1212 | 1210 |
1213 // System events ------------------------------------------------------------- | 1211 // System events ------------------------------------------------------------- |
1214 | 1212 |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 // Observers ------------------------------------------------------------- | 1691 // Observers ------------------------------------------------------------- |
1694 | 1692 |
1695 base::ObserverList<ViewObserver> observers_; | 1693 base::ObserverList<ViewObserver> observers_; |
1696 | 1694 |
1697 DISALLOW_COPY_AND_ASSIGN(View); | 1695 DISALLOW_COPY_AND_ASSIGN(View); |
1698 }; | 1696 }; |
1699 | 1697 |
1700 } // namespace views | 1698 } // namespace views |
1701 | 1699 |
1702 #endif // UI_VIEWS_VIEW_H_ | 1700 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |