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

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

Issue 1181213007: DevTools: introduce CSS.setStyleText, we'll migrate setPropertyText to it later. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: win fixed 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 /* 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 void enable(ErrorString*, PassRefPtrWillBeRawPtr<EnableCallback>) override; 130 void enable(ErrorString*, PassRefPtrWillBeRawPtr<EnableCallback>) override;
131 virtual void getComputedStyleForNode(ErrorString*, int nodeId, RefPtr<TypeBu ilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >&) override; 131 virtual void getComputedStyleForNode(ErrorString*, int nodeId, RefPtr<TypeBu ilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> >&) override;
132 virtual void getPlatformFontsForNode(ErrorString*, int nodeId, String* cssFa milyName, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::PlatformFontUsage> >&) ove rride; 132 virtual void getPlatformFontsForNode(ErrorString*, int nodeId, String* cssFa milyName, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::PlatformFontUsage> >&) ove rride;
133 virtual void getInlineStylesForNode(ErrorString*, int nodeId, RefPtr<TypeBui lder::CSS::CSSStyle>& inlineStyle, RefPtr<TypeBuilder::CSS::CSSStyle>& attribute s) override; 133 virtual void getInlineStylesForNode(ErrorString*, int nodeId, RefPtr<TypeBui lder::CSS::CSSStyle>& inlineStyle, RefPtr<TypeBuilder::CSS::CSSStyle>& attribute s) override;
134 virtual void getMatchedStylesForNode(ErrorString*, int nodeId, const bool* e xcludePseudo, const bool* excludeInherited, RefPtr<TypeBuilder::Array<TypeBuilde r::CSS::RuleMatch> >& matchedCSSRules, RefPtr<TypeBuilder::Array<TypeBuilder::CS S::PseudoIdMatches> >&, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::InheritedSty leEntry> >& inheritedEntries) override; 134 virtual void getMatchedStylesForNode(ErrorString*, int nodeId, const bool* e xcludePseudo, const bool* excludeInherited, RefPtr<TypeBuilder::Array<TypeBuilde r::CSS::RuleMatch> >& matchedCSSRules, RefPtr<TypeBuilder::Array<TypeBuilder::CS S::PseudoIdMatches> >&, RefPtr<TypeBuilder::Array<TypeBuilder::CSS::InheritedSty leEntry> >& inheritedEntries) override;
135 virtual void getStyleSheetText(ErrorString*, const String& styleSheetId, Str ing* result) override; 135 virtual void getStyleSheetText(ErrorString*, const String& styleSheetId, Str ing* result) override;
136 virtual void setStyleSheetText(ErrorString*, const String& styleSheetId, con st String& text) override; 136 virtual void setStyleSheetText(ErrorString*, const String& styleSheetId, con st String& text) override;
137 virtual void setPropertyText(ErrorString*, const String& styleSheetId, const RefPtr<JSONObject>& range, const String& text, RefPtr<TypeBuilder::CSS::CSSStyl e>& result) override; 137 virtual void setPropertyText(ErrorString*, const String& styleSheetId, const RefPtr<JSONObject>& range, const String& text, RefPtr<TypeBuilder::CSS::CSSStyl e>& result) override;
138 virtual void setRuleSelector(ErrorString*, const String& styleSheetId, const RefPtr<JSONObject>& range, const String& selector, RefPtr<TypeBuilder::CSS::CSS Rule>& result) override; 138 virtual void setRuleSelector(ErrorString*, const String& styleSheetId, const RefPtr<JSONObject>& range, const String& selector, RefPtr<TypeBuilder::CSS::CSS Rule>& result) override;
139 virtual void setStyleText(ErrorString*, const String& styleSheetId, const Re fPtr<JSONObject>& range, const String& text, RefPtr<TypeBuilder::CSS::CSSStyle>& result) override;
139 virtual void setMediaText(ErrorString*, const String& styleSheetId, const Re fPtr<JSONObject>& range, const String& text, RefPtr<TypeBuilder::CSS::CSSMedia>& result) override; 140 virtual void setMediaText(ErrorString*, const String& styleSheetId, const Re fPtr<JSONObject>& range, const String& text, RefPtr<TypeBuilder::CSS::CSSMedia>& result) override;
140 virtual void createStyleSheet(ErrorString*, const String& frameId, TypeBuild er::CSS::StyleSheetId* outStyleSheetId) override; 141 virtual void createStyleSheet(ErrorString*, const String& frameId, TypeBuild er::CSS::StyleSheetId* outStyleSheetId) override;
141 virtual void addRule(ErrorString*, const String& styleSheetId, const String& ruleText, const RefPtr<JSONObject>& location, RefPtr<TypeBuilder::CSS::CSSRule> & result) override; 142 virtual void addRule(ErrorString*, const String& styleSheetId, const String& ruleText, const RefPtr<JSONObject>& location, RefPtr<TypeBuilder::CSS::CSSRule> & result) override;
142 virtual void forcePseudoState(ErrorString*, int nodeId, const RefPtr<JSONArr ay>& forcedPseudoClasses) override; 143 virtual void forcePseudoState(ErrorString*, int nodeId, const RefPtr<JSONArr ay>& forcedPseudoClasses) override;
143 virtual void getMediaQueries(ErrorString*, RefPtr<TypeBuilder::Array<TypeBui lder::CSS::CSSMedia> >& medias) override; 144 virtual void getMediaQueries(ErrorString*, RefPtr<TypeBuilder::Array<TypeBui lder::CSS::CSSMedia> >& medias) override;
144 bool collectMediaQueriesFromRule(CSSRule*, TypeBuilder::Array<TypeBuilder::C SS::CSSMedia>* mediaArray); 145 bool collectMediaQueriesFromRule(CSSRule*, TypeBuilder::Array<TypeBuilder::C SS::CSSMedia>* mediaArray);
145 bool collectMediaQueriesFromStyleSheet(CSSStyleSheet*, TypeBuilder::Array<Ty peBuilder::CSS::CSSMedia>* mediaArray); 146 bool collectMediaQueriesFromStyleSheet(CSSStyleSheet*, TypeBuilder::Array<Ty peBuilder::CSS::CSSMedia>* mediaArray);
146 PassRefPtr<TypeBuilder::CSS::CSSMedia> buildMediaObject(const MediaList*, Me diaListSource, const String&, CSSStyleSheet*); 147 PassRefPtr<TypeBuilder::CSS::CSSMedia> buildMediaObject(const MediaList*, Me diaListSource, const String&, CSSStyleSheet*);
147 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSMedia> > buildMediaListCh ain(CSSRule*); 148 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSMedia> > buildMediaListCh ain(CSSRule*);
148 149
149 private: 150 private:
150 class StyleSheetAction; 151 class StyleSheetAction;
151 class SetStyleSheetTextAction; 152 class SetStyleSheetTextAction;
152 class SetPropertyTextAction; 153 class SetPropertyTextAction;
153 class SetRuleSelectorOrMediaAction; 154 class ModifyRuleAction;
155 class SetElementStyleAction;
154 class AddRuleAction; 156 class AddRuleAction;
155 class InspectorResourceContentLoaderCallback; 157 class InspectorResourceContentLoaderCallback;
156 158
157 static void collectStyleSheets(CSSStyleSheet*, WillBeHeapVector<RawPtrWillBe Member<CSSStyleSheet> >&); 159 static void collectStyleSheets(CSSStyleSheet*, WillBeHeapVector<RawPtrWillBe Member<CSSStyleSheet> >&);
158 160
159 InspectorCSSAgent(InspectorDOMAgent*, InspectorPageAgent*, InspectorResource Agent*); 161 InspectorCSSAgent(InspectorDOMAgent*, InspectorPageAgent*, InspectorResource Agent*);
160 162
161 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<InspectorStyleSheet> > IdToInspectorStyleSheet; 163 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<InspectorStyleSheet> > IdToInspectorStyleSheet;
162 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<InspectorStyleSheetForI nlineStyle> > IdToInspectorStyleSheetForInlineStyle; 164 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<InspectorStyleSheetForI nlineStyle> > IdToInspectorStyleSheetForInlineStyle;
163 typedef WillBeHeapHashMap<RawPtrWillBeMember<Node>, RefPtrWillBeMember<Inspe ctorStyleSheetForInlineStyle> > NodeToInspectorStyleSheet; // bogus "stylesheets " with elements' inline styles 165 typedef WillBeHeapHashMap<RawPtrWillBeMember<Node>, RefPtrWillBeMember<Inspe ctorStyleSheetForInlineStyle> > NodeToInspectorStyleSheet; // bogus "stylesheets " with elements' inline styles
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 bool m_isSettingStyleSheetText; 225 bool m_isSettingStyleSheetText;
224 226
225 friend class InspectorResourceContentLoaderCallback; 227 friend class InspectorResourceContentLoaderCallback;
226 friend class StyleSheetBinder; 228 friend class StyleSheetBinder;
227 }; 229 };
228 230
229 231
230 } // namespace blink 232 } // namespace blink
231 233
232 #endif // !defined(InspectorCSSAgent_h) 234 #endif // !defined(InspectorCSSAgent_h)
OLDNEW
« no previous file with comments | « LayoutTests/inspector-protocol/css/resources/set-style-text.css ('k') | Source/core/inspector/InspectorCSSAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698