| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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, | 56 void ForwardToDevToolsAgent(RenderViewHost* client_rvh, |
| 57 const IPC::Message& message); | 57 const IPC::Message& message); |
| 58 void ForwardToDevToolsAgent(DevToolsClientHost* from, | 58 void ForwardToDevToolsAgent(DevToolsClientHost* from, |
| 59 const IPC::Message& message); | 59 const IPC::Message& message); |
| 60 void ForwardToDevToolsClient(RenderViewHost* inspected_rvh, | 60 void ForwardToDevToolsClient(RenderViewHost* inspected_rvh, |
| 61 const IPC::Message& message); | 61 const IPC::Message& message); |
| 62 | 62 void OpenDevToolsForWorker(int worker_devtools_id); |
| 63 void ForwardToWorkerDevToolsClient(int worker_devtools_id, |
| 64 const IPC::Message& message); |
| 63 void ActivateWindow(RenderViewHost* client_rvn); | 65 void ActivateWindow(RenderViewHost* client_rvn); |
| 64 void CloseWindow(RenderViewHost* client_rvn); | 66 void CloseWindow(RenderViewHost* client_rvn); |
| 65 void RequestDockWindow(RenderViewHost* client_rvn); | 67 void RequestDockWindow(RenderViewHost* client_rvn); |
| 66 void RequestUndockWindow(RenderViewHost* client_rvn); | 68 void RequestUndockWindow(RenderViewHost* client_rvn); |
| 67 | 69 |
| 68 void OpenDevToolsWindow(RenderViewHost* inspected_rvh); | 70 void OpenDevToolsWindow(RenderViewHost* inspected_rvh); |
| 69 void ToggleDevToolsWindow(RenderViewHost* inspected_rvh, | 71 void ToggleDevToolsWindow(RenderViewHost* inspected_rvh, |
| 70 DevToolsToggleAction action); | 72 DevToolsToggleAction action); |
| 71 void RuntimePropertyChanged(RenderViewHost* inspected_rvh, | 73 void RuntimePropertyChanged(RenderViewHost* inspected_rvh, |
| 72 const std::string& name, | 74 const std::string& name, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 96 RenderViewHost* to_rvh); | 98 RenderViewHost* to_rvh); |
| 97 | 99 |
| 98 // Closes all open developer tools windows. | 100 // Closes all open developer tools windows. |
| 99 void CloseAllClientHosts(); | 101 void CloseAllClientHosts(); |
| 100 | 102 |
| 101 private: | 103 private: |
| 102 friend class base::RefCounted<DevToolsManager>; | 104 friend class base::RefCounted<DevToolsManager>; |
| 103 | 105 |
| 104 virtual ~DevToolsManager(); | 106 virtual ~DevToolsManager(); |
| 105 | 107 |
| 108 void ForwardToWorkerDevToolsAgent(RenderViewHost* client_rvh, |
| 109 const IPC::Message& message); |
| 110 int FindWorkerDevToolsId(RenderViewHost* devtools_client_rvh); |
| 111 void MaybeWorkerDevToolsClientHostClosing(DevToolsClientHost* host); |
| 112 |
| 106 // DevToolsClientHost::CloseListener override. | 113 // DevToolsClientHost::CloseListener override. |
| 107 // This method will remove all references from the manager to the | 114 // This method will remove all references from the manager to the |
| 108 // DevToolsClientHost and unregister all listeners related to the | 115 // DevToolsClientHost and unregister all listeners related to the |
| 109 // DevToolsClientHost. | 116 // DevToolsClientHost. |
| 110 virtual void ClientHostClosing(DevToolsClientHost* host); | 117 virtual void ClientHostClosing(DevToolsClientHost* host); |
| 111 | 118 |
| 112 // Overridden from NotificationObserver: | 119 // Overridden from NotificationObserver: |
| 113 virtual void Observe(NotificationType type, | 120 virtual void Observe(NotificationType type, |
| 114 const NotificationSource& source, | 121 const NotificationSource& source, |
| 115 const NotificationDetails& details); | 122 const NotificationDetails& details); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 bool in_initial_show_; | 167 bool in_initial_show_; |
| 161 | 168 |
| 162 typedef std::map<int, | 169 typedef std::map<int, |
| 163 std::pair<DevToolsClientHost*, DevToolsRuntimeProperties> > | 170 std::pair<DevToolsClientHost*, DevToolsRuntimeProperties> > |
| 164 OrphanClientHosts; | 171 OrphanClientHosts; |
| 165 OrphanClientHosts orphan_client_hosts_; | 172 OrphanClientHosts orphan_client_hosts_; |
| 166 int last_orphan_cookie_; | 173 int last_orphan_cookie_; |
| 167 | 174 |
| 168 NotificationRegistrar registrar_; | 175 NotificationRegistrar registrar_; |
| 169 | 176 |
| 177 typedef std::map<int, DevToolsClientHost*> WorkerIdToClientHostMap; |
| 178 WorkerIdToClientHostMap worker_id_to_client_host_; |
| 179 |
| 170 DISALLOW_COPY_AND_ASSIGN(DevToolsManager); | 180 DISALLOW_COPY_AND_ASSIGN(DevToolsManager); |
| 171 }; | 181 }; |
| 172 | 182 |
| 173 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ | 183 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_MANAGER_H_ |
| OLD | NEW |