Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Side by Side Diff: Source/modules/accessibility/AXSpinButton.h

Issue 1072273006: Oilpan: Prepare moving AXObject to heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 PassRefPtrWillBeRawPtr<AXSpinButton> create(AXObjectCacheImpl&);
40 virtual ~AXSpinButton(); 40 virtual ~AXSpinButton();
41 DECLARE_VIRTUAL_TRACE();
41 42
42 void setSpinButtonElement(SpinButtonElement* spinButton) { m_spinButtonEleme nt = spinButton; } 43 void setSpinButtonElement(SpinButtonElement* spinButton) { m_spinButtonEleme nt = spinButton; }
43 void step(int amount); 44 void step(int amount);
44 45
45 private: 46 private:
46 explicit AXSpinButton(AXObjectCacheImpl&); 47 explicit AXSpinButton(AXObjectCacheImpl&);
47 48
48 virtual AccessibilityRole roleValue() const override; 49 virtual AccessibilityRole roleValue() const override;
49 virtual bool isSpinButton() const override { return true; } 50 virtual bool isSpinButton() const override { return true; }
50 virtual bool isNativeSpinButton() const override { return true; } 51 virtual bool isNativeSpinButton() const override { return true; }
51 virtual void addChildren() override; 52 virtual void addChildren() override;
52 virtual LayoutRect elementRect() const override; 53 virtual LayoutRect elementRect() const override;
53 virtual void detach() override; 54 virtual void detach() override;
54 virtual void detachFromParent() override; 55 virtual void detachFromParent() override;
55 56
56 SpinButtonElement* m_spinButtonElement; 57 RawPtrWillBeMember<SpinButtonElement> m_spinButtonElement;
57 }; 58 };
58 59
59 class AXSpinButtonPart final : public AXMockObject { 60 class AXSpinButtonPart final : public AXMockObject {
60 public: 61 public:
61 static PassRefPtr<AXSpinButtonPart> create(AXObjectCacheImpl&); 62 static PassRefPtrWillBeRawPtr<AXSpinButtonPart> create(AXObjectCacheImpl&);
62 virtual ~AXSpinButtonPart() { } 63 virtual ~AXSpinButtonPart() { }
63 64
64 bool isIncrementor() const { return m_isIncrementor; } 65 bool isIncrementor() const { return m_isIncrementor; }
65 void setIsIncrementor(bool value) { m_isIncrementor = value; } 66 void setIsIncrementor(bool value) { m_isIncrementor = value; }
66 67
67 private: 68 private:
68 explicit AXSpinButtonPart(AXObjectCacheImpl&); 69 explicit AXSpinButtonPart(AXObjectCacheImpl&);
69 bool m_isIncrementor : 1; 70 bool m_isIncrementor : 1;
70 71
71 virtual bool press() const override; 72 virtual bool press() const override;
72 virtual AccessibilityRole roleValue() const override { return ButtonRole; } 73 virtual AccessibilityRole roleValue() const override { return ButtonRole; }
73 virtual bool isSpinButtonPart() const override { return true; } 74 virtual bool isSpinButtonPart() const override { return true; }
74 virtual LayoutRect elementRect() const override; 75 virtual LayoutRect elementRect() const override;
75 }; 76 };
76 77
77 DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButton, isNativeSpinButton()); 78 DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButton, isNativeSpinButton());
78 DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButtonPart, isSpinButtonPart()); 79 DEFINE_AX_OBJECT_TYPE_CASTS(AXSpinButtonPart, isSpinButtonPart());
79 80
80 } // namespace blink 81 } // namespace blink
81 82
82 #endif // AXSpinButton_h 83 #endif // AXSpinButton_h
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXSlider.cpp ('k') | Source/modules/accessibility/AXSpinButton.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698