Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: content/browser/devtools/devtools_agent_host_impl.h

Issue 12950002: Introduce DevToolsExternalAgentProxy interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 13
14 namespace IPC { 14 namespace IPC {
15 class Message; 15 class Message;
16 } 16 }
17 17
18 namespace content { 18 namespace content {
19 19
20 // Describes interface for managing devtools agents from the browser process. 20 // Describes interface for managing devtools agents from the browser process.
21 class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost { 21 class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost {
22 public: 22 public:
23 class CONTENT_EXPORT CloseListener { 23 class CONTENT_EXPORT CloseListener {
24 public: 24 public:
25 virtual void AgentHostClosing(DevToolsAgentHostImpl*) = 0; 25 virtual void AgentHostClosing(DevToolsAgentHostImpl*) = 0;
26 protected: 26 protected:
27 virtual ~CloseListener() {} 27 virtual ~CloseListener() {}
28 }; 28 };
29 29
30 // Sends the message to the devtools agent hosted by this object. 30 // Sends the attach message to the devtools agent hosted by this object.
31 void Attach(); 31 virtual void Attach() = 0;
32 void Reattach(const std::string& saved_agent_state); 32
33 void Detach(); 33 // Sends the detach message to the devtools agent hosted by this object.
34 virtual void DispatchOnInspectorBackend(const std::string& message); 34 virtual void Detach() = 0;
35
36 // Dispatches a message to the devtools agent hosted by this object.
37 virtual void DispatchOnInspectorBackend(const std::string& message) = 0;
35 38
36 void set_close_listener(CloseListener* listener) { 39 void set_close_listener(CloseListener* listener) {
37 close_listener_ = listener; 40 close_listener_ = listener;
38 } 41 }
39 42
40 // DevToolsAgentHost implementation. 43 // DevToolsAgentHost implementation.
41 virtual void InspectElement(int x, int y) OVERRIDE; 44 virtual void InspectElement(int x, int y) OVERRIDE;
42 45
43 virtual std::string GetId() OVERRIDE; 46 virtual std::string GetId() OVERRIDE;
44 47
45 virtual RenderViewHost* GetRenderViewHost() OVERRIDE; 48 virtual RenderViewHost* GetRenderViewHost() OVERRIDE;
46 49
47 protected: 50 protected:
48 DevToolsAgentHostImpl(); 51 DevToolsAgentHostImpl();
49 virtual ~DevToolsAgentHostImpl(); 52 virtual ~DevToolsAgentHostImpl();
50 53
51 virtual void SendMessageToAgent(IPC::Message* msg) = 0;
52 virtual void NotifyClientAttaching() = 0;
53 virtual void NotifyClientDetaching() = 0;
54
55 void NotifyCloseListener(); 54 void NotifyCloseListener();
56 55
57 private: 56 private:
58 CloseListener* close_listener_; 57 CloseListener* close_listener_;
59 const std::string id_; 58 const std::string id_;
60 }; 59 };
61 60
62 } // namespace content 61 } // namespace content
63 62
64 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_ 63 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_AGENT_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698