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/Element.h" |
12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
13 #include "wtf/PassOwnPtr.h" | 13 #include "wtf/PassOwnPtr.h" |
14 #include "wtf/RefPtr.h" | 14 #include "wtf/RefPtr.h" |
15 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 class CSSPrimitiveValue; | 19 class CSSPrimitiveValue; |
20 class InspectorCSSAgent; | 20 class InspectorCSSAgent; |
| 21 class InspectorDOMAgent; |
21 class JSONArray; | 22 class JSONArray; |
22 class JSONObject; | 23 class JSONObject; |
23 | 24 |
24 class CORE_EXPORT LayoutEditor final : public NoBaseWillBeGarbageCollectedFinali
zed<LayoutEditor> { | 25 class CORE_EXPORT LayoutEditor final : public NoBaseWillBeGarbageCollectedFinali
zed<LayoutEditor> { |
25 public: | 26 public: |
26 static PassOwnPtrWillBeRawPtr<LayoutEditor> create(InspectorCSSAgent* cssAge
nt) | 27 static PassOwnPtrWillBeRawPtr<LayoutEditor> create(InspectorCSSAgent* cssAge
nt, InspectorDOMAgent* domAgent) |
27 { | 28 { |
28 return adoptPtrWillBeNoop(new LayoutEditor(cssAgent)); | 29 return adoptPtrWillBeNoop(new LayoutEditor(cssAgent, domAgent)); |
29 } | 30 } |
30 | 31 |
31 void setNode(Node*); | 32 void selectNode(Node*); |
| 33 Node* node() { return m_element.get(); } |
32 PassRefPtr<JSONObject> buildJSONInfo() const; | 34 PassRefPtr<JSONObject> buildJSONInfo() const; |
33 void overlayStartedPropertyChange(const String&); | 35 void overlayStartedPropertyChange(const String&); |
34 void overlayPropertyChanged(float); | 36 void overlayPropertyChanged(float); |
35 void overlayEndedPropertyChange(); | 37 void overlayEndedPropertyChange(); |
| 38 void clearSelection(bool); |
36 | 39 |
37 DECLARE_TRACE(); | 40 DECLARE_TRACE(); |
38 | 41 |
39 private: | 42 private: |
40 explicit LayoutEditor(InspectorCSSAgent*); | 43 LayoutEditor(InspectorCSSAgent*, InspectorDOMAgent*); |
41 RefPtrWillBeRawPtr<CSSPrimitiveValue> getPropertyCSSValue(CSSPropertyID) con
st; | 44 RefPtrWillBeRawPtr<CSSPrimitiveValue> getPropertyCSSValue(CSSPropertyID) con
st; |
42 PassRefPtr<JSONObject> createValueDescription(const String&) const; | 45 PassRefPtr<JSONObject> createValueDescription(const String&) const; |
43 void appendAnchorFor(JSONArray*, const String&, const String&, const FloatPo
int&, const FloatPoint&) const; | 46 void appendAnchorFor(JSONArray*, const String&, const String&, const FloatPo
int&, const FloatPoint&) const; |
44 | 47 |
45 RefPtrWillBeMember<Element> m_element; | 48 RefPtrWillBeMember<Element> m_element; |
46 RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent; | 49 RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent; |
| 50 RawPtrWillBeMember<InspectorDOMAgent> m_domAgent; |
47 CSSPropertyID m_changingProperty; | 51 CSSPropertyID m_changingProperty; |
48 float m_propertyInitialValue; | 52 float m_propertyInitialValue; |
49 float m_factor; | 53 float m_factor; |
50 CSSPrimitiveValue::UnitType m_valueUnitType; | 54 CSSPrimitiveValue::UnitType m_valueUnitType; |
| 55 bool m_isDirty; |
51 }; | 56 }; |
52 | 57 |
53 } // namespace blink | 58 } // namespace blink |
54 | 59 |
55 | 60 |
56 #endif // !defined(LayoutEditor_h) | 61 #endif // !defined(LayoutEditor_h) |
OLD | NEW |