| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 class NodeList; | 60 class NodeList; |
| 61 class SelectorProfile; | 61 class SelectorProfile; |
| 62 class StyleResolver; | 62 class StyleResolver; |
| 63 class StyleRule; | 63 class StyleRule; |
| 64 class StyleSheetVisitor; | 64 class StyleSheetVisitor; |
| 65 class UpdateRegionLayoutTask; | 65 class UpdateRegionLayoutTask; |
| 66 | 66 |
| 67 typedef HashMap<CSSStyleSheet*, RefPtr<InspectorStyleSheet> > CSSStyleSheetToIns
pectorStyleSheet; | 67 typedef HashMap<CSSStyleSheet*, RefPtr<InspectorStyleSheet> > CSSStyleSheetToIns
pectorStyleSheet; |
| 68 | 68 |
| 69 class InspectorCSSAgent | 69 class InspectorCSSAgent |
| 70 : public InspectorBaseAgent<InspectorCSSAgent> | 70 : public InspectorBaseAgent |
| 71 , public InspectorDOMAgent::DOMListener | 71 , public InspectorDOMAgent::DOMListener |
| 72 , public InspectorBackendDispatcher::CSSCommandHandler | 72 , public InspectorBackendDispatcher::CSSCommandHandler |
| 73 , public InspectorStyleSheet::Listener { | 73 , public InspectorStyleSheet::Listener { |
| 74 WTF_MAKE_NONCOPYABLE(InspectorCSSAgent); | 74 WTF_MAKE_NONCOPYABLE(InspectorCSSAgent); |
| 75 public: | 75 public: |
| 76 enum MediaListSource { | 76 enum MediaListSource { |
| 77 MediaListSourceLinkedSheet, | 77 MediaListSourceLinkedSheet, |
| 78 MediaListSourceInlineSheet, | 78 MediaListSourceInlineSheet, |
| 79 MediaListSourceMediaRule, | 79 MediaListSourceMediaRule, |
| 80 MediaListSourceImportRule | 80 MediaListSourceImportRule |
| (...skipping 12 matching lines...) Expand all Loading... |
| 93 m_contentSecurityPolicy->setOverrideAllowInlineStyle(false); | 93 m_contentSecurityPolicy->setOverrideAllowInlineStyle(false); |
| 94 } | 94 } |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 ContentSecurityPolicy* m_contentSecurityPolicy; | 97 ContentSecurityPolicy* m_contentSecurityPolicy; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 static CSSStyleRule* asCSSStyleRule(CSSRule*); | 100 static CSSStyleRule* asCSSStyleRule(CSSRule*); |
| 101 static bool cssErrorFilter(const CSSParserString& content, int propertyId, i
nt errorType); | 101 static bool cssErrorFilter(const CSSParserString& content, int propertyId, i
nt errorType); |
| 102 | 102 |
| 103 static PassOwnPtr<InspectorCSSAgent> create(InstrumentingAgents* instrumenti
ngAgents, InspectorCompositeState* state, InspectorDOMAgent* domAgent, Inspector
PageAgent* pageAgent) | 103 static PassRefPtr<InspectorCSSAgent> create(InstrumentingAgents* instrumenti
ngAgents, InspectorState* state, PassRefPtr<InspectorDOMAgent> domAgent, PassRef
Ptr<InspectorPageAgent> pageAgent) |
| 104 { | 104 { |
| 105 return adoptPtr(new InspectorCSSAgent(instrumentingAgents, state, domAge
nt, pageAgent)); | 105 return adoptRef(new InspectorCSSAgent(instrumentingAgents, state, domAge
nt, pageAgent)); |
| 106 } | 106 } |
| 107 ~InspectorCSSAgent(); | 107 virtual ~InspectorCSSAgent(); |
| 108 | 108 |
| 109 bool forcePseudoState(Element*, CSSSelector::PseudoType); | 109 bool forcePseudoState(Element*, CSSSelector::PseudoType); |
| 110 virtual void setFrontend(InspectorFrontend*); | 110 virtual void setFrontend(InspectorFrontend*); |
| 111 virtual void clearFrontend(); | 111 virtual void clearFrontend(); |
| 112 virtual void discardAgent(); | 112 virtual void discardAgent(); |
| 113 virtual void restore(); | 113 virtual void restore(); |
| 114 virtual void enable(ErrorString*); | 114 virtual void enable(ErrorString*); |
| 115 virtual void disable(ErrorString*); | 115 virtual void disable(ErrorString*); |
| 116 void reset(); | 116 void reset(); |
| 117 void didCommitLoad(Frame*, DocumentLoader*); | 117 void didCommitLoad(Frame*, DocumentLoader*); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 152 |
| 153 private: | 153 private: |
| 154 class StyleSheetAction; | 154 class StyleSheetAction; |
| 155 class SetStyleSheetTextAction; | 155 class SetStyleSheetTextAction; |
| 156 class SetStyleTextAction; | 156 class SetStyleTextAction; |
| 157 class SetPropertyTextAction; | 157 class SetPropertyTextAction; |
| 158 class TogglePropertyAction; | 158 class TogglePropertyAction; |
| 159 class SetRuleSelectorAction; | 159 class SetRuleSelectorAction; |
| 160 class AddRuleAction; | 160 class AddRuleAction; |
| 161 | 161 |
| 162 InspectorCSSAgent(InstrumentingAgents*, InspectorCompositeState*, InspectorD
OMAgent*, InspectorPageAgent*); | 162 InspectorCSSAgent(InstrumentingAgents*, InspectorState*, PassRefPtr<Inspecto
rDOMAgent>, PassRefPtr<InspectorPageAgent>); |
| 163 | 163 |
| 164 typedef HashMap<String, RefPtr<InspectorStyleSheet> > IdToInspectorStyleShee
t; | 164 typedef HashMap<String, RefPtr<InspectorStyleSheet> > IdToInspectorStyleShee
t; |
| 165 typedef HashMap<Node*, RefPtr<InspectorStyleSheetForInlineStyle> > NodeToIns
pectorStyleSheet; // bogus "stylesheets" with elements' inline styles | 165 typedef HashMap<Node*, RefPtr<InspectorStyleSheetForInlineStyle> > NodeToIns
pectorStyleSheet; // bogus "stylesheets" with elements' inline styles |
| 166 typedef HashMap<RefPtr<Document>, RefPtr<InspectorStyleSheet> > DocumentToVi
aInspectorStyleSheet; // "via inspector" stylesheets | 166 typedef HashMap<RefPtr<Document>, RefPtr<InspectorStyleSheet> > DocumentToVi
aInspectorStyleSheet; // "via inspector" stylesheets |
| 167 typedef HashMap<int, unsigned> NodeIdToForcedPseudoState; | 167 typedef HashMap<int, unsigned> NodeIdToForcedPseudoState; |
| 168 | 168 |
| 169 void resetNonPersistentData(); | 169 void resetNonPersistentData(); |
| 170 InspectorStyleSheetForInlineStyle* asInspectorStyleSheet(Element* element); | 170 InspectorStyleSheetForInlineStyle* asInspectorStyleSheet(Element* element); |
| 171 Element* elementForId(ErrorString*, int nodeId); | 171 Element* elementForId(ErrorString*, int nodeId); |
| 172 int documentNodeWithRequestedFlowsId(Document*); | 172 int documentNodeWithRequestedFlowsId(Document*); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 190 virtual void didRemoveDocument(Document*); | 190 virtual void didRemoveDocument(Document*); |
| 191 virtual void didRemoveDOMNode(Node*); | 191 virtual void didRemoveDOMNode(Node*); |
| 192 virtual void didModifyDOMAttr(Element*); | 192 virtual void didModifyDOMAttr(Element*); |
| 193 | 193 |
| 194 // InspectorCSSAgent::Listener implementation | 194 // InspectorCSSAgent::Listener implementation |
| 195 virtual void styleSheetChanged(InspectorStyleSheet*); | 195 virtual void styleSheetChanged(InspectorStyleSheet*); |
| 196 | 196 |
| 197 void resetPseudoStates(); | 197 void resetPseudoStates(); |
| 198 | 198 |
| 199 InspectorFrontend::CSS* m_frontend; | 199 InspectorFrontend::CSS* m_frontend; |
| 200 InspectorDOMAgent* m_domAgent; | 200 RefPtr<InspectorDOMAgent> m_domAgent; |
| 201 InspectorPageAgent* m_pageAgent; | 201 RefPtr<InspectorPageAgent> m_pageAgent; |
| 202 | 202 |
| 203 IdToInspectorStyleSheet m_idToInspectorStyleSheet; | 203 IdToInspectorStyleSheet m_idToInspectorStyleSheet; |
| 204 CSSStyleSheetToInspectorStyleSheet m_cssStyleSheetToInspectorStyleSheet; | 204 CSSStyleSheetToInspectorStyleSheet m_cssStyleSheetToInspectorStyleSheet; |
| 205 NodeToInspectorStyleSheet m_nodeToInspectorStyleSheet; | 205 NodeToInspectorStyleSheet m_nodeToInspectorStyleSheet; |
| 206 DocumentToViaInspectorStyleSheet m_documentToInspectorStyleSheet; | 206 DocumentToViaInspectorStyleSheet m_documentToInspectorStyleSheet; |
| 207 NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState; | 207 NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState; |
| 208 HashSet<int> m_namedFlowCollectionsRequested; | 208 HashSet<int> m_namedFlowCollectionsRequested; |
| 209 OwnPtr<UpdateRegionLayoutTask> m_updateRegionLayoutTask; | 209 OwnPtr<UpdateRegionLayoutTask> m_updateRegionLayoutTask; |
| 210 | 210 |
| 211 int m_lastStyleSheetId; | 211 int m_lastStyleSheetId; |
| 212 bool m_creatingViaInspectorStyleSheet; | 212 bool m_creatingViaInspectorStyleSheet; |
| 213 | 213 |
| 214 OwnPtr<SelectorProfile> m_currentSelectorProfile; | 214 OwnPtr<SelectorProfile> m_currentSelectorProfile; |
| 215 | 215 |
| 216 friend class StyleSheetBinder; | 216 friend class StyleSheetBinder; |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 class InspectorCSSFactory : public InspectorBaseFactory<InspectorCSSFactory, Ins
pectorCSSAgent> { |
| 220 public: |
| 221 |
| 222 static PassOwnPtr<InspectorCSSFactory> create(InstrumentingAgents* instrumen
tingAgents, InspectorCompositeState* compositeState, InspectorDOMFactory* domFac
tory, InspectorPageFactory* pageFactory) |
| 223 { |
| 224 return adoptPtr(new InspectorCSSFactory(instrumentingAgents, compositeSt
ate, domFactory, pageFactory)); |
| 225 } |
| 226 |
| 227 protected: |
| 228 InspectorCSSFactory(InstrumentingAgents*, InspectorCompositeState*, Inspecto
rDOMFactory*, InspectorPageFactory*); |
| 229 }; |
| 219 | 230 |
| 220 } // namespace WebCore | 231 } // namespace WebCore |
| 221 | 232 |
| 222 #endif // !defined(InspectorCSSAgent_h) | 233 #endif // !defined(InspectorCSSAgent_h) |
| OLD | NEW |