OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ |
6 #define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ | 6 #define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 // Returns DevToolsClientHost registered for |inspected_rvh| or NULL if | 46 // Returns DevToolsClientHost registered for |inspected_rvh| or NULL if |
47 // there is no alive DevToolsClientHost registered for |inspected_rvh|. | 47 // there is no alive DevToolsClientHost registered for |inspected_rvh|. |
48 DevToolsClientHost* GetDevToolsClientHostFor(RenderViewHost* inspected_rvh); | 48 DevToolsClientHost* GetDevToolsClientHostFor(RenderViewHost* inspected_rvh); |
49 | 49 |
50 // Registers new DevToolsClientHost for |inspected_rvh|. There must be no | 50 // Registers new DevToolsClientHost for |inspected_rvh|. There must be no |
51 // other DevToolsClientHosts registered for the RenderViewHost at the moment. | 51 // other DevToolsClientHosts registered for the RenderViewHost at the moment. |
52 void RegisterDevToolsClientHostFor(RenderViewHost* inspected_rvh, | 52 void RegisterDevToolsClientHostFor(RenderViewHost* inspected_rvh, |
53 DevToolsClientHost* client_host); | 53 DevToolsClientHost* client_host); |
54 void UnregisterDevToolsClientHostFor(RenderViewHost* inspected_rvh); | 54 void UnregisterDevToolsClientHostFor(RenderViewHost* inspected_rvh); |
55 | 55 |
56 void ForwardToDevToolsAgent(RenderViewHost* client_rvh, | |
57 const IPC::Message& message); | |
58 void ForwardToDevToolsAgent(DevToolsClientHost* from, | 56 void ForwardToDevToolsAgent(DevToolsClientHost* from, |
59 const IPC::Message& message); | 57 const IPC::Message& message); |
60 void ForwardToDevToolsClient(RenderViewHost* inspected_rvh, | 58 void ForwardToDevToolsClient(RenderViewHost* inspected_rvh, |
61 const IPC::Message& message); | 59 const IPC::Message& message); |
62 | 60 |
63 void ActivateWindow(RenderViewHost* client_rvn); | 61 void CloseClient(DevToolsClientHost* client_host); |
pfeldman
2011/07/07 12:17:52
How does this correlate with NotifyCloseListener?
yurys
2011/07/07 12:30:39
Removed this method.
| |
64 void CloseWindow(RenderViewHost* client_rvn); | |
65 void RequestDockWindow(RenderViewHost* client_rvn); | |
66 void RequestUndockWindow(RenderViewHost* client_rvn); | |
67 | 62 |
68 void OpenDevToolsWindow(RenderViewHost* inspected_rvh); | |
69 void ToggleDevToolsWindow(RenderViewHost* inspected_rvh, | |
70 DevToolsToggleAction action); | |
71 void RuntimePropertyChanged(RenderViewHost* inspected_rvh, | 63 void RuntimePropertyChanged(RenderViewHost* inspected_rvh, |
72 const std::string& name, | 64 const std::string& name, |
73 const std::string& value); | 65 const std::string& value); |
74 | 66 |
75 // Starts element inspection in the devtools client. | 67 // Starts element inspection in the devtools agent. |
76 // Creates one by means of OpenDevToolsWindow if no client | 68 void SendInspectElement(RenderViewHost* inspected_rvh, int x, int y); |
77 // exists. | |
78 void InspectElement(RenderViewHost* inspected_rvh, int x, int y); | |
79 | 69 |
80 // Sends 'Attach' message to the agent using |dest_rvh| in case | 70 // Sends 'Attach' message to the agent using |dest_rvh| in case |
81 // there is a DevToolsClientHost registered for the |inspected_rvh|. | 71 // there is a DevToolsClientHost registered for the |inspected_rvh|. |
82 void OnNavigatingToPendingEntry(RenderViewHost* inspected_rvh, | 72 void OnNavigatingToPendingEntry(RenderViewHost* inspected_rvh, |
83 RenderViewHost* dest_rvh, | 73 RenderViewHost* dest_rvh, |
84 const GURL& gurl); | 74 const GURL& gurl); |
85 | 75 |
86 // Invoked when a tab is replaced by another tab. This is triggered by | 76 // Invoked when a tab is replaced by another tab. This is triggered by |
87 // TabStripModel::ReplaceTabContentsAt. | 77 // TabStripModel::ReplaceTabContentsAt. |
88 void TabReplaced(TabContentsWrapper* old_tab, TabContentsWrapper* new_tab); | 78 void TabReplaced(TabContentsWrapper* old_tab, TabContentsWrapper* new_tab); |
(...skipping 25 matching lines...) Expand all Loading... | |
114 const NotificationSource& source, | 104 const NotificationSource& source, |
115 const NotificationDetails& details); | 105 const NotificationDetails& details); |
116 | 106 |
117 // Returns RenderViewHost for the tab that is inspected by devtools | 107 // Returns RenderViewHost for the tab that is inspected by devtools |
118 // client hosted by DevToolsClientHost. | 108 // client hosted by DevToolsClientHost. |
119 RenderViewHost* GetInspectedRenderViewHost(DevToolsClientHost* client_host); | 109 RenderViewHost* GetInspectedRenderViewHost(DevToolsClientHost* client_host); |
120 | 110 |
121 void SendAttachToAgent(RenderViewHost* inspected_rvh); | 111 void SendAttachToAgent(RenderViewHost* inspected_rvh); |
122 void SendDetachToAgent(RenderViewHost* inspected_rvh); | 112 void SendDetachToAgent(RenderViewHost* inspected_rvh); |
123 | 113 |
124 void ForceReopenWindow(); | |
125 | |
126 DevToolsClientHost* FindOwnerDevToolsClientHost(RenderViewHost* client_rvh); | |
127 | |
128 void ToggleDevToolsWindow(RenderViewHost* inspected_rvh, | |
129 bool force_open, | |
130 DevToolsToggleAction action); | |
131 | |
132 void ReopenWindow(RenderViewHost* client_rvh, bool docked); | |
133 | |
134 void BindClientHost(RenderViewHost* inspected_rvh, | 114 void BindClientHost(RenderViewHost* inspected_rvh, |
135 DevToolsClientHost* client_host, | 115 DevToolsClientHost* client_host, |
136 const DevToolsRuntimeProperties& runtime_properties); | 116 const DevToolsRuntimeProperties& runtime_properties); |
137 | 117 |
138 void UnbindClientHost(RenderViewHost* inspected_rvh, | 118 void UnbindClientHost(RenderViewHost* inspected_rvh, |
139 DevToolsClientHost* client_host); | 119 DevToolsClientHost* client_host); |
140 | 120 |
141 // These two maps are for tracking dependencies between inspected tabs and | 121 // These two maps are for tracking dependencies between inspected tabs and |
142 // their DevToolsClientHosts. They are useful for routing devtools messages | 122 // their DevToolsClientHosts. They are useful for routing devtools messages |
143 // and allow us to have at most one devtools client host per tab. | 123 // and allow us to have at most one devtools client host per tab. |
144 // | 124 // |
145 // DevToolsManager start listening to DevToolsClientHosts when they are put | 125 // DevToolsManager start listening to DevToolsClientHosts when they are put |
146 // into these maps and removes them when they are closing. | 126 // into these maps and removes them when they are closing. |
147 typedef std::map<RenderViewHost*, DevToolsClientHost*> | 127 typedef std::map<RenderViewHost*, DevToolsClientHost*> |
148 InspectedRvhToClientHostMap; | 128 InspectedRvhToClientHostMap; |
149 InspectedRvhToClientHostMap inspected_rvh_to_client_host_; | 129 InspectedRvhToClientHostMap inspected_rvh_to_client_host_; |
150 | 130 |
151 typedef std::map<DevToolsClientHost*, RenderViewHost*> | 131 typedef std::map<DevToolsClientHost*, RenderViewHost*> |
152 ClientHostToInspectedRvhMap; | 132 ClientHostToInspectedRvhMap; |
153 ClientHostToInspectedRvhMap client_host_to_inspected_rvh_; | 133 ClientHostToInspectedRvhMap client_host_to_inspected_rvh_; |
154 | 134 |
155 typedef std::map<RenderViewHost*, DevToolsRuntimeProperties> | 135 typedef std::map<RenderViewHost*, DevToolsRuntimeProperties> |
156 RuntimePropertiesMap; | 136 RuntimePropertiesMap; |
157 RuntimePropertiesMap runtime_properties_map_; | 137 RuntimePropertiesMap runtime_properties_map_; |
158 | 138 |
159 RenderViewHost* inspected_rvh_for_reopen_; | |
160 bool in_initial_show_; | |
161 | |
162 typedef std::map<int, | 139 typedef std::map<int, |
163 std::pair<DevToolsClientHost*, DevToolsRuntimeProperties> > | 140 std::pair<DevToolsClientHost*, DevToolsRuntimeProperties> > |
164 OrphanClientHosts; | 141 OrphanClientHosts; |
165 OrphanClientHosts orphan_client_hosts_; | 142 OrphanClientHosts orphan_client_hosts_; |
166 int last_orphan_cookie_; | 143 int last_orphan_cookie_; |
167 | 144 |
168 NotificationRegistrar registrar_; | 145 NotificationRegistrar registrar_; |
169 | 146 |
170 DISALLOW_COPY_AND_ASSIGN(DevToolsManager); | 147 DISALLOW_COPY_AND_ASSIGN(DevToolsManager); |
171 }; | 148 }; |
172 | 149 |
173 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ | 150 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ |
OLD | NEW |