Chromium Code Reviews| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 using ui::OSExchangeData; | 46 using ui::OSExchangeData; |
| 47 | 47 |
| 48 namespace gfx { | 48 namespace gfx { |
| 49 class Canvas; | 49 class Canvas; |
| 50 class Insets; | 50 class Insets; |
| 51 class Path; | 51 class Path; |
| 52 class Transform; | 52 class Transform; |
| 53 } | 53 } |
| 54 | 54 |
| 55 namespace ui { | 55 namespace ui { |
| 56 struct AXViewState; | 56 struct AXActionData; |
| 57 struct AXNodeData; | |
| 57 class Compositor; | 58 class Compositor; |
| 58 class InputMethod; | 59 class InputMethod; |
| 59 class Layer; | 60 class Layer; |
| 60 class NativeTheme; | 61 class NativeTheme; |
| 61 class PaintContext; | 62 class PaintContext; |
| 62 class TextInputClient; | 63 class TextInputClient; |
| 63 class Texture; | 64 class Texture; |
| 64 class ThemeProvider; | 65 class ThemeProvider; |
| 65 } | 66 } |
| 66 | 67 |
| (...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 938 // Invoked from DoDrag after the drag completes. This implementation does | 939 // Invoked from DoDrag after the drag completes. This implementation does |
| 939 // nothing, and is intended for subclasses to do cleanup. | 940 // nothing, and is intended for subclasses to do cleanup. |
| 940 virtual void OnDragDone(); | 941 virtual void OnDragDone(); |
| 941 | 942 |
| 942 // Returns true if the mouse was dragged enough to start a drag operation. | 943 // Returns true if the mouse was dragged enough to start a drag operation. |
| 943 // delta_x and y are the distance the mouse was dragged. | 944 // delta_x and y are the distance the mouse was dragged. |
| 944 static bool ExceededDragThreshold(const gfx::Vector2d& delta); | 945 static bool ExceededDragThreshold(const gfx::Vector2d& delta); |
| 945 | 946 |
| 946 // Accessibility ------------------------------------------------------------- | 947 // Accessibility ------------------------------------------------------------- |
| 947 | 948 |
| 948 // Modifies |state| to reflect the current accessible state of this view. | 949 // Modifies |node_data| to reflect the current accessible state of this view. |
| 949 virtual void GetAccessibleState(ui::AXViewState* state) { } | 950 virtual void GetAccessibleNodeData(ui::AXNodeData* node_data) {} |
|
sky
2016/11/03 20:10:14
While you're changing all this code is there a rea
dmazzoni
2016/11/03 22:27:37
I'm leaning against doing that because this matche
sky
2016/11/03 23:12:47
I didn't look everywhere, but in the couple of pla
| |
| 951 | |
| 952 // Handle a request from assistive technology to perform an action on this | |
| 953 // view. | |
| 954 virtual void HandleAccessibleAction(const ui::AXActionData& action_data) {} | |
|
sky
2016/11/03 20:10:14
Would this be easier for subclassing if it returne
dmazzoni
2016/11/03 22:27:37
Sure, done.
I added a comment to clarify that the
| |
| 950 | 955 |
| 951 // Returns an instance of the native accessibility interface for this view. | 956 // Returns an instance of the native accessibility interface for this view. |
| 952 virtual gfx::NativeViewAccessible GetNativeViewAccessible(); | 957 virtual gfx::NativeViewAccessible GetNativeViewAccessible(); |
| 953 | 958 |
| 954 // Notifies assistive technology that an accessibility event has | 959 // Notifies assistive technology that an accessibility event has |
| 955 // occurred on this view, such as when the view is focused or when its | 960 // occurred on this view, such as when the view is focused or when its |
| 956 // value changes. Pass true for |send_native_event| except for rare | 961 // value changes. Pass true for |send_native_event| except for rare |
| 957 // cases where the view is a native control that's already sending a | 962 // cases where the view is a native control that's already sending a |
| 958 // native accessibility event and the duplicate event would cause | 963 // native accessibility event and the duplicate event would cause |
| 959 // problems. | 964 // problems. |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1568 // Belongs to this view, but it's reference-counted on some platforms | 1573 // Belongs to this view, but it's reference-counted on some platforms |
| 1569 // so we can't use a scoped_ptr. It's dereferenced in the destructor. | 1574 // so we can't use a scoped_ptr. It's dereferenced in the destructor. |
| 1570 NativeViewAccessibility* native_view_accessibility_; | 1575 NativeViewAccessibility* native_view_accessibility_; |
| 1571 | 1576 |
| 1572 DISALLOW_COPY_AND_ASSIGN(View); | 1577 DISALLOW_COPY_AND_ASSIGN(View); |
| 1573 }; | 1578 }; |
| 1574 | 1579 |
| 1575 } // namespace views | 1580 } // namespace views |
| 1576 | 1581 |
| 1577 #endif // UI_VIEWS_VIEW_H_ | 1582 #endif // UI_VIEWS_VIEW_H_ |
| OLD | NEW |