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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 // Returns the view that should be selected next when pressing Shift-Tab. | 788 // Returns the view that should be selected next when pressing Shift-Tab. |
789 View* GetPreviousFocusableView(); | 789 View* GetPreviousFocusableView(); |
790 | 790 |
791 // Sets the component that should be selected next when pressing Tab, and | 791 // Sets the component that should be selected next when pressing Tab, and |
792 // makes the current view the precedent view of the specified one. | 792 // makes the current view the precedent view of the specified one. |
793 // Note that by default views are linked in the order they have been added to | 793 // Note that by default views are linked in the order they have been added to |
794 // their container. Use this method if you want to modify the order. | 794 // their container. Use this method if you want to modify the order. |
795 // IMPORTANT NOTE: loops in the focus hierarchy are not supported. | 795 // IMPORTANT NOTE: loops in the focus hierarchy are not supported. |
796 void SetNextFocusableView(View* view); | 796 void SetNextFocusableView(View* view); |
797 | 797 |
798 // Sets |focus_behavior| and advances focus if necessary. | 798 // Gets/sets |focus_behavior|. SetFocusBehavior() advances focus if necessary. |
| 799 FocusBehavior focus_behavior() const { return focus_behavior_; } |
799 void SetFocusBehavior(FocusBehavior focus_behavior); | 800 void SetFocusBehavior(FocusBehavior focus_behavior); |
800 | 801 |
801 // Returns true if this view is focusable, |enabled_| and drawn. | 802 // Returns true if this view is focusable, |enabled_| and drawn. |
802 bool IsFocusable() const; | 803 bool IsFocusable() const; |
803 | 804 |
804 // Return whether this view is focusable when the user requires full keyboard | 805 // Return whether this view is focusable when the user requires full keyboard |
805 // access, even though it may not be normally focusable. | 806 // access, even though it may not be normally focusable. |
806 bool IsAccessibilityFocusable() const; | 807 bool IsAccessibilityFocusable() const; |
807 | 808 |
808 // Convenience method to retrieve the FocusManager associated with the | 809 // Convenience method to retrieve the FocusManager associated with the |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 // with an associated view. Widget::ReorderNativeViews() may reorder layers | 1164 // with an associated view. Widget::ReorderNativeViews() may reorder layers |
1164 // below layers owned by a view. | 1165 // below layers owned by a view. |
1165 virtual void ReorderChildLayers(ui::Layer* parent_layer); | 1166 virtual void ReorderChildLayers(ui::Layer* parent_layer); |
1166 | 1167 |
1167 // Input --------------------------------------------------------------------- | 1168 // Input --------------------------------------------------------------------- |
1168 | 1169 |
1169 virtual DragInfo* GetDragInfo(); | 1170 virtual DragInfo* GetDragInfo(); |
1170 | 1171 |
1171 // Focus --------------------------------------------------------------------- | 1172 // Focus --------------------------------------------------------------------- |
1172 | 1173 |
1173 // Returns last set focus behavior. | |
1174 FocusBehavior focus_behavior() const { return focus_behavior_; } | |
1175 | |
1176 // Override to be notified when focus has changed either to or from this View. | 1174 // Override to be notified when focus has changed either to or from this View. |
1177 virtual void OnFocus(); | 1175 virtual void OnFocus(); |
1178 virtual void OnBlur(); | 1176 virtual void OnBlur(); |
1179 | 1177 |
1180 // Handle view focus/blur events for this view. | 1178 // Handle view focus/blur events for this view. |
1181 void Focus(); | 1179 void Focus(); |
1182 void Blur(); | 1180 void Blur(); |
1183 | 1181 |
1184 // System events ------------------------------------------------------------- | 1182 // System events ------------------------------------------------------------- |
1185 | 1183 |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 // Drag and drop ------------------------------------------------------------- | 1597 // Drag and drop ------------------------------------------------------------- |
1600 | 1598 |
1601 DragController* drag_controller_; | 1599 DragController* drag_controller_; |
1602 | 1600 |
1603 // Input -------------------------------------------------------------------- | 1601 // Input -------------------------------------------------------------------- |
1604 | 1602 |
1605 std::unique_ptr<ViewTargeter> targeter_; | 1603 std::unique_ptr<ViewTargeter> targeter_; |
1606 | 1604 |
1607 // Accessibility ------------------------------------------------------------- | 1605 // Accessibility ------------------------------------------------------------- |
1608 | 1606 |
1609 // Belongs to this view, but it's reference-counted on some platforms | 1607 // The accessibility element used to represent this View. |
1610 // so we can't use a scoped_ptr. It's dereferenced in the destructor. | 1608 std::unique_ptr<NativeViewAccessibility> native_view_accessibility_; |
1611 NativeViewAccessibility* native_view_accessibility_; | |
1612 | 1609 |
1613 // Observers ------------------------------------------------------------- | 1610 // Observers ------------------------------------------------------------- |
1614 | 1611 |
1615 base::ObserverList<ViewObserver> observers_; | 1612 base::ObserverList<ViewObserver> observers_; |
1616 | 1613 |
1617 DISALLOW_COPY_AND_ASSIGN(View); | 1614 DISALLOW_COPY_AND_ASSIGN(View); |
1618 }; | 1615 }; |
1619 | 1616 |
1620 } // namespace views | 1617 } // namespace views |
1621 | 1618 |
1622 #endif // UI_VIEWS_VIEW_H_ | 1619 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |