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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
772 // Returns the view that should be selected next when pressing Shift-Tab. | 772 // Returns the view that should be selected next when pressing Shift-Tab. |
773 View* GetPreviousFocusableView(); | 773 View* GetPreviousFocusableView(); |
774 | 774 |
775 // Sets the component that should be selected next when pressing Tab, and | 775 // Sets the component that should be selected next when pressing Tab, and |
776 // makes the current view the precedent view of the specified one. | 776 // makes the current view the precedent view of the specified one. |
777 // Note that by default views are linked in the order they have been added to | 777 // Note that by default views are linked in the order they have been added to |
778 // their container. Use this method if you want to modify the order. | 778 // their container. Use this method if you want to modify the order. |
779 // IMPORTANT NOTE: loops in the focus hierarchy are not supported. | 779 // IMPORTANT NOTE: loops in the focus hierarchy are not supported. |
780 void SetNextFocusableView(View* view); | 780 void SetNextFocusableView(View* view); |
781 | 781 |
782 // Sets |focus_behavior| and advances focus if necessary. | 782 // Gets/sets |focus_behavior|. SetFocusBehavior() advances focus if necessary. |
783 FocusBehavior focus_behavior() const { return focus_behavior_; } | |
tapted
2016/11/29 03:12:49
I think this is OK. (although it raises the questi
Patti Lor
2016/11/29 23:26:18
Acknowledged.
| |
783 void SetFocusBehavior(FocusBehavior focus_behavior); | 784 void SetFocusBehavior(FocusBehavior focus_behavior); |
784 | 785 |
785 // Returns true if this view is focusable, |enabled_| and drawn. | 786 // Returns true if this view is focusable, |enabled_| and drawn. |
786 bool IsFocusable() const; | 787 bool IsFocusable() const; |
787 | 788 |
788 // Return whether this view is focusable when the user requires full keyboard | 789 // Return whether this view is focusable when the user requires full keyboard |
789 // access, even though it may not be normally focusable. | 790 // access, even though it may not be normally focusable. |
790 bool IsAccessibilityFocusable() const; | 791 bool IsAccessibilityFocusable() const; |
791 | 792 |
792 // Convenience method to retrieve the FocusManager associated with the | 793 // Convenience method to retrieve the FocusManager associated with the |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1147 // with an associated view. Widget::ReorderNativeViews() may reorder layers | 1148 // with an associated view. Widget::ReorderNativeViews() may reorder layers |
1148 // below layers owned by a view. | 1149 // below layers owned by a view. |
1149 virtual void ReorderChildLayers(ui::Layer* parent_layer); | 1150 virtual void ReorderChildLayers(ui::Layer* parent_layer); |
1150 | 1151 |
1151 // Input --------------------------------------------------------------------- | 1152 // Input --------------------------------------------------------------------- |
1152 | 1153 |
1153 virtual DragInfo* GetDragInfo(); | 1154 virtual DragInfo* GetDragInfo(); |
1154 | 1155 |
1155 // Focus --------------------------------------------------------------------- | 1156 // Focus --------------------------------------------------------------------- |
1156 | 1157 |
1157 // Returns last set focus behavior. | |
1158 FocusBehavior focus_behavior() const { return focus_behavior_; } | |
1159 | |
1160 // Override to be notified when focus has changed either to or from this View. | 1158 // Override to be notified when focus has changed either to or from this View. |
1161 virtual void OnFocus(); | 1159 virtual void OnFocus(); |
1162 virtual void OnBlur(); | 1160 virtual void OnBlur(); |
1163 | 1161 |
1164 // Handle view focus/blur events for this view. | 1162 // Handle view focus/blur events for this view. |
1165 void Focus(); | 1163 void Focus(); |
1166 void Blur(); | 1164 void Blur(); |
1167 | 1165 |
1168 // System events ------------------------------------------------------------- | 1166 // System events ------------------------------------------------------------- |
1169 | 1167 |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1583 // Observers ------------------------------------------------------------- | 1581 // Observers ------------------------------------------------------------- |
1584 | 1582 |
1585 base::ObserverList<ViewObserver> observers_; | 1583 base::ObserverList<ViewObserver> observers_; |
1586 | 1584 |
1587 DISALLOW_COPY_AND_ASSIGN(View); | 1585 DISALLOW_COPY_AND_ASSIGN(View); |
1588 }; | 1586 }; |
1589 | 1587 |
1590 } // namespace views | 1588 } // namespace views |
1591 | 1589 |
1592 #endif // UI_VIEWS_VIEW_H_ | 1590 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |