OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 LayoutEditor_h | 5 #ifndef LayoutEditor_h |
6 #define LayoutEditor_h | 6 #define LayoutEditor_h |
7 | 7 |
8 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
10 #include "core/css/CSSPrimitiveValue.h" | 10 #include "core/css/CSSPrimitiveValue.h" |
11 #include "core/dom/Node.h" | 11 #include "core/dom/Node.h" |
12 #include "core/inspector/InspectorOverlayHost.h" | |
13 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
14 #include "wtf/PassOwnPtr.h" | 13 #include "wtf/PassOwnPtr.h" |
15 #include "wtf/RefPtr.h" | 14 #include "wtf/RefPtr.h" |
16 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
17 | 16 |
18 namespace blink { | 17 namespace blink { |
19 | 18 |
20 class CSSPrimitiveValue; | 19 class CSSPrimitiveValue; |
21 class InspectorCSSAgent; | 20 class InspectorCSSAgent; |
22 class JSONArray; | 21 class JSONArray; |
23 class JSONObject; | 22 class JSONObject; |
24 | 23 |
25 class CORE_EXPORT LayoutEditor final: public NoBaseWillBeGarbageCollectedFinaliz
ed<LayoutEditor>, public InspectorOverlayHost::LayoutEditorListener { | 24 class CORE_EXPORT LayoutEditor final: public NoBaseWillBeGarbageCollectedFinaliz
ed<LayoutEditor> { |
26 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LayoutEditor); | 25 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LayoutEditor); |
27 public: | 26 public: |
28 static PassOwnPtrWillBeRawPtr<LayoutEditor> create(InspectorCSSAgent* cssAge
nt) | 27 static PassOwnPtrWillBeRawPtr<LayoutEditor> create(InspectorCSSAgent* cssAge
nt) |
29 { | 28 { |
30 return adoptPtrWillBeNoop(new LayoutEditor(cssAgent)); | 29 return adoptPtrWillBeNoop(new LayoutEditor(cssAgent)); |
31 } | 30 } |
32 | 31 |
33 void setNode(Node*); | 32 void setNode(Node*); |
34 PassRefPtr<JSONObject> buildJSONInfo() const; | 33 PassRefPtr<JSONObject> buildJSONInfo() const; |
| 34 void overlayStartedPropertyChange(const String&); |
| 35 void overlayPropertyChanged(float); |
| 36 void overlayEndedPropertyChange(); |
35 | 37 |
36 DECLARE_VIRTUAL_TRACE(); | 38 DECLARE_VIRTUAL_TRACE(); |
37 | 39 |
38 private: | 40 private: |
39 explicit LayoutEditor(InspectorCSSAgent*); | 41 explicit LayoutEditor(InspectorCSSAgent*); |
40 RefPtrWillBeRawPtr<CSSPrimitiveValue> getPropertyCSSValue(CSSPropertyID) con
st; | 42 RefPtrWillBeRawPtr<CSSPrimitiveValue> getPropertyCSSValue(CSSPropertyID) con
st; |
41 PassRefPtr<JSONObject> createValueDescription(const String&) const; | 43 PassRefPtr<JSONObject> createValueDescription(const String&) const; |
42 void appendAnchorFor(JSONArray*, const String&, const String&, const FloatPo
int&, const FloatPoint&) const; | 44 void appendAnchorFor(JSONArray*, const String&, const String&, const FloatPo
int&, const FloatPoint&) const; |
43 | 45 |
44 // InspectorOverlayHost::LayoutEditorListener implementation. | |
45 void overlayStartedPropertyChange(const String&) override; | |
46 void overlayPropertyChanged(float) override; | |
47 void overlayEndedPropertyChange() override; | |
48 | |
49 RefPtrWillBeMember<Element> m_element; | 46 RefPtrWillBeMember<Element> m_element; |
50 RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent; | 47 RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent; |
51 CSSPropertyID m_changingProperty; | 48 CSSPropertyID m_changingProperty; |
52 float m_propertyInitialValue; | 49 float m_propertyInitialValue; |
53 float m_factor; | 50 float m_factor; |
54 CSSPrimitiveValue::UnitType m_valueUnitType; | 51 CSSPrimitiveValue::UnitType m_valueUnitType; |
55 }; | 52 }; |
56 | 53 |
57 } // namespace blink | 54 } // namespace blink |
58 | 55 |
59 | 56 |
60 #endif // !defined(LayoutEditor_h) | 57 #endif // !defined(LayoutEditor_h) |
OLD | NEW |