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