OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CSSTransitionData_h | 5 #ifndef CSSTransitionData_h |
6 #define CSSTransitionData_h | 6 #define CSSTransitionData_h |
7 | 7 |
8 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
9 #include "core/animation/css/CSSTimingData.h" | 9 #include "core/animation/css/CSSTimingData.h" |
| 10 #include "wtf/PtrUtil.h" |
10 #include "wtf/Vector.h" | 11 #include "wtf/Vector.h" |
| 12 #include <memory> |
11 | 13 |
12 namespace blink { | 14 namespace blink { |
13 | 15 |
14 class CSSTransitionData final : public CSSTimingData { | 16 class CSSTransitionData final : public CSSTimingData { |
15 public: | 17 public: |
16 enum TransitionPropertyType { | 18 enum TransitionPropertyType { |
17 TransitionNone, | 19 TransitionNone, |
18 TransitionKnownProperty, | 20 TransitionKnownProperty, |
19 TransitionUnknownProperty, | 21 TransitionUnknownProperty, |
20 }; | 22 }; |
(...skipping 22 matching lines...) Expand all Loading... |
43 ASSERT(type == TransitionNone); | 45 ASSERT(type == TransitionNone); |
44 } | 46 } |
45 | 47 |
46 bool operator==(const TransitionProperty& other) const { return property
Type == other.propertyType && unresolvedProperty == other.unresolvedProperty &&
propertyString == other.propertyString; } | 48 bool operator==(const TransitionProperty& other) const { return property
Type == other.propertyType && unresolvedProperty == other.unresolvedProperty &&
propertyString == other.propertyString; } |
47 | 49 |
48 TransitionPropertyType propertyType; | 50 TransitionPropertyType propertyType; |
49 CSSPropertyID unresolvedProperty; | 51 CSSPropertyID unresolvedProperty; |
50 String propertyString; | 52 String propertyString; |
51 }; | 53 }; |
52 | 54 |
53 static PassOwnPtr<CSSTransitionData> create() | 55 static std::unique_ptr<CSSTransitionData> create() |
54 { | 56 { |
55 return adoptPtr(new CSSTransitionData); | 57 return wrapUnique(new CSSTransitionData); |
56 } | 58 } |
57 | 59 |
58 static PassOwnPtr<CSSTransitionData> create(const CSSTransitionData& transit
ionData) | 60 static std::unique_ptr<CSSTransitionData> create(const CSSTransitionData& tr
ansitionData) |
59 { | 61 { |
60 return adoptPtr(new CSSTransitionData(transitionData)); | 62 return wrapUnique(new CSSTransitionData(transitionData)); |
61 } | 63 } |
62 | 64 |
63 bool transitionsMatchForStyleRecalc(const CSSTransitionData& other) const; | 65 bool transitionsMatchForStyleRecalc(const CSSTransitionData& other) const; |
64 | 66 |
65 Timing convertToTiming(size_t index) const; | 67 Timing convertToTiming(size_t index) const; |
66 | 68 |
67 const Vector<TransitionProperty>& propertyList() const { return m_propertyLi
st; } | 69 const Vector<TransitionProperty>& propertyList() const { return m_propertyLi
st; } |
68 Vector<TransitionProperty>& propertyList() { return m_propertyList; } | 70 Vector<TransitionProperty>& propertyList() { return m_propertyList; } |
69 | 71 |
70 static TransitionProperty initialProperty() { return TransitionProperty(CSSP
ropertyAll); } | 72 static TransitionProperty initialProperty() { return TransitionProperty(CSSP
ropertyAll); } |
71 | 73 |
72 private: | 74 private: |
73 CSSTransitionData(); | 75 CSSTransitionData(); |
74 explicit CSSTransitionData(const CSSTransitionData&); | 76 explicit CSSTransitionData(const CSSTransitionData&); |
75 | 77 |
76 Vector<TransitionProperty> m_propertyList; | 78 Vector<TransitionProperty> m_propertyList; |
77 }; | 79 }; |
78 | 80 |
79 } // namespace blink | 81 } // namespace blink |
80 | 82 |
81 #endif // CSSTransitionData_h | 83 #endif // CSSTransitionData_h |
OLD | NEW |