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 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 // Returns the view that should be selected next when pressing Shift-Tab. | 801 // Returns the view that should be selected next when pressing Shift-Tab. |
802 View* GetPreviousFocusableView(); | 802 View* GetPreviousFocusableView(); |
803 | 803 |
804 // Sets the component that should be selected next when pressing Tab, and | 804 // Sets the component that should be selected next when pressing Tab, and |
805 // makes the current view the precedent view of the specified one. | 805 // makes the current view the precedent view of the specified one. |
806 // Note that by default views are linked in the order they have been added to | 806 // Note that by default views are linked in the order they have been added to |
807 // their container. Use this method if you want to modify the order. | 807 // their container. Use this method if you want to modify the order. |
808 // IMPORTANT NOTE: loops in the focus hierarchy are not supported. | 808 // IMPORTANT NOTE: loops in the focus hierarchy are not supported. |
809 void SetNextFocusableView(View* view); | 809 void SetNextFocusableView(View* view); |
810 | 810 |
811 // Sets |focus_behavior| and advances focus if necessary. | 811 // Gets/sets |focus_behavior|. SetFocusBehavior() advances focus if necessary. |
| 812 FocusBehavior focus_behavior() const { return focus_behavior_; } |
812 void SetFocusBehavior(FocusBehavior focus_behavior); | 813 void SetFocusBehavior(FocusBehavior focus_behavior); |
813 | 814 |
814 // Returns true if this view is focusable, |enabled_| and drawn. | 815 // Returns true if this view is focusable, |enabled_| and drawn. |
815 bool IsFocusable() const; | 816 bool IsFocusable() const; |
816 | 817 |
817 // Return whether this view is focusable when the user requires full keyboard | 818 // Return whether this view is focusable when the user requires full keyboard |
818 // access, even though it may not be normally focusable. | 819 // access, even though it may not be normally focusable. |
819 bool IsAccessibilityFocusable() const; | 820 bool IsAccessibilityFocusable() const; |
820 | 821 |
821 // Convenience method to retrieve the FocusManager associated with the | 822 // Convenience method to retrieve the FocusManager associated with the |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 // with an associated view. Widget::ReorderNativeViews() may reorder layers | 1189 // with an associated view. Widget::ReorderNativeViews() may reorder layers |
1189 // below layers owned by a view. | 1190 // below layers owned by a view. |
1190 virtual void ReorderChildLayers(ui::Layer* parent_layer); | 1191 virtual void ReorderChildLayers(ui::Layer* parent_layer); |
1191 | 1192 |
1192 // Input --------------------------------------------------------------------- | 1193 // Input --------------------------------------------------------------------- |
1193 | 1194 |
1194 virtual DragInfo* GetDragInfo(); | 1195 virtual DragInfo* GetDragInfo(); |
1195 | 1196 |
1196 // Focus --------------------------------------------------------------------- | 1197 // Focus --------------------------------------------------------------------- |
1197 | 1198 |
1198 // Returns last set focus behavior. | |
1199 FocusBehavior focus_behavior() const { return focus_behavior_; } | |
1200 | |
1201 // Override to be notified when focus has changed either to or from this View. | 1199 // Override to be notified when focus has changed either to or from this View. |
1202 virtual void OnFocus(); | 1200 virtual void OnFocus(); |
1203 virtual void OnBlur(); | 1201 virtual void OnBlur(); |
1204 | 1202 |
1205 // Handle view focus/blur events for this view. | 1203 // Handle view focus/blur events for this view. |
1206 void Focus(); | 1204 void Focus(); |
1207 void Blur(); | 1205 void Blur(); |
1208 | 1206 |
1209 // System events ------------------------------------------------------------- | 1207 // System events ------------------------------------------------------------- |
1210 | 1208 |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1670 // Observers ------------------------------------------------------------- | 1668 // Observers ------------------------------------------------------------- |
1671 | 1669 |
1672 base::ObserverList<ViewObserver> observers_; | 1670 base::ObserverList<ViewObserver> observers_; |
1673 | 1671 |
1674 DISALLOW_COPY_AND_ASSIGN(View); | 1672 DISALLOW_COPY_AND_ASSIGN(View); |
1675 }; | 1673 }; |
1676 | 1674 |
1677 } // namespace views | 1675 } // namespace views |
1678 | 1676 |
1679 #endif // UI_VIEWS_VIEW_H_ | 1677 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |