OLD | NEW |
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 CHROME_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ |
6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ | 6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "chrome/browser/debugger/devtools_client_host.h" | 10 #include "chrome/browser/debugger/devtools_client_host.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // DevToolsClientHost. | 60 // DevToolsClientHost. |
61 virtual void ClientHostClosing(DevToolsClientHost* host); | 61 virtual void ClientHostClosing(DevToolsClientHost* host); |
62 | 62 |
63 // Returns RenderViewHost for the tab that is inspected by devtools | 63 // Returns RenderViewHost for the tab that is inspected by devtools |
64 // client hosted by DevToolsClientHost. | 64 // client hosted by DevToolsClientHost. |
65 RenderViewHost* GetInspectedRenderViewHost(DevToolsClientHost* client_host); | 65 RenderViewHost* GetInspectedRenderViewHost(DevToolsClientHost* client_host); |
66 | 66 |
67 void SendAttachToAgent(RenderViewHost* inspected_rvh); | 67 void SendAttachToAgent(RenderViewHost* inspected_rvh); |
68 void SendDetachToAgent(RenderViewHost* inspected_rvh); | 68 void SendDetachToAgent(RenderViewHost* inspected_rvh); |
69 | 69 |
| 70 void EnableDevToolsInPrefs(RenderViewHost* inspected_rvh); |
| 71 |
70 // These two maps are for tracking dependencies between inspected tabs and | 72 // These two maps are for tracking dependencies between inspected tabs and |
71 // their DevToolsClientHosts. They are usful for routing devtools messages | 73 // their DevToolsClientHosts. They are usful for routing devtools messages |
72 // and allow us to have at most one devtools client host per tab. We use | 74 // and allow us to have at most one devtools client host per tab. We use |
73 // NavigationController* as key because it survives crosee-site navigation in | 75 // NavigationController* as key because it survives crosee-site navigation in |
74 // cases when tab contents may change. | 76 // cases when tab contents may change. |
75 // | 77 // |
76 // DevToolsManager start listening to DevToolsClientHosts when they are put | 78 // DevToolsManager start listening to DevToolsClientHosts when they are put |
77 // into these maps and removes them when they are closing. | 79 // into these maps and removes them when they are closing. |
78 typedef std::map<RenderViewHost*, DevToolsClientHost*> | 80 typedef std::map<RenderViewHost*, DevToolsClientHost*> |
79 InspectedRvhToClientHostMap; | 81 InspectedRvhToClientHostMap; |
80 InspectedRvhToClientHostMap inspected_rvh_to_client_host_; | 82 InspectedRvhToClientHostMap inspected_rvh_to_client_host_; |
81 | 83 |
82 typedef std::map<DevToolsClientHost*, RenderViewHost*> | 84 typedef std::map<DevToolsClientHost*, RenderViewHost*> |
83 ClientHostToInspectedRvhMap; | 85 ClientHostToInspectedRvhMap; |
84 ClientHostToInspectedRvhMap client_host_to_inspected_rvh_; | 86 ClientHostToInspectedRvhMap client_host_to_inspected_rvh_; |
85 | 87 |
86 DISALLOW_COPY_AND_ASSIGN(DevToolsManager); | 88 DISALLOW_COPY_AND_ASSIGN(DevToolsManager); |
87 }; | 89 }; |
88 | 90 |
89 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ | 91 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ |
OLD | NEW |