Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: Source/core/inspector/LayoutEditor.h

Issue 1311783003: Devtools[LayoutEditor]: Rework layout-editor workflow (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@resize
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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" 12 #include "core/inspector/InspectorOverlayHost.h"
13 #include "platform/heap/Handle.h" 13 #include "platform/heap/Handle.h"
14 #include "wtf/PassOwnPtr.h" 14 #include "wtf/PassOwnPtr.h"
15 #include "wtf/RefPtr.h" 15 #include "wtf/RefPtr.h"
16 #include "wtf/text/WTFString.h" 16 #include "wtf/text/WTFString.h"
17 17
18 namespace blink { 18 namespace blink {
19 19
20 class CSSPrimitiveValue; 20 class CSSPrimitiveValue;
21 class InspectorCSSAgent; 21 class InspectorCSSAgent;
22 class InspectorDOMAgent;
22 class JSONArray; 23 class JSONArray;
23 class JSONObject; 24 class JSONObject;
24 25
25 class CORE_EXPORT LayoutEditor final: public NoBaseWillBeGarbageCollectedFinaliz ed<LayoutEditor>, public InspectorOverlayHost::LayoutEditorListener { 26 class CORE_EXPORT LayoutEditor final: public NoBaseWillBeGarbageCollectedFinaliz ed<LayoutEditor>, public InspectorOverlayHost::LayoutEditorListener {
26 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LayoutEditor); 27 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(LayoutEditor);
27 public: 28 public:
28 static PassOwnPtrWillBeRawPtr<LayoutEditor> create(InspectorCSSAgent* cssAge nt) 29 static PassOwnPtrWillBeRawPtr<LayoutEditor> create(InspectorCSSAgent* cssAge nt, InspectorDOMAgent* domAgent)
29 { 30 {
30 return adoptPtrWillBeNoop(new LayoutEditor(cssAgent)); 31 return adoptPtrWillBeNoop(new LayoutEditor(cssAgent, domAgent));
31 } 32 }
32 33
33 void setNode(Node*); 34 void setNode(Node*);
34 PassRefPtr<JSONObject> buildJSONInfo() const; 35 PassRefPtr<JSONObject> buildJSONInfo() const;
35 36
36 DECLARE_VIRTUAL_TRACE(); 37 DECLARE_VIRTUAL_TRACE();
37 38
38 private: 39 private:
39 explicit LayoutEditor(InspectorCSSAgent*); 40 LayoutEditor(InspectorCSSAgent*, InspectorDOMAgent*);
40 RefPtrWillBeRawPtr<CSSPrimitiveValue> getPropertyCSSValue(CSSPropertyID) con st; 41 RefPtrWillBeRawPtr<CSSPrimitiveValue> getPropertyCSSValue(CSSPropertyID) con st;
41 PassRefPtr<JSONObject> createValueDescription(const String&) const; 42 PassRefPtr<JSONObject> createValueDescription(const String&) const;
42 void appendAnchorFor(JSONArray*, const String&, const String&, const FloatPo int&, const FloatPoint&) const; 43 void appendAnchorFor(JSONArray*, const String&, const String&, const FloatPo int&, const FloatPoint&) const;
43 44
44 // InspectorOverlayHost::LayoutEditorListener implementation. 45 // InspectorOverlayHost::LayoutEditorListener implementation.
45 void overlayStartedPropertyChange(const String&) override; 46 void overlayStartedPropertyChange(const String&) override;
46 void overlayPropertyChanged(float) override; 47 void overlayPropertyChanged(float) override;
47 void overlayEndedPropertyChange() override; 48 void overlayEndedPropertyChange() override;
49 void clearSelection(bool) override;
48 50
49 RefPtrWillBeMember<Element> m_element; 51 RefPtrWillBeMember<Element> m_element;
50 RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent; 52 RawPtrWillBeMember<InspectorCSSAgent> m_cssAgent;
53 RawPtrWillBeMember<InspectorDOMAgent> m_domAgent;
51 CSSPropertyID m_changingProperty; 54 CSSPropertyID m_changingProperty;
52 float m_propertyInitialValue; 55 float m_propertyInitialValue;
53 float m_factor; 56 float m_factor;
54 CSSPrimitiveValue::UnitType m_valueUnitType; 57 CSSPrimitiveValue::UnitType m_valueUnitType;
58 bool m_madeChanges;
55 }; 59 };
56 60
57 } // namespace blink 61 } // namespace blink
58 62
59 63
60 #endif // !defined(LayoutEditor_h) 64 #endif // !defined(LayoutEditor_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698