Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "content/public/browser/devtools_agent_host.h" | 12 #include "content/public/browser/devtools_agent_host.h" |
| 13 #include "content/public/common/console_message_level.h" | 13 #include "content/public/common/console_message_level.h" |
| 14 | 14 |
| 15 namespace IPC { | 15 namespace IPC { |
| 16 class Message; | 16 class Message; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 class NavigationEntry; | |
| 22 | |
| 21 // Describes interface for managing devtools agents from the browser process. | 23 // Describes interface for managing devtools agents from the browser process. |
| 22 class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost { | 24 class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost { |
| 23 public: | 25 public: |
| 24 class CONTENT_EXPORT CloseListener { | 26 class CONTENT_EXPORT CloseListener { |
| 25 public: | 27 public: |
| 26 virtual void AgentHostClosing(DevToolsAgentHostImpl*) = 0; | 28 virtual void AgentHostClosing(DevToolsAgentHostImpl*) = 0; |
| 27 protected: | 29 protected: |
| 28 virtual ~CloseListener() {} | 30 virtual ~CloseListener() {} |
| 29 }; | 31 }; |
| 30 | 32 |
| 31 // Sends the message to the devtools agent hosted by this object. | 33 // Sends the message to the devtools agent hosted by this object. |
| 32 void Attach(); | 34 void Attach(); |
| 33 void Reattach(const std::string& saved_agent_state); | 35 void Reattach(const std::string& saved_agent_state); |
| 34 void Detach(); | 36 void Detach(); |
| 35 virtual void DispatchOnInspectorBackend(const std::string& message); | 37 virtual void DispatchOnInspectorBackend(const std::string& message); |
| 36 void InspectElement(int x, int y); | 38 void InspectElement(int x, int y); |
| 37 void AddMessageToConsole(ConsoleMessageLevel level, | 39 void AddMessageToConsole(ConsoleMessageLevel level, |
| 38 const std::string& message); | 40 const std::string& message); |
| 39 | 41 |
| 40 void set_close_listener(CloseListener* listener) { | 42 void set_close_listener(CloseListener* listener) { |
| 41 close_listener_ = listener; | 43 close_listener_ = listener; |
| 42 } | 44 } |
| 43 | 45 |
| 44 int id() { return id_; } | 46 // DevToolsAgentHost implementation. |
| 47 virtual int id() OVERRIDE { return id_; } | |
| 45 | 48 |
| 46 // DevToolsAgentHost implementation. | 49 virtual bool attached() OVERRIDE; |
| 50 | |
| 51 virtual std::string title() OVERRIDE; | |
| 52 | |
| 53 virtual GURL url() OVERRIDE; | |
| 54 | |
| 55 virtual GURL thumbnail_url() OVERRIDE; | |
| 56 | |
| 57 virtual GURL favicon_url() OVERRIDE; | |
| 58 | |
| 47 virtual RenderViewHost* GetRenderViewHost() OVERRIDE; | 59 virtual RenderViewHost* GetRenderViewHost() OVERRIDE; |
| 48 | 60 |
| 49 protected: | 61 protected: |
| 50 DevToolsAgentHostImpl(); | 62 DevToolsAgentHostImpl(); |
| 51 virtual ~DevToolsAgentHostImpl() {} | 63 virtual ~DevToolsAgentHostImpl() {} |
| 52 | 64 |
| 53 virtual void SendMessageToAgent(IPC::Message* msg) = 0; | 65 virtual void SendMessageToAgent(IPC::Message* msg) = 0; |
| 54 virtual void NotifyClientAttaching() = 0; | 66 virtual void NotifyClientAttaching() = 0; |
| 55 virtual void NotifyClientDetaching() = 0; | 67 virtual void NotifyClientDetaching() = 0; |
| 56 | 68 |
| 57 void NotifyCloseListener(); | 69 void NotifyCloseListener(); |
| 58 | 70 |
| 59 CloseListener* close_listener_; | 71 CloseListener* close_listener_; |
| 60 | 72 |
| 61 private: | 73 private: |
| 62 int id_; | 74 int id_; |
| 75 | |
| 76 WebContents* GetWebContents(); | |
|
pfeldman
2013/03/01 08:49:30
These should only be in render_view_devtools_agent
Vladislav Kaznacheev
2013/03/01 12:58:35
Done.
| |
| 77 NavigationEntry* GetNavigationEntry(); | |
| 63 }; | 78 }; |
| 64 | 79 |
| 65 } // namespace content | 80 } // namespace content |
| 66 | 81 |
| 67 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ | 82 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ |
| OLD | NEW |