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

Side by Side Diff: webkit/glue/devtools/dom_agent_impl.h

Issue 60047: DevTools: Add support for r/o CSS inspection. Original review CL by serya : h... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « webkit/glue/devtools/dom_agent.h ('k') | webkit/glue/devtools/dom_agent_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WEBKIT_GLUE_DEVTOOLS_DOM_AGENT_IMPL_H_ 5 #ifndef WEBKIT_GLUE_DEVTOOLS_DOM_AGENT_IMPL_H_
6 #define WEBKIT_GLUE_DEVTOOLS_DOM_AGENT_IMPL_H_ 6 #define WEBKIT_GLUE_DEVTOOLS_DOM_AGENT_IMPL_H_
7 7
8 #include "config.h" 8 #include "config.h"
9 9
10 #include <wtf/ListHashSet.h> 10 #include <wtf/ListHashSet.h>
11 #include <wtf/HashMap.h> 11 #include <wtf/HashMap.h>
12 #include <wtf/HashSet.h> 12 #include <wtf/HashSet.h>
13 #include <wtf/PassRefPtr.h> 13 #include <wtf/PassRefPtr.h>
14 #include <wtf/RefPtr.h> 14 #include <wtf/RefPtr.h>
15 15
16 #include "webkit/glue/devtools/dom_agent.h" 16 #include "webkit/glue/devtools/dom_agent.h"
17 17
18 namespace WebCore { 18 namespace WebCore {
19 class CSSRuleList;
19 class Document; 20 class Document;
20 class Element; 21 class Element;
21 class Event; 22 class Event;
23 class NameNodeMap;
22 class Node; 24 class Node;
23 } 25 }
24 26
27 class DictionaryValue;
25 class ListValue; 28 class ListValue;
26 class Value; 29 class Value;
27 30
28 // DomAgent implementation. 31 // DomAgent implementation.
29 class DomAgentImpl : public DomAgent { 32 class DomAgentImpl : public DomAgent {
30 public: 33 public:
31 explicit DomAgentImpl(DomAgentDelegate* delegate); 34 explicit DomAgentImpl(DomAgentDelegate* delegate);
32 virtual ~DomAgentImpl(); 35 virtual ~DomAgentImpl();
33 36
34 // DomAgent implementation. 37 // DomAgent implementation.
35 void GetDocumentElement(); 38 void GetDocumentElement();
36 void GetChildNodes(int call_id, int element_id); 39 void GetChildNodes(int call_id, int element_id);
37 void SetAttribute( 40 void SetAttribute(
38 int call_id, 41 int call_id,
39 int element_id, 42 int element_id,
40 const WebCore::String& name, 43 const WebCore::String& name,
41 const WebCore::String& value); 44 const WebCore::String& value);
42 void RemoveAttribute( 45 void RemoveAttribute(
43 int call_id, 46 int call_id,
44 int element_id, 47 int element_id,
45 const WebCore::String& name); 48 const WebCore::String& name);
46 void SetTextNodeValue( 49 void SetTextNodeValue(
47 int call_id, 50 int call_id,
48 int element_id, 51 int element_id,
49 const WebCore::String& value); 52 const WebCore::String& value);
50 void PerformSearch(int call_id, const String& query); 53 void PerformSearch(int call_id, const String& query);
54 void GetNodeStyles(int call_id, int id, bool author_only);
51 void DiscardBindings(); 55 void DiscardBindings();
52 56
53 // Initializes dom agent with the given document. 57 // Initializes dom agent with the given document.
54 void SetDocument(WebCore::Document* document); 58 void SetDocument(WebCore::Document* document);
55 59
56 // Returns node for given id according to the present binding. 60 // Returns node for given id according to the present binding.
57 WebCore::Node* GetNodeForId(int id); 61 WebCore::Node* GetNodeForId(int id);
58 62
59 // Returns id for given node according to the present binding. 63 // Returns id for given node according to the present binding.
60 int GetIdForNode(WebCore::Node* node); 64 int GetIdForNode(WebCore::Node* node);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 WebCore::Element* element, 121 WebCore::Element* element,
118 int depth); 122 int depth);
119 123
120 // We represent embedded doms as a part of the same hierarchy. Hence we 124 // We represent embedded doms as a part of the same hierarchy. Hence we
121 // treat children of frame owners differently. Following two methods 125 // treat children of frame owners differently. Following two methods
122 // encapsulate frame owner specifics. 126 // encapsulate frame owner specifics.
123 WebCore::Node* InnerFirstChild(WebCore::Node* node); 127 WebCore::Node* InnerFirstChild(WebCore::Node* node);
124 int InnerChildNodeCount(WebCore::Node* node); 128 int InnerChildNodeCount(WebCore::Node* node);
125 WebCore::Element* InnerParentElement(WebCore::Node* node); 129 WebCore::Element* InnerParentElement(WebCore::Node* node);
126 130
131 // Helpers for GetNodeStyles
132 void BuildValueForCSSRules(WebCore::CSSRuleList& matched,
133 ListValue& descriptionList);
134 void BuildValueForAttributeStyles(const WebCore::NamedNodeMap& attributes,
135 DictionaryValue& description);
136
127 DomAgentDelegate* delegate_; 137 DomAgentDelegate* delegate_;
128 HashMap<WebCore::Node*, int> node_to_id_; 138 HashMap<WebCore::Node*, int> node_to_id_;
129 HashMap<int, WebCore::Node*> id_to_node_; 139 HashMap<int, WebCore::Node*> id_to_node_;
130 HashSet<int> children_requested_; 140 HashSet<int> children_requested_;
131 int last_node_id_; 141 int last_node_id_;
132 ListHashSet<RefPtr<WebCore::Document> > documents_; 142 ListHashSet<RefPtr<WebCore::Document> > documents_;
133 RefPtr<WebCore::EventListener> event_listener_; 143 RefPtr<WebCore::EventListener> event_listener_;
134 // Captures pending document element request's call id. 144 // Captures pending document element request's call id.
135 // Defaults to 0 meaning no pending request. 145 // Defaults to 0 meaning no pending request.
136 bool document_element_requested_; 146 bool document_element_requested_;
137 147
138 DISALLOW_COPY_AND_ASSIGN(DomAgentImpl); 148 DISALLOW_COPY_AND_ASSIGN(DomAgentImpl);
139 }; 149 };
140 150
141 #endif // WEBKIT_GLUE_DEVTOOLS_DOM_AGENT_IMPL_H_ 151 #endif // WEBKIT_GLUE_DEVTOOLS_DOM_AGENT_IMPL_H_
OLDNEW
« no previous file with comments | « webkit/glue/devtools/dom_agent.h ('k') | webkit/glue/devtools/dom_agent_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698