Rename Animate as Begin(Main)Frame
[chromium-blink-merge.git] / content / browser / devtools / devtools_agent_host_impl.h
blob5afc0df7e153beaf2d048ba62dab442e9dcf51cf
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_
6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "content/common/content_export.h"
12 #include "content/public/browser/devtools_agent_host.h"
14 namespace IPC {
15 class Message;
18 namespace content {
20 class BrowserContext;
22 // Describes interface for managing devtools agents from the browser process.
23 class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost {
24 public:
25 // Informs the hosted agent that a client host has attached.
26 virtual void Attach() = 0;
28 // Informs the hosted agent that a client host has detached.
29 virtual void Detach() = 0;
31 // Sends a message to the agent.
32 virtual void DispatchProtocolMessage(const std::string& message) = 0;
34 // Opens the inspector for this host.
35 void Inspect(BrowserContext* browser_context);
37 // DevToolsAgentHost implementation.
38 virtual void AttachClient(DevToolsAgentHostClient* client) OVERRIDE;
39 virtual void DetachClient() OVERRIDE;
40 virtual bool IsAttached() OVERRIDE;
41 virtual void InspectElement(int x, int y) OVERRIDE;
42 virtual std::string GetId() OVERRIDE;
43 virtual WebContents* GetWebContents() OVERRIDE;
44 virtual void DisconnectWebContents() OVERRIDE;
45 virtual void ConnectWebContents(WebContents* wc) OVERRIDE;
46 virtual bool IsWorker() const OVERRIDE;
48 protected:
49 DevToolsAgentHostImpl();
50 virtual ~DevToolsAgentHostImpl();
52 void HostClosed();
53 void SendMessageToClient(const std::string& message);
54 static void NotifyCallbacks(DevToolsAgentHostImpl* agent_host, bool attached);
56 private:
57 friend class DevToolsAgentHost; // for static methods
59 const std::string id_;
60 DevToolsAgentHostClient* client_;
63 } // namespace content
65 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_