OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_TEST_CHROMEDRIVER_DOM_TRACKER_H_ | 5 #ifndef CHROME_TEST_CHROMEDRIVER_DEVTOOLS_STATE_H_ |
6 #define CHROME_TEST_CHROMEDRIVER_DOM_TRACKER_H_ | 6 #define CHROME_TEST_CHROMEDRIVER_DEVTOOLS_STATE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "chrome/test/chromedriver/devtools_event_listener.h" | 13 #include "chrome/test/chromedriver/devtools_event_listener.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class DictionaryValue; | 16 class DictionaryValue; |
17 class Value; | |
18 } | 17 } |
19 | 18 |
| 19 class DevToolsClient; |
20 class Status; | 20 class Status; |
21 | 21 |
22 // Tracks the state of the DOM and execution context creation. | 22 // Tracks the state of the DOM and execution context creation. |
23 class DomTracker : public DevToolsEventListener { | 23 class DevToolsState : public DevToolsEventListener { |
24 public: | 24 public: |
25 DomTracker(); | 25 explicit DevToolsState(DevToolsClient* client); |
26 virtual ~DomTracker(); | 26 virtual ~DevToolsState(); |
27 | 27 |
28 Status GetFrameIdForNode(int node_id, std::string* frame_id); | 28 Status Init(); |
29 | 29 |
30 // Overridden from DevToolsEventListener: | 30 // Overridden from DevToolsEventListener: |
31 virtual void OnEvent(const std::string& method, | 31 virtual void OnEvent(const std::string& method, |
32 const base::DictionaryValue& params) OVERRIDE; | 32 const base::DictionaryValue& params) OVERRIDE; |
33 | 33 |
34 private: | 34 private: |
35 bool ProcessNodeList(const base::Value* nodes); | 35 DevToolsClient* client_; |
36 bool ProcessNode(const base::Value* node); | 36 DISALLOW_COPY_AND_ASSIGN(DevToolsState); |
37 | |
38 std::map<int, std::string> node_to_frame_map_; | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(DomTracker); | |
41 }; | 37 }; |
42 | 38 |
43 #endif // CHROME_TEST_CHROMEDRIVER_DOM_TRACKER_H_ | 39 #endif // CHROME_TEST_CHROMEDRIVER_DEVTOOLS_STATE_H_ |
OLD | NEW |