| 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_RENDERER_DEVTOOLS_AGENT_H_ | 5 #ifndef CONTENT_RENDERER_DEVTOOLS_AGENT_H_ |
| 6 #define CONTENT_RENDERER_DEVTOOLS_AGENT_H_ | 6 #define CONTENT_RENDERER_DEVTOOLS_AGENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "content/public/common/console_message_level.h" | 11 #include "content/public/common/console_message_level.h" |
| 12 #include "content/public/renderer/render_view_observer.h" | 12 #include "content/public/renderer/render_view_observer.h" |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgentClien
t.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDevToolsAgentClien
t.h" |
| 14 | 14 |
| 15 class RenderViewImpl; | |
| 16 | |
| 17 namespace WebKit { | 15 namespace WebKit { |
| 18 class WebDevToolsAgent; | 16 class WebDevToolsAgent; |
| 19 } | 17 } |
| 20 | 18 |
| 19 namespace content { |
| 20 class RenderViewImpl; |
| 21 |
| 21 // DevToolsAgent belongs to the inspectable RenderView and provides Glue's | 22 // DevToolsAgent belongs to the inspectable RenderView and provides Glue's |
| 22 // agents with the communication capabilities. All messages from/to Glue's | 23 // agents with the communication capabilities. All messages from/to Glue's |
| 23 // agents infrastructure are flowing through this communication agent. | 24 // agents infrastructure are flowing through this communication agent. |
| 24 // There is a corresponding DevToolsClient object on the client side. | 25 // There is a corresponding DevToolsClient object on the client side. |
| 25 class DevToolsAgent : public content::RenderViewObserver, | 26 class DevToolsAgent : public RenderViewObserver, |
| 26 public WebKit::WebDevToolsAgentClient { | 27 public WebKit::WebDevToolsAgentClient { |
| 27 public: | 28 public: |
| 28 explicit DevToolsAgent(RenderViewImpl* render_view); | 29 explicit DevToolsAgent(RenderViewImpl* render_view); |
| 29 virtual ~DevToolsAgent(); | 30 virtual ~DevToolsAgent(); |
| 30 | 31 |
| 31 // Returns agent instance for its host id. | 32 // Returns agent instance for its host id. |
| 32 static DevToolsAgent* FromHostId(int host_id); | 33 static DevToolsAgent* FromHostId(int host_id); |
| 33 | 34 |
| 34 WebKit::WebDevToolsAgent* GetWebAgent(); | 35 WebKit::WebDevToolsAgent* GetWebAgent(); |
| 35 | 36 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 50 createClientMessageLoop(); | 51 createClientMessageLoop(); |
| 51 virtual void clearBrowserCache(); | 52 virtual void clearBrowserCache(); |
| 52 virtual void clearBrowserCookies(); | 53 virtual void clearBrowserCookies(); |
| 53 virtual void visitAllocatedObjects(AllocatedObjectVisitor* visitor); | 54 virtual void visitAllocatedObjects(AllocatedObjectVisitor* visitor); |
| 54 | 55 |
| 55 void OnAttach(); | 56 void OnAttach(); |
| 56 void OnReattach(const std::string& agent_state); | 57 void OnReattach(const std::string& agent_state); |
| 57 void OnDetach(); | 58 void OnDetach(); |
| 58 void OnDispatchOnInspectorBackend(const std::string& message); | 59 void OnDispatchOnInspectorBackend(const std::string& message); |
| 59 void OnInspectElement(int x, int y); | 60 void OnInspectElement(int x, int y); |
| 60 void OnAddMessageToConsole(content::ConsoleMessageLevel level, | 61 void OnAddMessageToConsole(ConsoleMessageLevel level, |
| 61 const std::string& message); | 62 const std::string& message); |
| 62 void ContinueProgram(); | 63 void ContinueProgram(); |
| 63 void OnSetupDevToolsClient(); | 64 void OnSetupDevToolsClient(); |
| 64 | 65 |
| 65 bool is_attached_; | 66 bool is_attached_; |
| 66 | 67 |
| 67 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); | 68 DISALLOW_COPY_AND_ASSIGN(DevToolsAgent); |
| 68 }; | 69 }; |
| 69 | 70 |
| 71 } // namespace content |
| 72 |
| 70 #endif // CONTENT_RENDERER_DEVTOOLS_AGENT_H_ | 73 #endif // CONTENT_RENDERER_DEVTOOLS_AGENT_H_ |
| OLD | NEW |