OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 struct HighlightConfig { | 52 struct HighlightConfig { |
53 WTF_MAKE_FAST_ALLOCATED; | 53 WTF_MAKE_FAST_ALLOCATED; |
54 public: | 54 public: |
55 Color content; | 55 Color content; |
56 Color contentOutline; | 56 Color contentOutline; |
57 Color padding; | 57 Color padding; |
58 Color border; | 58 Color border; |
59 Color margin; | 59 Color margin; |
60 bool showInfo; | 60 bool showInfo; |
| 61 bool showRulers; |
61 }; | 62 }; |
62 | 63 |
63 enum HighlightType { | 64 enum HighlightType { |
64 HighlightTypeNode, | 65 HighlightTypeNode, |
65 HighlightTypeRects, | 66 HighlightTypeRects, |
66 }; | 67 }; |
67 | 68 |
68 struct Highlight { | 69 struct Highlight { |
69 void setColors(const HighlightConfig& highlightConfig) | 70 Highlight() |
| 71 : type(HighlightTypeNode) |
| 72 , showRulers(false) |
| 73 { |
| 74 } |
| 75 |
| 76 void setDataFromConfig(const HighlightConfig& highlightConfig) |
70 { | 77 { |
71 contentColor = highlightConfig.content; | 78 contentColor = highlightConfig.content; |
72 contentOutlineColor = highlightConfig.contentOutline; | 79 contentOutlineColor = highlightConfig.contentOutline; |
73 paddingColor = highlightConfig.padding; | 80 paddingColor = highlightConfig.padding; |
74 borderColor = highlightConfig.border; | 81 borderColor = highlightConfig.border; |
75 marginColor = highlightConfig.margin; | 82 marginColor = highlightConfig.margin; |
| 83 showRulers = highlightConfig.showRulers; |
76 } | 84 } |
77 | 85 |
78 Color contentColor; | 86 Color contentColor; |
79 Color contentOutlineColor; | 87 Color contentOutlineColor; |
80 Color paddingColor; | 88 Color paddingColor; |
81 Color borderColor; | 89 Color borderColor; |
82 Color marginColor; | 90 Color marginColor; |
83 | 91 |
84 // When the type is Node, there are 4 quads (margin, border, padding, conten
t). | 92 // When the type is Node, there are 4 quads (margin, border, padding, conten
t). |
85 // When the type is Rects, this is just a list of quads. | 93 // When the type is Rects, this is just a list of quads. |
86 HighlightType type; | 94 HighlightType type; |
87 Vector<FloatQuad> quads; | 95 Vector<FloatQuad> quads; |
| 96 bool showRulers; |
88 }; | 97 }; |
89 | 98 |
90 class InspectorOverlay { | 99 class InspectorOverlay { |
91 WTF_MAKE_FAST_ALLOCATED; | 100 WTF_MAKE_FAST_ALLOCATED; |
92 public: | 101 public: |
93 static PassOwnPtr<InspectorOverlay> create(Page* page, InspectorClient* clie
nt) | 102 static PassOwnPtr<InspectorOverlay> create(Page* page, InspectorClient* clie
nt) |
94 { | 103 { |
95 return adoptPtr(new InspectorOverlay(page, client)); | 104 return adoptPtr(new InspectorOverlay(page, client)); |
96 } | 105 } |
97 ~InspectorOverlay(); | 106 ~InspectorOverlay(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 OwnPtr<IntRect> m_highlightRect; | 141 OwnPtr<IntRect> m_highlightRect; |
133 OwnPtr<Page> m_overlayPage; | 142 OwnPtr<Page> m_overlayPage; |
134 HighlightConfig m_rectHighlightConfig; | 143 HighlightConfig m_rectHighlightConfig; |
135 IntSize m_size; | 144 IntSize m_size; |
136 }; | 145 }; |
137 | 146 |
138 } // namespace WebCore | 147 } // namespace WebCore |
139 | 148 |
140 | 149 |
141 #endif // InspectorOverlay_h | 150 #endif // InspectorOverlay_h |
OLD | NEW |