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 CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_IMPL_H_ |
6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_IMPL_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
14 #include "content/browser/devtools/devtools_agent_host_impl.h" | 14 #include "content/browser/devtools/devtools_agent_host_impl.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/public/browser/devtools_client_host.h" | 16 #include "content/public/browser/devtools_client_host.h" |
17 #include "content/public/browser/devtools_manager.h" | 17 #include "content/public/browser/devtools_manager.h" |
18 | 18 |
19 class GURL; | 19 class GURL; |
20 | 20 |
21 namespace IPC { | 21 namespace IPC { |
22 class Message; | 22 class Message; |
23 } | 23 } |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 | 26 |
| 27 class DevToolsManagerDelegate; |
27 class RenderViewHost; | 28 class RenderViewHost; |
28 | 29 |
29 // This class is a singleton that manages DevToolsClientHost instances and | 30 // This class is a singleton that manages DevToolsClientHost instances and |
30 // routes messages between developer tools clients and agents. | 31 // routes messages between developer tools clients and agents. |
31 // | 32 // |
32 // Methods below that accept inspected RenderViewHost as a parameter are | 33 // Methods below that accept inspected RenderViewHost as a parameter are |
33 // just convenience methods that call corresponding methods accepting | 34 // just convenience methods that call corresponding methods accepting |
34 // DevToolAgentHost. | 35 // DevToolAgentHost. |
35 class CONTENT_EXPORT DevToolsManagerImpl | 36 class CONTENT_EXPORT DevToolsManagerImpl |
36 : public DevToolsAgentHostImpl::CloseListener, | 37 : public DevToolsAgentHostImpl::CloseListener, |
(...skipping 14 matching lines...) Expand all Loading... |
51 const std::string& message) OVERRIDE; | 52 const std::string& message) OVERRIDE; |
52 virtual void CloseAllClientHosts() OVERRIDE; | 53 virtual void CloseAllClientHosts() OVERRIDE; |
53 virtual DevToolsAgentHost* GetDevToolsAgentHostFor( | 54 virtual DevToolsAgentHost* GetDevToolsAgentHostFor( |
54 DevToolsClientHost* client_host) OVERRIDE; | 55 DevToolsClientHost* client_host) OVERRIDE; |
55 virtual void RegisterDevToolsClientHostFor( | 56 virtual void RegisterDevToolsClientHostFor( |
56 DevToolsAgentHost* agent_host, | 57 DevToolsAgentHost* agent_host, |
57 DevToolsClientHost* client_host) OVERRIDE; | 58 DevToolsClientHost* client_host) OVERRIDE; |
58 virtual void ClientHostClosing(DevToolsClientHost* host) OVERRIDE; | 59 virtual void ClientHostClosing(DevToolsClientHost* host) OVERRIDE; |
59 virtual void AddAgentStateCallback(const Callback& callback) OVERRIDE; | 60 virtual void AddAgentStateCallback(const Callback& callback) OVERRIDE; |
60 virtual void RemoveAgentStateCallback(const Callback& callback) OVERRIDE; | 61 virtual void RemoveAgentStateCallback(const Callback& callback) OVERRIDE; |
| 62 virtual void Inspect(BrowserContext* browser_context, |
| 63 DevToolsAgentHost* agent_host) OVERRIDE; |
61 | 64 |
62 private: | 65 private: |
63 friend class DevToolsAgentHostImpl; | 66 friend class DevToolsAgentHostImpl; |
64 friend class RenderViewDevToolsAgentHost; | 67 friend class RenderViewDevToolsAgentHost; |
65 friend struct DefaultSingletonTraits<DevToolsManagerImpl>; | 68 friend struct DefaultSingletonTraits<DevToolsManagerImpl>; |
66 | 69 |
67 // DevToolsAgentHost::CloseListener implementation. | 70 // DevToolsAgentHost::CloseListener implementation. |
68 virtual void AgentHostClosing(DevToolsAgentHostImpl* host) OVERRIDE; | 71 virtual void AgentHostClosing(DevToolsAgentHostImpl* host) OVERRIDE; |
69 | 72 |
70 void BindClientHost(DevToolsAgentHostImpl* agent_host, | 73 void BindClientHost(DevToolsAgentHostImpl* agent_host, |
(...skipping 18 matching lines...) Expand all Loading... |
89 AgentToClientHostMap; | 92 AgentToClientHostMap; |
90 AgentToClientHostMap agent_to_client_host_; | 93 AgentToClientHostMap agent_to_client_host_; |
91 | 94 |
92 typedef std::map<DevToolsClientHost*, scoped_refptr<DevToolsAgentHostImpl> > | 95 typedef std::map<DevToolsClientHost*, scoped_refptr<DevToolsAgentHostImpl> > |
93 ClientToAgentHostMap; | 96 ClientToAgentHostMap; |
94 ClientToAgentHostMap client_to_agent_host_; | 97 ClientToAgentHostMap client_to_agent_host_; |
95 | 98 |
96 typedef std::vector<const Callback*> CallbackContainer; | 99 typedef std::vector<const Callback*> CallbackContainer; |
97 CallbackContainer callbacks_; | 100 CallbackContainer callbacks_; |
98 | 101 |
| 102 scoped_ptr<DevToolsManagerDelegate> delegate_; |
| 103 |
99 DISALLOW_COPY_AND_ASSIGN(DevToolsManagerImpl); | 104 DISALLOW_COPY_AND_ASSIGN(DevToolsManagerImpl); |
100 }; | 105 }; |
101 | 106 |
102 } // namespace content | 107 } // namespace content |
103 | 108 |
104 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_IMPL_H_ | 109 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_MANAGER_IMPL_H_ |
OLD | NEW |