OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "modules/accessibility/AXMockObject.h" | 30 #include "modules/accessibility/AXMockObject.h" |
31 | 31 |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 class AXObjectCacheImpl; | 35 class AXObjectCacheImpl; |
36 | 36 |
37 class AXSpinButton final : public AXMockObject { | 37 class AXSpinButton final : public AXMockObject { |
38 public: | 38 public: |
39 static PassRefPtrWillBeRawPtr<AXSpinButton> create(AXObjectCacheImpl&); | 39 static PassRefPtrWillBeRawPtr<AXSpinButton> create(AXObjectCacheImpl&); |
40 virtual ~AXSpinButton(); | 40 ~AXSpinButton() override; |
41 DECLARE_VIRTUAL_TRACE(); | 41 DECLARE_VIRTUAL_TRACE(); |
42 | 42 |
43 void setSpinButtonElement(SpinButtonElement* spinButton) { m_spinButtonEleme
nt = spinButton; } | 43 void setSpinButtonElement(SpinButtonElement* spinButton) { m_spinButtonEleme
nt = spinButton; } |
44 void step(int amount); | 44 void step(int amount); |
45 | 45 |
46 private: | 46 private: |
47 explicit AXSpinButton(AXObjectCacheImpl&); | 47 explicit AXSpinButton(AXObjectCacheImpl&); |
48 | 48 |
49 virtual AccessibilityRole roleValue() const override; | 49 AccessibilityRole roleValue() const override; |
50 virtual bool isSpinButton() const override { return true; } | 50 bool isSpinButton() const override { return true; } |
51 virtual bool isNativeSpinButton() const override { return true; } | 51 bool isNativeSpinButton() const override { return true; } |
52 virtual void addChildren() override; | 52 void addChildren() override; |
53 virtual LayoutRect elementRect() const override; | 53 LayoutRect elementRect() const override; |
54 virtual void detach() override; | 54 void detach() override; |
55 virtual void detachFromParent() override; | 55 void detachFromParent() override; |
56 | 56 |
57 RawPtrWillBeMember<SpinButtonElement> m_spinButtonElement; | 57 RawPtrWillBeMember<SpinButtonElement> m_spinButtonElement; |
58 }; | 58 }; |
59 | 59 |
60 class AXSpinButtonPart final : public AXMockObject { | 60 class AXSpinButtonPart final : public AXMockObject { |
61 public: | 61 public: |
62 static PassRefPtrWillBeRawPtr<AXSpinButtonPart> create(AXObjectCacheImpl&); | 62 static PassRefPtrWillBeRawPtr<AXSpinButtonPart> create(AXObjectCacheImpl&); |
63 virtual ~AXSpinButtonPart() { } | 63 ~AXSpinButtonPart() override { } |
64 | 64 |
65 bool isIncrementor() const { return m_isIncrementor; } | 65 bool isIncrementor() const { return m_isIncrementor; } |
66 void setIsIncrementor(bool value) { m_isIncrementor = value; } | 66 void setIsIncrementor(bool value) { m_isIncrementor = value; } |
67 | 67 |
68 private: | 68 private: |
69 explicit AXSpinButtonPart(AXObjectCacheImpl&); | 69 explicit AXSpinButtonPart(AXObjectCacheImpl&); |
70 bool m_isIncrementor : 1; | 70 bool m_isIncrementor : 1; |
71 | 71 |
72 virtual bool press() const override; | 72 bool press() const override; |
73 virtual AccessibilityRole roleValue() const override { return ButtonRole; } | 73 AccessibilityRole roleValue() const override { return ButtonRole; } |
74 virtual bool isSpinButtonPart() const override { return true; } | 74 bool isSpinButtonPart() const override { return true; } |
75 virtual LayoutRect elementRect() const override; | 75 LayoutRect elementRect() const override; |
76 }; | 76 }; |
77 | 77 |
78 DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButton, isNativeSpinButton()); | 78 DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButton, isNativeSpinButton()); |
79 DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButtonPart, isSpinButtonPart()); | 79 DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButtonPart, isSpinButtonPart()); |
80 | 80 |
81 } // namespace blink | 81 } // namespace blink |
82 | 82 |
83 #endif // AXSpinButton_h | 83 #endif // AXSpinButton_h |
OLD | NEW |