| 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_AGENT_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 bool Inspect(BrowserContext* browser_context); | 38 bool Inspect(BrowserContext* browser_context); |
| 39 | 39 |
| 40 // DevToolsAgentHost implementation. | 40 // DevToolsAgentHost implementation. |
| 41 bool AttachClient(DevToolsAgentHostClient* client) override; | 41 bool AttachClient(DevToolsAgentHostClient* client) override; |
| 42 void ForceAttachClient(DevToolsAgentHostClient* client) override; | 42 void ForceAttachClient(DevToolsAgentHostClient* client) override; |
| 43 bool DetachClient(DevToolsAgentHostClient* client) override; | 43 bool DetachClient(DevToolsAgentHostClient* client) override; |
| 44 bool DispatchProtocolMessage(DevToolsAgentHostClient* client, | 44 bool DispatchProtocolMessage(DevToolsAgentHostClient* client, |
| 45 const std::string& message) override; | 45 const std::string& message) override; |
| 46 | 46 |
| 47 bool IsAttached() override; | 47 bool IsAttached() override; |
| 48 void InspectElement(int x, int y) override; | 48 void InspectElement(DevToolsAgentHostClient* client, int x, int y) override; |
| 49 std::string GetId() override; | 49 std::string GetId() override; |
| 50 BrowserContext* GetBrowserContext() override; | 50 BrowserContext* GetBrowserContext() override; |
| 51 WebContents* GetWebContents() override; | 51 WebContents* GetWebContents() override; |
| 52 void DisconnectWebContents() override; | 52 void DisconnectWebContents() override; |
| 53 void ConnectWebContents(WebContents* wc) override; | 53 void ConnectWebContents(WebContents* wc) override; |
| 54 | 54 |
| 55 // DevToolsProtocolDelegate implementation. | 55 // DevToolsProtocolDelegate implementation. |
| 56 void SendProtocolResponse(int session_id, | 56 void SendProtocolResponse(int session_id, |
| 57 const std::string& message) override; | 57 const std::string& message) override; |
| 58 void SendProtocolNotification(const std::string& message) override; | 58 void SendProtocolNotification(const std::string& message) override; |
| 59 | 59 |
| 60 protected: | 60 protected: |
| 61 DevToolsAgentHostImpl(); | 61 DevToolsAgentHostImpl(); |
| 62 ~DevToolsAgentHostImpl() override; | 62 ~DevToolsAgentHostImpl() override; |
| 63 | 63 |
| 64 virtual bool DispatchProtocolMessage(const std::string& message) = 0; | 64 virtual bool DispatchProtocolMessage(const std::string& message) = 0; |
| 65 virtual void InspectElement(int x, int y); |
| 65 | 66 |
| 66 void HostClosed(); | 67 void HostClosed(); |
| 67 void SendMessageToClient(int session_id, const std::string& message); | 68 void SendMessageToClient(int session_id, const std::string& message); |
| 68 devtools::DevToolsIOContext* GetIOContext() { return &io_context_; } | 69 devtools::DevToolsIOContext* GetIOContext() { return &io_context_; } |
| 69 | 70 |
| 70 int session_id() { DCHECK(client_); return session_id_; } | 71 int session_id() { DCHECK(client_); return session_id_; } |
| 71 | 72 |
| 72 static void NotifyCallbacks(DevToolsAgentHostImpl* agent_host, bool attached); | 73 static void NotifyCallbacks(DevToolsAgentHostImpl* agent_host, bool attached); |
| 73 | 74 |
| 74 private: | 75 private: |
| (...skipping 22 matching lines...) Expand all Loading... |
| 97 SendMessageCallback callback_; | 98 SendMessageCallback callback_; |
| 98 std::string message_buffer_; | 99 std::string message_buffer_; |
| 99 uint32_t message_buffer_size_; | 100 uint32_t message_buffer_size_; |
| 100 std::string state_cookie_; | 101 std::string state_cookie_; |
| 101 int last_call_id_; | 102 int last_call_id_; |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 } // namespace content | 105 } // namespace content |
| 105 | 106 |
| 106 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ | 107 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ |
| OLD | NEW |