Chromium Code Reviews| 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" | |
| 9 #include "core/dom/Node.h" | |
| 10 #include "core/inspector/InspectorOverlayHost.h" | |
| 8 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
| 9 #include "wtf/PassOwnPtr.h" | 12 #include "wtf/PassOwnPtr.h" |
| 10 #include "wtf/RefPtr.h" | 13 #include "wtf/RefPtr.h" |
| 14 #include "wtf/text/WTFString.h" | |
| 11 | 15 |
| 12 namespace blink { | 16 namespace blink { |
| 13 | 17 |
| 14 class JSONObject; | 18 class JSONObject; |
| 15 class Node; | 19 class InspectorCSSAgent; |
| 16 | 20 |
| 17 class LayoutEditor final : public NoBaseWillBeGarbageCollected<LayoutEditor> { | 21 class LayoutEditor final: public NoBaseWillBeGarbageCollected<LayoutEditor>, pub lic InspectorOverlayHost::LayoutEditorListener { |
| 18 public: | 22 public: |
| 19 static PassOwnPtrWillBeRawPtr<LayoutEditor> create(Node* node) | 23 static PassOwnPtrWillBeRawPtr<LayoutEditor> create() |
| 20 { | 24 { |
| 21 return adoptPtrWillBeNoop(new LayoutEditor(node)); | 25 return adoptPtrWillBeNoop(new LayoutEditor()); |
| 22 } | 26 } |
| 27 | |
| 28 void setCSSAgent(InspectorCSSAgent* cssAgent) { m_cssAgent = cssAgent; } | |
| 29 void setNode(Node* node) { m_node = node; } | |
|
dgozman
2015/06/25 10:10:39
Let's reset everything on each setNode.
sergeyv
2015/06/25 12:19:16
Done.
| |
| 23 PassRefPtr<JSONObject> buildJSONInfo() const; | 30 PassRefPtr<JSONObject> buildJSONInfo() const; |
| 24 | 31 |
| 25 DEFINE_INLINE_TRACE() | 32 DEFINE_INLINE_TRACE() |
| 26 { | 33 { |
| 27 visitor->trace(m_node); | 34 visitor->trace(m_node); |
| 35 visitor->trace(m_cssAgent); | |
| 28 } | 36 } |
| 29 | 37 |
| 30 private: | 38 private: |
| 31 explicit LayoutEditor(Node*); | 39 LayoutEditor(); |
| 40 | |
| 41 void overlayStartedPropertyChange(const String&) override; | |
|
dgozman
2015/06/25 10:10:39
// InspectorOverlayHost::LayoutEditorListener impl
sergeyv
2015/06/25 12:19:16
Done.
| |
| 42 void overlayPropertyChanged(float delta) override; | |
| 43 void overlayEndedPropertyChange() override; | |
| 32 | 44 |
| 33 RefPtrWillBeMember<Node> m_node; | 45 RefPtrWillBeMember<Node> m_node; |
| 46 RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent; | |
| 47 CSSPropertyID m_changingProperty; | |
| 48 float m_propertyInitialValue; | |
| 34 }; | 49 }; |
| 35 | 50 |
| 36 } // namespace blink | 51 } // namespace blink |
| 37 | 52 |
| 38 | 53 |
| 39 #endif // !defined(LayoutEditor_h) | 54 #endif // !defined(LayoutEditor_h) |
| OLD | NEW |