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

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

Issue 16745003: DevTools: Move CSS.CSSMedia construction into InspectorCSSAgent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make InspectorPageAgent getter a const one Created 7 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 class CSSRuleList; 47 class CSSRuleList;
48 class CSSStyleDeclaration; 48 class CSSStyleDeclaration;
49 class CSSStyleRule; 49 class CSSStyleRule;
50 class CSSStyleSheet; 50 class CSSStyleSheet;
51 class Document; 51 class Document;
52 class DocumentStyleSheetCollection; 52 class DocumentStyleSheetCollection;
53 class Element; 53 class Element;
54 class InspectorCSSOMWrappers; 54 class InspectorCSSOMWrappers;
55 class InspectorFrontend; 55 class InspectorFrontend;
56 class InstrumentingAgents; 56 class InstrumentingAgents;
57 class MediaList;
57 class NameNodeMap; 58 class NameNodeMap;
58 class Node; 59 class Node;
59 class NodeList; 60 class NodeList;
60 class SelectorProfile; 61 class SelectorProfile;
61 class StyleResolver; 62 class StyleResolver;
62 class StyleRule; 63 class StyleRule;
63 class StyleSheetVisitor; 64 class StyleSheetVisitor;
64 class UpdateRegionLayoutTask; 65 class UpdateRegionLayoutTask;
65 66
66 typedef HashMap<CSSStyleSheet*, RefPtr<InspectorStyleSheet> > CSSStyleSheetToIns pectorStyleSheet; 67 typedef HashMap<CSSStyleSheet*, RefPtr<InspectorStyleSheet> > CSSStyleSheetToIns pectorStyleSheet;
67 68
68 class InspectorCSSAgent 69 class InspectorCSSAgent
69 : public InspectorBaseAgent<InspectorCSSAgent> 70 : public InspectorBaseAgent<InspectorCSSAgent>
70 , public InspectorDOMAgent::DOMListener 71 , public InspectorDOMAgent::DOMListener
71 , public InspectorBackendDispatcher::CSSCommandHandler 72 , public InspectorBackendDispatcher::CSSCommandHandler
72 , public InspectorStyleSheet::Listener { 73 , public InspectorStyleSheet::Listener {
73 WTF_MAKE_NONCOPYABLE(InspectorCSSAgent); 74 WTF_MAKE_NONCOPYABLE(InspectorCSSAgent);
74 public: 75 public:
76 enum MediaListSource {
77 MediaListSourceLinkedSheet,
78 MediaListSourceInlineSheet,
79 MediaListSourceMediaRule,
80 MediaListSourceImportRule
81 };
82
75 class InlineStyleOverrideScope { 83 class InlineStyleOverrideScope {
76 public: 84 public:
77 InlineStyleOverrideScope(SecurityContext* context) 85 InlineStyleOverrideScope(SecurityContext* context)
78 : m_contentSecurityPolicy(context->contentSecurityPolicy()) 86 : m_contentSecurityPolicy(context->contentSecurityPolicy())
79 { 87 {
80 m_contentSecurityPolicy->setOverrideAllowInlineStyle(true); 88 m_contentSecurityPolicy->setOverrideAllowInlineStyle(true);
81 } 89 }
82 90
83 ~InlineStyleOverrideScope() 91 ~InlineStyleOverrideScope()
84 { 92 {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 virtual void toggleProperty(ErrorString*, const RefPtr<InspectorObject>& sty leId, int propertyIndex, bool disable, RefPtr<TypeBuilder::CSS::CSSStyle>& resul t); 135 virtual void toggleProperty(ErrorString*, const RefPtr<InspectorObject>& sty leId, int propertyIndex, bool disable, RefPtr<TypeBuilder::CSS::CSSStyle>& resul t);
128 virtual void setRuleSelector(ErrorString*, const RefPtr<InspectorObject>& ru leId, const String& selector, RefPtr<TypeBuilder::CSS::CSSRule>& result); 136 virtual void setRuleSelector(ErrorString*, const RefPtr<InspectorObject>& ru leId, const String& selector, RefPtr<TypeBuilder::CSS::CSSRule>& result);
129 virtual void addRule(ErrorString*, int contextNodeId, const String& selector , RefPtr<TypeBuilder::CSS::CSSRule>& result); 137 virtual void addRule(ErrorString*, int contextNodeId, const String& selector , RefPtr<TypeBuilder::CSS::CSSRule>& result);
130 virtual void getSupportedCSSProperties(ErrorString*, RefPtr<TypeBuilder::Arr ay<TypeBuilder::CSS::CSSPropertyInfo> >& result); 138 virtual void getSupportedCSSProperties(ErrorString*, RefPtr<TypeBuilder::Arr ay<TypeBuilder::CSS::CSSPropertyInfo> >& result);
131 virtual void forcePseudoState(ErrorString*, int nodeId, const RefPtr<Inspect orArray>& forcedPseudoClasses); 139 virtual void forcePseudoState(ErrorString*, int nodeId, const RefPtr<Inspect orArray>& forcedPseudoClasses);
132 virtual void getNamedFlowCollection(ErrorString*, int documentNodeId, RefPtr <TypeBuilder::Array<TypeBuilder::CSS::NamedFlow> >& result); 140 virtual void getNamedFlowCollection(ErrorString*, int documentNodeId, RefPtr <TypeBuilder::Array<TypeBuilder::CSS::NamedFlow> >& result);
133 141
134 virtual void startSelectorProfiler(ErrorString*); 142 virtual void startSelectorProfiler(ErrorString*);
135 virtual void stopSelectorProfiler(ErrorString*, RefPtr<TypeBuilder::CSS::Sel ectorProfile>&); 143 virtual void stopSelectorProfiler(ErrorString*, RefPtr<TypeBuilder::CSS::Sel ectorProfile>&);
136 144
145 InspectorPageAgent* pageAgent() const { return m_pageAgent; }
yurys 2013/06/13 14:48:35 As discussed offline please revert this part of th
137 PassRefPtr<TypeBuilder::CSS::SelectorProfile> stopSelectorProfilerImpl(Error String*, bool needProfile); 146 PassRefPtr<TypeBuilder::CSS::SelectorProfile> stopSelectorProfilerImpl(Error String*, bool needProfile);
138 void willMatchRule(StyleRule*, InspectorCSSOMWrappers&, DocumentStyleSheetCo llection*); 147 void willMatchRule(StyleRule*, InspectorCSSOMWrappers&, DocumentStyleSheetCo llection*);
139 void didMatchRule(bool); 148 void didMatchRule(bool);
140 void willProcessRule(StyleRule*, StyleResolver*); 149 void willProcessRule(StyleRule*, StyleResolver*);
141 void didProcessRule(); 150 void didProcessRule();
151 PassRefPtr<TypeBuilder::CSS::CSSMedia> buildMediaObject(const MediaList*, Me diaListSource, const String&);
152 void fillMediaListChain(CSSRule*, TypeBuilder::Array<TypeBuilder::CSS::CSSMe dia>*);
142 153
143 private: 154 private:
144 class StyleSheetAction; 155 class StyleSheetAction;
145 class SetStyleSheetTextAction; 156 class SetStyleSheetTextAction;
146 class SetStyleTextAction; 157 class SetStyleTextAction;
147 class SetPropertyTextAction; 158 class SetPropertyTextAction;
148 class TogglePropertyAction; 159 class TogglePropertyAction;
149 class SetRuleSelectorAction; 160 class SetRuleSelectorAction;
150 class AddRuleAction; 161 class AddRuleAction;
151 162
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 214
204 OwnPtr<SelectorProfile> m_currentSelectorProfile; 215 OwnPtr<SelectorProfile> m_currentSelectorProfile;
205 216
206 friend class StyleSheetBinder; 217 friend class StyleSheetBinder;
207 }; 218 };
208 219
209 220
210 } // namespace WebCore 221 } // namespace WebCore
211 222
212 #endif // !defined(InspectorCSSAgent_h) 223 #endif // !defined(InspectorCSSAgent_h)
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/InspectorCSSAgent.cpp » ('j') | Source/core/inspector/InspectorCSSAgent.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698