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

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

Issue 1204453002: Devtools: Create layout editor experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 5 years, 6 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 | Annotate | Revision Log
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 InspectorHighlight_h 5 #ifndef InspectorHighlight_h
6 #define InspectorHighlight_h 6 #define InspectorHighlight_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/InspectorTypeBuilder.h" 9 #include "core/InspectorTypeBuilder.h"
10 #include "platform/geometry/FloatQuad.h" 10 #include "platform/geometry/FloatQuad.h"
11 #include "platform/geometry/LayoutRect.h" 11 #include "platform/geometry/LayoutRect.h"
12 #include "platform/graphics/Color.h" 12 #include "platform/graphics/Color.h"
13 #include "platform/heap/Handle.h" 13 #include "platform/heap/Handle.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 class Color; 17 class Color;
18 class JSONObject;
18 class JSONValue; 19 class JSONValue;
19 20
20 struct InspectorHighlightConfig { 21 struct InspectorHighlightConfig {
21 WTF_MAKE_FAST_ALLOCATED(InspectorHighlightConfig); 22 WTF_MAKE_FAST_ALLOCATED(InspectorHighlightConfig);
22 public: 23 public:
23 Color content; 24 Color content;
24 Color contentOutline; 25 Color contentOutline;
25 Color padding; 26 Color padding;
26 Color border; 27 Color border;
27 Color margin; 28 Color margin;
28 Color eventTarget; 29 Color eventTarget;
29 Color shape; 30 Color shape;
30 Color shapeMargin; 31 Color shapeMargin;
31 32
32 bool showInfo; 33 bool showInfo;
33 bool showRulers; 34 bool showRulers;
34 bool showExtensionLines; 35 bool showExtensionLines;
36 bool showLayoutEditor;
35 }; 37 };
36 38
37 class CORE_EXPORT InspectorHighlight { 39 class CORE_EXPORT InspectorHighlight {
38 STACK_ALLOCATED(); 40 STACK_ALLOCATED();
39 public: 41 public:
40 InspectorHighlight(Node*, const InspectorHighlightConfig&, bool appendElemen tInfo); 42 InspectorHighlight(Node*, const InspectorHighlightConfig&, bool appendElemen tInfo);
41 InspectorHighlight(); 43 InspectorHighlight();
42 ~InspectorHighlight(); 44 ~InspectorHighlight();
43 45
44 static bool getBoxModel(Node*, RefPtr<TypeBuilder::DOM::BoxModel>&); 46 static bool getBoxModel(Node*, RefPtr<TypeBuilder::DOM::BoxModel>&);
45 static InspectorHighlightConfig defaultConfig(); 47 static InspectorHighlightConfig defaultConfig();
48 static PassOwnPtr<InspectorHighlightConfig> highlightConfigFromInspectorObje ct(JSONObject*);
49 static PassOwnPtr<InspectorHighlightConfig> highlightConfigWithColors(const RefPtr<JSONObject>*, const RefPtr<JSONObject>*);
50
46 51
47 void appendPath(PassRefPtr<JSONArrayBase> path, const Color& fillColor, cons t Color& outlineColor); 52 void appendPath(PassRefPtr<JSONArrayBase> path, const Color& fillColor, cons t Color& outlineColor);
48 void appendQuad(const FloatQuad&, const Color& fillColor, const Color& outli neColor = Color::transparent); 53 void appendQuad(const FloatQuad&, const Color& fillColor, const Color& outli neColor = Color::transparent);
49 void appendEventTargetQuads(Node* eventTargetNode, const InspectorHighlightC onfig&); 54 void appendEventTargetQuads(Node* eventTargetNode, const InspectorHighlightC onfig&);
50 PassRefPtr<JSONObject> asJSONObject() const; 55 PassRefPtr<JSONObject> asJSONObject() const;
51 56
52 private: 57 private:
53 void appendNodeHighlight(Node*, const InspectorHighlightConfig&); 58 void appendNodeHighlight(Node*, const InspectorHighlightConfig&);
54 void appendPathsForShapeOutside(Node*, const InspectorHighlightConfig&); 59 void appendPathsForShapeOutside(Node*, const InspectorHighlightConfig&);
55 60
56 RefPtr<JSONObject> m_elementInfo; 61 RefPtr<JSONObject> m_elementInfo;
57 RefPtr<JSONArray> m_highlightPaths; 62 RefPtr<JSONArray> m_highlightPaths;
58 bool m_showRulers; 63 bool m_showRulers;
59 bool m_showExtensionLines; 64 bool m_showExtensionLines;
60 }; 65 };
61 66
62 } // namespace blink 67 } // namespace blink
63 68
64 #endif // InspectorHighlight_h 69 #endif // InspectorHighlight_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698