| 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 18 matching lines...) Expand all Loading... |
| 29 #include "core/html/shadow/SpinButtonElement.h" | 29 #include "core/html/shadow/SpinButtonElement.h" |
| 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 PassRefPtr<AXSpinButton> create(AXObjectCacheImpl*); | 39 static PassRefPtr<AXSpinButton> create(AXObjectCacheImpl&); |
| 40 virtual ~AXSpinButton(); | 40 virtual ~AXSpinButton(); |
| 41 | 41 |
| 42 void setSpinButtonElement(SpinButtonElement* spinButton) { m_spinButtonEleme
nt = spinButton; } | 42 void setSpinButtonElement(SpinButtonElement* spinButton) { m_spinButtonEleme
nt = spinButton; } |
| 43 void step(int amount); | 43 void step(int amount); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 explicit AXSpinButton(AXObjectCacheImpl*); | 46 explicit AXSpinButton(AXObjectCacheImpl&); |
| 47 | 47 |
| 48 virtual AccessibilityRole roleValue() const override; | 48 virtual AccessibilityRole roleValue() const override; |
| 49 virtual bool isSpinButton() const override { return true; } | 49 virtual bool isSpinButton() const override { return true; } |
| 50 virtual bool isNativeSpinButton() const override { return true; } | 50 virtual bool isNativeSpinButton() const override { return true; } |
| 51 virtual void addChildren() override; | 51 virtual void addChildren() override; |
| 52 virtual LayoutRect elementRect() const override; | 52 virtual LayoutRect elementRect() const override; |
| 53 virtual void detach() override; | 53 virtual void detach() override; |
| 54 virtual void detachFromParent() override; | 54 virtual void detachFromParent() override; |
| 55 | 55 |
| 56 SpinButtonElement* m_spinButtonElement; | 56 SpinButtonElement* m_spinButtonElement; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 class AXSpinButtonPart final : public AXMockObject { | 59 class AXSpinButtonPart final : public AXMockObject { |
| 60 public: | 60 public: |
| 61 static PassRefPtr<AXSpinButtonPart> create(AXObjectCacheImpl*); | 61 static PassRefPtr<AXSpinButtonPart> create(AXObjectCacheImpl&); |
| 62 virtual ~AXSpinButtonPart() { } | 62 virtual ~AXSpinButtonPart() { } |
| 63 | 63 |
| 64 bool isIncrementor() const { return m_isIncrementor; } | 64 bool isIncrementor() const { return m_isIncrementor; } |
| 65 void setIsIncrementor(bool value) { m_isIncrementor = value; } | 65 void setIsIncrementor(bool value) { m_isIncrementor = value; } |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 explicit AXSpinButtonPart(AXObjectCacheImpl*); | 68 explicit AXSpinButtonPart(AXObjectCacheImpl&); |
| 69 bool m_isIncrementor : 1; | 69 bool m_isIncrementor : 1; |
| 70 | 70 |
| 71 virtual bool press() const override; | 71 virtual bool press() const override; |
| 72 virtual AccessibilityRole roleValue() const override { return ButtonRole; } | 72 virtual AccessibilityRole roleValue() const override { return ButtonRole; } |
| 73 virtual bool isSpinButtonPart() const override { return true; } | 73 virtual bool isSpinButtonPart() const override { return true; } |
| 74 virtual LayoutRect elementRect() const override; | 74 virtual LayoutRect elementRect() const override; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButton, isNativeSpinButton()); | 77 DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButton, isNativeSpinButton()); |
| 78 DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButtonPart, isSpinButtonPart()); | 78 DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButtonPart, isSpinButtonPart()); |
| 79 | 79 |
| 80 } // namespace blink | 80 } // namespace blink |
| 81 | 81 |
| 82 #endif // AXSpinButton_h | 82 #endif // AXSpinButton_h |
| OLD | NEW |