OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 private: | 93 private: |
94 ContentSecurityPolicy* m_contentSecurityPolicy; | 94 ContentSecurityPolicy* m_contentSecurityPolicy; |
95 }; | 95 }; |
96 | 96 |
97 static CSSStyleRule* asCSSStyleRule(CSSRule*); | 97 static CSSStyleRule* asCSSStyleRule(CSSRule*); |
98 | 98 |
99 static PassOwnPtr<InspectorCSSAgent> create(InspectorDOMAgent* domAgent, Ins
pectorPageAgent* pageAgent, InspectorResourceAgent* resourceAgent) | 99 static PassOwnPtr<InspectorCSSAgent> create(InspectorDOMAgent* domAgent, Ins
pectorPageAgent* pageAgent, InspectorResourceAgent* resourceAgent) |
100 { | 100 { |
101 return adoptPtr(new InspectorCSSAgent(domAgent, pageAgent, resourceAgent
)); | 101 return adoptPtr(new InspectorCSSAgent(domAgent, pageAgent, resourceAgent
)); |
102 } | 102 } |
| 103 |
| 104 static void collectAllDocumentStyleSheets(Document*, Vector<CSSStyleSheet*>&
); |
| 105 |
103 virtual ~InspectorCSSAgent(); | 106 virtual ~InspectorCSSAgent(); |
104 | 107 |
105 bool forcePseudoState(Element*, CSSSelector::PseudoType); | 108 bool forcePseudoState(Element*, CSSSelector::PseudoType); |
106 virtual void setFrontend(InspectorFrontend*) OVERRIDE; | 109 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
107 virtual void clearFrontend() OVERRIDE; | 110 virtual void clearFrontend() OVERRIDE; |
108 virtual void discardAgent() OVERRIDE; | 111 virtual void discardAgent() OVERRIDE; |
109 virtual void didCommitLoadForMainFrame() OVERRIDE; | 112 virtual void didCommitLoadForMainFrame() OVERRIDE; |
110 virtual void restore() OVERRIDE; | 113 virtual void restore() OVERRIDE; |
111 virtual void flushPendingFrontendMessages() OVERRIDE; | 114 virtual void flushPendingFrontendMessages() OVERRIDE; |
112 virtual void enable(ErrorString*, PassRefPtr<EnableCallback>) OVERRIDE; | 115 virtual void enable(ErrorString*, PassRefPtr<EnableCallback>) OVERRIDE; |
(...skipping 27 matching lines...) Expand all Loading... |
140 bool collectMediaQueriesFromStyleSheet(CSSStyleSheet*, TypeBuilder::Array<Ty
peBuilder::CSS::CSSMedia>* mediaArray); | 143 bool collectMediaQueriesFromStyleSheet(CSSStyleSheet*, TypeBuilder::Array<Ty
peBuilder::CSS::CSSMedia>* mediaArray); |
141 PassRefPtr<TypeBuilder::CSS::CSSMedia> buildMediaObject(const MediaList*, Me
diaListSource, const String&, CSSStyleSheet*); | 144 PassRefPtr<TypeBuilder::CSS::CSSMedia> buildMediaObject(const MediaList*, Me
diaListSource, const String&, CSSStyleSheet*); |
142 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSMedia> > buildMediaListCh
ain(CSSRule*); | 145 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSMedia> > buildMediaListCh
ain(CSSRule*); |
143 | 146 |
144 private: | 147 private: |
145 class StyleSheetAction; | 148 class StyleSheetAction; |
146 class SetStyleSheetTextAction; | 149 class SetStyleSheetTextAction; |
147 class SetPropertyTextAction; | 150 class SetPropertyTextAction; |
148 class SetRuleSelectorAction; | 151 class SetRuleSelectorAction; |
149 class AddRuleAction; | 152 class AddRuleAction; |
150 class EnableResourceClient; | 153 class InspectorResourceContentLoaderCallback; |
| 154 |
| 155 static void collectStyleSheets(CSSStyleSheet*, Vector<CSSStyleSheet*>&); |
151 | 156 |
152 InspectorCSSAgent(InspectorDOMAgent*, InspectorPageAgent*, InspectorResource
Agent*); | 157 InspectorCSSAgent(InspectorDOMAgent*, InspectorPageAgent*, InspectorResource
Agent*); |
153 | 158 |
154 typedef HashMap<String, RefPtr<InspectorStyleSheet> > IdToInspectorStyleShee
t; | 159 typedef HashMap<String, RefPtr<InspectorStyleSheet> > IdToInspectorStyleShee
t; |
155 typedef HashMap<String, RefPtr<InspectorStyleSheetForInlineStyle> > IdToInsp
ectorStyleSheetForInlineStyle; | 160 typedef HashMap<String, RefPtr<InspectorStyleSheetForInlineStyle> > IdToInsp
ectorStyleSheetForInlineStyle; |
156 typedef HashMap<Node*, RefPtr<InspectorStyleSheetForInlineStyle> > NodeToIns
pectorStyleSheet; // bogus "stylesheets" with elements' inline styles | 161 typedef HashMap<Node*, RefPtr<InspectorStyleSheetForInlineStyle> > NodeToIns
pectorStyleSheet; // bogus "stylesheets" with elements' inline styles |
157 typedef HashMap<int, unsigned> NodeIdToForcedPseudoState; | 162 typedef HashMap<int, unsigned> NodeIdToForcedPseudoState; |
158 | 163 |
159 void wasEnabled(PassRefPtr<EnableCallback>); | 164 void wasEnabled(); |
160 void resetNonPersistentData(); | 165 void resetNonPersistentData(); |
161 InspectorStyleSheetForInlineStyle* asInspectorStyleSheet(Element* element); | 166 InspectorStyleSheetForInlineStyle* asInspectorStyleSheet(Element* element); |
162 Element* elementForId(ErrorString*, int nodeId); | 167 Element* elementForId(ErrorString*, int nodeId); |
163 void collectAllStyleSheets(Vector<InspectorStyleSheet*>&); | |
164 void collectAllDocumentStyleSheets(Document*, Vector<CSSStyleSheet*>&); | |
165 void collectStyleSheets(CSSStyleSheet*, Vector<CSSStyleSheet*>&); | |
166 | 168 |
167 void updateActiveStyleSheets(Document*, StyleSheetsUpdateType); | 169 void updateActiveStyleSheets(Document*, StyleSheetsUpdateType); |
168 void setActiveStyleSheets(Document*, const Vector<CSSStyleSheet*>&, StyleShe
etsUpdateType); | 170 void setActiveStyleSheets(Document*, const Vector<CSSStyleSheet*>&, StyleShe
etsUpdateType); |
169 | 171 |
170 void collectPlatformFontsForRenderer(RenderText*, HashCountedSet<String>*); | 172 void collectPlatformFontsForRenderer(RenderText*, HashCountedSet<String>*); |
171 | 173 |
172 InspectorStyleSheet* bindStyleSheet(CSSStyleSheet*); | 174 InspectorStyleSheet* bindStyleSheet(CSSStyleSheet*); |
173 String unbindStyleSheet(InspectorStyleSheet*); | 175 String unbindStyleSheet(InspectorStyleSheet*); |
174 InspectorStyleSheet* viaInspectorStyleSheet(Document*, bool createIfAbsent); | 176 InspectorStyleSheet* viaInspectorStyleSheet(Document*, bool createIfAbsent); |
175 InspectorStyleSheet* assertInspectorStyleSheetForId(ErrorString*, const Stri
ng&); | 177 InspectorStyleSheet* assertInspectorStyleSheetForId(ErrorString*, const Stri
ng&); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState; | 212 NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState; |
211 | 213 |
212 RefPtrWillBePersistent<CSSStyleSheet> m_inspectorUserAgentStyleSheet; | 214 RefPtrWillBePersistent<CSSStyleSheet> m_inspectorUserAgentStyleSheet; |
213 | 215 |
214 int m_lastStyleSheetId; | 216 int m_lastStyleSheetId; |
215 int m_styleSheetsPendingMutation; | 217 int m_styleSheetsPendingMutation; |
216 bool m_styleDeclarationPendingMutation; | 218 bool m_styleDeclarationPendingMutation; |
217 bool m_creatingViaInspectorStyleSheet; | 219 bool m_creatingViaInspectorStyleSheet; |
218 bool m_isSettingStyleSheetText; | 220 bool m_isSettingStyleSheetText; |
219 | 221 |
220 friend class EnableResourceClient; | 222 friend class InspectorResourceContentLoaderCallback; |
221 friend class StyleSheetBinder; | 223 friend class StyleSheetBinder; |
222 }; | 224 }; |
223 | 225 |
224 | 226 |
225 } // namespace WebCore | 227 } // namespace WebCore |
226 | 228 |
227 #endif // !defined(InspectorCSSAgent_h) | 229 #endif // !defined(InspectorCSSAgent_h) |
OLD | NEW |