OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ |
6 #define CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ | 6 #define CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 protected: | 49 protected: |
50 ShellDevToolsFrontend(Shell* frontend_shell, WebContents* inspected_contents); | 50 ShellDevToolsFrontend(Shell* frontend_shell, WebContents* inspected_contents); |
51 ~ShellDevToolsFrontend() override; | 51 ~ShellDevToolsFrontend() override; |
52 | 52 |
53 // content::DevToolsAgentHostClient implementation. | 53 // content::DevToolsAgentHostClient implementation. |
54 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override; | 54 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override; |
55 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, | 55 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, |
56 const std::string& message) override; | 56 const std::string& message) override; |
57 base::DictionaryValue* preferences() { return &preferences_; } | 57 base::DictionaryValue* preferences() { return &preferences_; } |
| 58 virtual void HandleMessageFromDevToolsFrontend(const std::string& message); |
58 | 59 |
59 private: | 60 private: |
60 // WebContentsObserver overrides | 61 // WebContentsObserver overrides |
61 void RenderViewCreated(RenderViewHost* render_view_host) override; | 62 void RenderViewCreated(RenderViewHost* render_view_host) override; |
62 void DocumentAvailableInMainFrame() override; | 63 void DocumentAvailableInMainFrame() override; |
63 void WebContentsDestroyed() override; | 64 void WebContentsDestroyed() override; |
64 | 65 |
65 void HandleMessageFromDevToolsFrontend(const std::string& message); | |
66 | |
67 // net::URLFetcherDelegate overrides. | 66 // net::URLFetcherDelegate overrides. |
68 void OnURLFetchComplete(const net::URLFetcher* source) override; | 67 void OnURLFetchComplete(const net::URLFetcher* source) override; |
69 | 68 |
70 void SendMessageAck(int request_id, | 69 void SendMessageAck(int request_id, |
71 const base::Value* arg1); | 70 const base::Value* arg1); |
72 | 71 |
73 Shell* frontend_shell_; | 72 Shell* frontend_shell_; |
74 WebContents* inspected_contents_; | 73 WebContents* inspected_contents_; |
75 scoped_refptr<DevToolsAgentHost> agent_host_; | 74 scoped_refptr<DevToolsAgentHost> agent_host_; |
76 scoped_ptr<DevToolsFrontendHost> frontend_host_; | 75 scoped_ptr<DevToolsFrontendHost> frontend_host_; |
77 using PendingRequestsMap = std::map<const net::URLFetcher*, int>; | 76 using PendingRequestsMap = std::map<const net::URLFetcher*, int>; |
78 PendingRequestsMap pending_requests_; | 77 PendingRequestsMap pending_requests_; |
79 base::DictionaryValue preferences_; | 78 base::DictionaryValue preferences_; |
80 base::WeakPtrFactory<ShellDevToolsFrontend> weak_factory_; | 79 base::WeakPtrFactory<ShellDevToolsFrontend> weak_factory_; |
81 | 80 |
82 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsFrontend); | 81 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsFrontend); |
83 }; | 82 }; |
84 | 83 |
85 } // namespace content | 84 } // namespace content |
86 | 85 |
87 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ | 86 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ |
OLD | NEW |