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 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 "platform/geometry/FloatQuad.h" | 9 #include "platform/geometry/FloatQuad.h" |
10 #include "platform/geometry/LayoutRect.h" | 10 #include "platform/geometry/LayoutRect.h" |
11 #include "platform/graphics/Color.h" | 11 #include "platform/graphics/Color.h" |
12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
13 #include "platform/inspector_protocol/TypeBuilder.h" | 13 #include "platform/inspector_protocol/TypeBuilder.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class Color; | 17 class Color; |
18 class JSONValue; | 18 |
| 19 namespace protocol { |
| 20 class Value; |
| 21 } |
19 | 22 |
20 struct CORE_EXPORT InspectorHighlightConfig { | 23 struct CORE_EXPORT InspectorHighlightConfig { |
21 USING_FAST_MALLOC(InspectorHighlightConfig); | 24 USING_FAST_MALLOC(InspectorHighlightConfig); |
22 public: | 25 public: |
23 InspectorHighlightConfig(); | 26 InspectorHighlightConfig(); |
24 | 27 |
25 Color content; | 28 Color content; |
26 Color contentOutline; | 29 Color contentOutline; |
27 Color padding; | 30 Color padding; |
28 Color border; | 31 Color border; |
(...skipping 14 matching lines...) Expand all Loading... |
43 STACK_ALLOCATED(); | 46 STACK_ALLOCATED(); |
44 public: | 47 public: |
45 InspectorHighlight(Node*, const InspectorHighlightConfig&, bool appendElemen
tInfo); | 48 InspectorHighlight(Node*, const InspectorHighlightConfig&, bool appendElemen
tInfo); |
46 InspectorHighlight(); | 49 InspectorHighlight(); |
47 ~InspectorHighlight(); | 50 ~InspectorHighlight(); |
48 | 51 |
49 static bool getBoxModel(Node*, OwnPtr<protocol::DOM::BoxModel>*); | 52 static bool getBoxModel(Node*, OwnPtr<protocol::DOM::BoxModel>*); |
50 static InspectorHighlightConfig defaultConfig(); | 53 static InspectorHighlightConfig defaultConfig(); |
51 static bool buildNodeQuads(Node*, FloatQuad* content, FloatQuad* padding, Fl
oatQuad* border, FloatQuad* margin); | 54 static bool buildNodeQuads(Node*, FloatQuad* content, FloatQuad* padding, Fl
oatQuad* border, FloatQuad* margin); |
52 | 55 |
53 void appendPath(PassRefPtr<JSONArray> path, const Color& fillColor, const Co
lor& outlineColor, const String& name = String()); | 56 void appendPath(PassRefPtr<protocol::ListValue> path, const Color& fillColor
, const Color& outlineColor, const String& name = String()); |
54 void appendQuad(const FloatQuad&, const Color& fillColor, const Color& outli
neColor = Color::transparent, const String& name = String()); | 57 void appendQuad(const FloatQuad&, const Color& fillColor, const Color& outli
neColor = Color::transparent, const String& name = String()); |
55 void appendEventTargetQuads(Node* eventTargetNode, const InspectorHighlightC
onfig&); | 58 void appendEventTargetQuads(Node* eventTargetNode, const InspectorHighlightC
onfig&); |
56 PassRefPtr<JSONObject> asJSONObject() const; | 59 PassRefPtr<protocol::DictionaryValue> asProtocolValue() const; |
57 | 60 |
58 private: | 61 private: |
59 void appendNodeHighlight(Node*, const InspectorHighlightConfig&); | 62 void appendNodeHighlight(Node*, const InspectorHighlightConfig&); |
60 void appendPathsForShapeOutside(Node*, const InspectorHighlightConfig&); | 63 void appendPathsForShapeOutside(Node*, const InspectorHighlightConfig&); |
61 | 64 |
62 RefPtr<JSONObject> m_elementInfo; | 65 RefPtr<protocol::DictionaryValue> m_elementInfo; |
63 RefPtr<JSONArray> m_highlightPaths; | 66 RefPtr<protocol::ListValue> m_highlightPaths; |
64 bool m_showRulers; | 67 bool m_showRulers; |
65 bool m_showExtensionLines; | 68 bool m_showExtensionLines; |
66 bool m_displayAsMaterial; | 69 bool m_displayAsMaterial; |
67 }; | 70 }; |
68 | 71 |
69 } // namespace blink | 72 } // namespace blink |
70 | 73 |
71 #endif // InspectorHighlight_h | 74 #endif // InspectorHighlight_h |
OLD | NEW |