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

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

Issue 445023005: DevTools: reduce ResourceAgent dependency on PageAgent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
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 28 matching lines...) Expand all
39 39
40 class ParsedStyleSheet; 40 class ParsedStyleSheet;
41 41
42 namespace blink { 42 namespace blink {
43 43
44 class CSSRuleList; 44 class CSSRuleList;
45 class CSSStyleDeclaration; 45 class CSSStyleDeclaration;
46 class CSSStyleRule; 46 class CSSStyleRule;
47 class CSSStyleSheet; 47 class CSSStyleSheet;
48 class Document; 48 class Document;
49 class EditedResourcesContentManager;
49 class Element; 50 class Element;
50 class ExceptionState; 51 class ExceptionState;
51 class InspectorPageAgent; 52 class InspectorPageAgent;
52 class InspectorResourceAgent; 53 class InspectorResourceAgent;
53 class InspectorStyleSheetBase; 54 class InspectorStyleSheetBase;
54 55
55 typedef WillBeHeapVector<RefPtrWillBeMember<CSSRule> > CSSRuleVector; 56 typedef WillBeHeapVector<RefPtrWillBeMember<CSSRule> > CSSRuleVector;
56 typedef String ErrorString; 57 typedef String ErrorString;
57 58
58 class InspectorCSSId { 59 class InspectorCSSId {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 189
189 private: 190 private:
190 friend class InspectorStyle; 191 friend class InspectorStyle;
191 192
192 String m_id; 193 String m_id;
193 Listener* m_listener; 194 Listener* m_listener;
194 }; 195 };
195 196
196 class InspectorStyleSheet : public InspectorStyleSheetBase { 197 class InspectorStyleSheet : public InspectorStyleSheetBase {
197 public: 198 public:
198 static PassRefPtrWillBeRawPtr<InspectorStyleSheet> create(InspectorPageAgent *, InspectorResourceAgent*, const String& id, PassRefPtrWillBeRawPtr<CSSStyleShe et> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& docu mentURL, Listener*); 199 static PassRefPtrWillBeRawPtr<InspectorStyleSheet> create(InspectorPageAgent *, InspectorResourceAgent*, EditedResourcesContentManager*, const String& id, Pa ssRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheet Origin::Enum, const String& documentURL, Listener*);
199 200
200 virtual ~InspectorStyleSheet(); 201 virtual ~InspectorStyleSheet();
201 virtual void trace(Visitor*) OVERRIDE; 202 virtual void trace(Visitor*) OVERRIDE;
202 203
203 String finalURL() const; 204 String finalURL() const;
204 virtual Document* ownerDocument() const OVERRIDE; 205 virtual Document* ownerDocument() const OVERRIDE;
205 virtual bool setText(const String&, ExceptionState&) OVERRIDE; 206 virtual bool setText(const String&, ExceptionState&) OVERRIDE;
206 virtual bool getText(String* result) const OVERRIDE; 207 virtual bool getText(String* result) const OVERRIDE;
207 String ruleSelector(const InspectorCSSId&, ExceptionState&); 208 String ruleSelector(const InspectorCSSId&, ExceptionState&);
208 bool setRuleSelector(const InspectorCSSId&, const String& selector, Exceptio nState&); 209 bool setRuleSelector(const InspectorCSSId&, const String& selector, Exceptio nState&);
(...skipping 20 matching lines...) Expand all
229 230
230 protected: 231 protected:
231 virtual PassRefPtrWillBeRawPtr<InspectorStyle> inspectorStyleForId(const Ins pectorCSSId&) OVERRIDE; 232 virtual PassRefPtrWillBeRawPtr<InspectorStyle> inspectorStyleForId(const Ins pectorCSSId&) OVERRIDE;
232 virtual unsigned ruleCount() OVERRIDE; 233 virtual unsigned ruleCount() OVERRIDE;
233 234
234 // Also accessed by friend class InspectorStyle. 235 // Also accessed by friend class InspectorStyle.
235 virtual PassRefPtrWillBeRawPtr<CSSRuleSourceData> ruleSourceDataAt(unsigned) const OVERRIDE; 236 virtual PassRefPtrWillBeRawPtr<CSSRuleSourceData> ruleSourceDataAt(unsigned) const OVERRIDE;
236 virtual bool ensureParsedDataReady() OVERRIDE; 237 virtual bool ensureParsedDataReady() OVERRIDE;
237 238
238 private: 239 private:
239 InspectorStyleSheet(InspectorPageAgent*, InspectorResourceAgent*, const Stri ng& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS:: StyleSheetOrigin::Enum, const String& documentURL, Listener*); 240 InspectorStyleSheet(InspectorPageAgent*, InspectorResourceAgent*, EditedReso urcesContentManager*, const String& id, PassRefPtrWillBeRawPtr<CSSStyleSheet> pa geStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentUR L, Listener*);
240 241
241 unsigned ruleIndexByStyle(CSSStyleDeclaration*) const; 242 unsigned ruleIndexByStyle(CSSStyleDeclaration*) const;
242 String sourceMapURL() const; 243 String sourceMapURL() const;
243 String sourceURL() const; 244 String sourceURL() const;
244 bool ensureText() const; 245 bool ensureText() const;
245 void ensureFlatRules() const; 246 void ensureFlatRules() const;
246 bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newS tyleText, String* result); 247 bool styleSheetTextWithChangedStyle(CSSStyleDeclaration*, const String& newS tyleText, String* result);
247 bool originalStyleSheetText(String* result) const; 248 bool originalStyleSheetText(String* result) const;
248 bool resourceStyleSheetText(String* result) const; 249 bool resourceStyleSheetText(String* result) const;
249 bool inlineStyleSheetText(String* result) const; 250 bool inlineStyleSheetText(String* result) const;
250 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectorsFromSou rce(const CSSRuleSourceData*, const String&); 251 PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::Selector> > selectorsFromSou rce(const CSSRuleSourceData*, const String&);
251 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty leRule*); 252 PassRefPtr<TypeBuilder::CSS::SelectorList> buildObjectForSelectorList(CSSSty leRule*);
252 String url() const; 253 String url() const;
253 bool hasSourceURL() const; 254 bool hasSourceURL() const;
254 bool startsAtZero() const; 255 bool startsAtZero() const;
255 256
256 void updateText(const String& newText); 257 void updateText(const String& newText);
257 Element* ownerStyleElement() const; 258 Element* ownerStyleElement() const;
258 259
259 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; 260 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent;
260 RawPtrWillBeMember<InspectorResourceAgent> m_resourceAgent; 261 RawPtrWillBeMember<InspectorResourceAgent> m_resourceAgent;
262 RawPtrWillBeMember<EditedResourcesContentManager> m_editedResourcesContentMa nager;
261 RefPtrWillBeMember<CSSStyleSheet> m_pageStyleSheet; 263 RefPtrWillBeMember<CSSStyleSheet> m_pageStyleSheet;
262 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin; 264 TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin;
263 String m_documentURL; 265 String m_documentURL;
264 OwnPtr<ParsedStyleSheet> m_parsedStyleSheet; 266 OwnPtr<ParsedStyleSheet> m_parsedStyleSheet;
265 mutable CSSRuleVector m_flatRules; 267 mutable CSSRuleVector m_flatRules;
266 mutable String m_sourceURL; 268 mutable String m_sourceURL;
267 }; 269 };
268 270
269 class InspectorStyleSheetForInlineStyle FINAL : public InspectorStyleSheetBase { 271 class InspectorStyleSheetForInlineStyle FINAL : public InspectorStyleSheetBase {
270 public: 272 public:
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 mutable String m_styleText; 305 mutable String m_styleText;
304 mutable bool m_isStyleTextValid; 306 mutable bool m_isStyleTextValid;
305 }; 307 };
306 308
307 309
308 } // namespace blink 310 } // namespace blink
309 311
310 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::InspectorStyleProperty); 312 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::InspectorStyleProperty);
311 313
312 #endif // !defined(InspectorStyleSheet_h) 314 #endif // !defined(InspectorStyleSheet_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698