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

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

Issue 14320027: DevTools: Track CSSStyleSheetHeaders in the front-end real time (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 }; 176 };
177 177
178 typedef HashMap<CSSStyleDeclaration*, RefPtr<InspectorStyle> > InspectorStyl eMap; 178 typedef HashMap<CSSStyleDeclaration*, RefPtr<InspectorStyle> > InspectorStyl eMap;
179 static PassRefPtr<InspectorStyleSheet> create(InspectorPageAgent*, const Str ing& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetO rigin::Enum, const String& documentURL, Listener*); 179 static PassRefPtr<InspectorStyleSheet> create(InspectorPageAgent*, const Str ing& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetO rigin::Enum, const String& documentURL, Listener*);
180 static String styleSheetURL(CSSStyleSheet* pageStyleSheet); 180 static String styleSheetURL(CSSStyleSheet* pageStyleSheet);
181 181
182 virtual ~InspectorStyleSheet(); 182 virtual ~InspectorStyleSheet();
183 183
184 String id() const { return m_id; } 184 String id() const { return m_id; }
185 String finalURL() const; 185 String finalURL() const;
186 bool canBind() const { return m_origin != TypeBuilder::CSS::StyleSheetOrigin ::User_agent && m_origin != TypeBuilder::CSS::StyleSheetOrigin::User; }
186 CSSStyleSheet* pageStyleSheet() const { return m_pageStyleSheet.get(); } 187 CSSStyleSheet* pageStyleSheet() const { return m_pageStyleSheet.get(); }
187 void reparseStyleSheet(const String&); 188 void reparseStyleSheet(const String&);
188 bool setText(const String&, ExceptionCode&); 189 bool setText(const String&, ExceptionCode&);
189 String ruleSelector(const InspectorCSSId&, ExceptionCode&); 190 String ruleSelector(const InspectorCSSId&, ExceptionCode&);
190 bool setRuleSelector(const InspectorCSSId&, const String& selector, Exceptio nCode&); 191 bool setRuleSelector(const InspectorCSSId&, const String& selector, Exceptio nCode&);
191 CSSStyleRule* addRule(const String& selector, ExceptionCode&); 192 CSSStyleRule* addRule(const String& selector, ExceptionCode&);
192 bool deleteRule(const InspectorCSSId&, ExceptionCode&); 193 bool deleteRule(const InspectorCSSId&, ExceptionCode&);
193 CSSStyleRule* ruleForId(const InspectorCSSId&) const; 194 CSSStyleRule* ruleForId(const InspectorCSSId&) const;
194 PassRefPtr<TypeBuilder::CSS::CSSStyleSheetBody> buildObjectForStyleSheet(); 195 PassRefPtr<TypeBuilder::CSS::CSSStyleSheetBody> buildObjectForStyleSheet();
195 PassRefPtr<TypeBuilder::CSS::CSSStyleSheetHeader> buildObjectForStyleSheetIn fo(); 196 PassRefPtr<TypeBuilder::CSS::CSSStyleSheetHeader> buildObjectForStyleSheetIn fo();
196 PassRefPtr<TypeBuilder::CSS::CSSRule> buildObjectForRule(CSSStyleRule*); 197 PassRefPtr<TypeBuilder::CSS::CSSRule> buildObjectForRule(CSSStyleRule*);
197 PassRefPtr<TypeBuilder::CSS::CSSStyle> buildObjectForStyle(CSSStyleDeclarati on*); 198 PassRefPtr<TypeBuilder::CSS::CSSStyle> buildObjectForStyle(CSSStyleDeclarati on*);
198 bool setStyleText(const InspectorCSSId&, const String& text, String* oldText , ExceptionCode&); 199 bool setStyleText(const InspectorCSSId&, const String& text, String* oldText , ExceptionCode&);
199 bool setPropertyText(const InspectorCSSId&, unsigned propertyIndex, const St ring& text, bool overwrite, String* oldPropertyText, ExceptionCode&); 200 bool setPropertyText(const InspectorCSSId&, unsigned propertyIndex, const St ring& text, bool overwrite, String* oldPropertyText, ExceptionCode&);
200 bool toggleProperty(const InspectorCSSId&, unsigned propertyIndex, bool disa ble, ExceptionCode&); 201 bool toggleProperty(const InspectorCSSId&, unsigned propertyIndex, bool disa ble, ExceptionCode&);
201 202
202 virtual bool getText(String* result) const; 203 virtual bool getText(String* result) const;
203 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId&) const; 204 virtual CSSStyleDeclaration* styleForId(const InspectorCSSId&) const;
204 void fireStyleSheetChanged(); 205 void fireStyleSheetChanged();
205 206
206 InspectorCSSId ruleId(CSSStyleRule*) const; 207 InspectorCSSId ruleId(CSSStyleRule*) const;
207 InspectorCSSId styleId(CSSStyleDeclaration* style) const { return ruleOrStyl eId(style); } 208 InspectorCSSId styleId(CSSStyleDeclaration* style) const { return ruleOrStyl eId(style); }
208 209
209 protected: 210 protected:
210 InspectorStyleSheet(InspectorPageAgent*, const String& id, PassRefPtr<CSSSty leSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, Listener*); 211 InspectorStyleSheet(InspectorPageAgent*, const String& id, PassRefPtr<CSSSty leSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, Listener*);
211 212
212 bool canBind() const { return m_origin != TypeBuilder::CSS::StyleSheetOrigin ::User_agent && m_origin != TypeBuilder::CSS::StyleSheetOrigin::User; }
213 InspectorCSSId ruleOrStyleId(CSSStyleDeclaration* style) const; 213 InspectorCSSId ruleOrStyleId(CSSStyleDeclaration* style) const;
214 virtual Document* ownerDocument() const; 214 virtual Document* ownerDocument() const;
215 virtual RefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration* sty le) const; 215 virtual RefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration* sty le) const;
216 virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const; 216 virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const;
217 virtual bool ensureParsedDataReady(); 217 virtual bool ensureParsedDataReady();
218 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId& ); 218 virtual PassRefPtr<InspectorStyle> inspectorStyleForId(const InspectorCSSId& );
219 virtual void rememberInspectorStyle(RefPtr<InspectorStyle> inspectorStyle); 219 virtual void rememberInspectorStyle(RefPtr<InspectorStyle> inspectorStyle);
220 virtual void forgetInspectorStyle(CSSStyleDeclaration* style); 220 virtual void forgetInspectorStyle(CSSStyleDeclaration* style);
221 221
222 // Also accessed by friend class InspectorStyle. 222 // Also accessed by friend class InspectorStyle.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 // Contains "style" attribute value. 287 // Contains "style" attribute value.
288 mutable String m_styleText; 288 mutable String m_styleText;
289 mutable bool m_isStyleTextValid; 289 mutable bool m_isStyleTextValid;
290 }; 290 };
291 291
292 292
293 } // namespace WebCore 293 } // namespace WebCore
294 294
295 #endif // !defined(InspectorStyleSheet_h) 295 #endif // !defined(InspectorStyleSheet_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698