Index: content/public/browser/devtools_agent_host.h |
diff --git a/content/public/browser/devtools_agent_host.h b/content/public/browser/devtools_agent_host.h |
index be02843731f42b5bf5a97b8d6a81891e2b548fc6..44ec555a5d0e693c1c795a128899a450c171d633 100644 |
--- a/content/public/browser/devtools_agent_host.h |
+++ b/content/public/browser/devtools_agent_host.h |
@@ -9,14 +9,20 @@ |
#include <vector> |
#include "base/basictypes.h" |
+#include "base/callback.h" |
#include "base/memory/ref_counted.h" |
#include "content/common/content_export.h" |
+#include "url/gurl.h" |
namespace content { |
class DevToolsExternalAgentProxyDelegate; |
class WebContents; |
+extern const char kAgentHostTypePage[]; |
yurys
2014/08/13 07:33:47
Let's make it an enum.
vkuzkokov
2014/08/13 08:21:06
We still need string constants to serialize these
|
+extern const char kAgentHostTypeWorker[]; |
+extern const char kAgentHostTypeServiceWorker[]; |
+ |
// Describes interface for managing devtools agents from browser process. |
class CONTENT_EXPORT DevToolsAgentHost |
: public base::RefCounted<DevToolsAgentHost> { |
@@ -46,8 +52,10 @@ class CONTENT_EXPORT DevToolsAgentHost |
static bool IsDebuggerAttached(WebContents* web_contents); |
- // Returns a list of all existing WebContents that can be debugged. |
- static std::vector<WebContents*> GetInspectableWebContents(); |
+ typedef std::vector<scoped_refptr<DevToolsAgentHost> > List; |
+ |
+ // Returns all possible DevToolsAgentHosts |
+ static List GetOrCreateAll(); |
// Returns true if there is a client attached. |
virtual bool IsAttached() = 0; |
@@ -71,6 +79,30 @@ class CONTENT_EXPORT DevToolsAgentHost |
// Returns true if DevToolsAgentHost is for worker. |
virtual bool IsWorker() const = 0; |
+ // Returns agent host type. |
+ virtual std::string GetType() = 0; |
+ |
+ // Returns agent host title. |
+ virtual std::string GetTitle() = 0; |
+ |
+ // Returns url associated with agent host. |
+ virtual GURL GetURL() = 0; |
+ |
+ // Activates agent host. Returns false if the operation failed. |
+ virtual bool Activate() = 0; |
+ |
+ // Closes agent host. Returns false if the operation failed. |
+ virtual bool Close() = 0; |
+ |
+ // Terminates all debugging sessions and detaches all clients. |
+ static void DetachAllClients(); |
yurys
2014/08/13 07:33:47
We shouldn't be detaching clients that we don't co
vkuzkokov
2014/08/13 08:21:06
It's part of an unsuccessful rebase. Removed.
|
+ |
+ typedef base::Callback<void(DevToolsAgentHost*, bool attached)> |
+ AgentStateCallback; |
+ |
+ static void AddAgentStateCallback(const AgentStateCallback& callback); |
yurys
2014/08/13 07:33:47
I don't think it should be a part of this CL.
vkuzkokov
2014/08/13 08:21:06
Ditto.
|
+ static void RemoveAgentStateCallback(const AgentStateCallback& callback); |
+ |
protected: |
friend class base::RefCounted<DevToolsAgentHost>; |
virtual ~DevToolsAgentHost() {} |