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/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/values.h" |
13 #include "content/public/browser/devtools_agent_host.h" | 14 #include "content/public/browser/devtools_agent_host.h" |
14 #include "content/public/browser/devtools_frontend_host.h" | 15 #include "content/public/browser/devtools_frontend_host.h" |
15 #include "content/public/browser/web_contents_observer.h" | 16 #include "content/public/browser/web_contents_observer.h" |
16 #include "net/url_request/url_fetcher_delegate.h" | 17 #include "net/url_request/url_fetcher_delegate.h" |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 class Value; | 20 class Value; |
20 } | 21 } |
21 | 22 |
22 namespace content { | 23 namespace content { |
(...skipping 24 matching lines...) Expand all Loading... |
47 const base::Value* arg3); | 48 const base::Value* arg3); |
48 | 49 |
49 protected: | 50 protected: |
50 ShellDevToolsFrontend(Shell* frontend_shell, WebContents* inspected_contents); | 51 ShellDevToolsFrontend(Shell* frontend_shell, WebContents* inspected_contents); |
51 ~ShellDevToolsFrontend() override; | 52 ~ShellDevToolsFrontend() override; |
52 | 53 |
53 // content::DevToolsAgentHostClient implementation. | 54 // content::DevToolsAgentHostClient implementation. |
54 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override; | 55 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override; |
55 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, | 56 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, |
56 const std::string& message) override; | 57 const std::string& message) override; |
| 58 base::DictionaryValue* preferences() { return &preferences_; } |
57 | 59 |
58 private: | 60 private: |
59 // WebContentsObserver overrides | 61 // WebContentsObserver overrides |
60 void RenderViewCreated(RenderViewHost* render_view_host) override; | 62 void RenderViewCreated(RenderViewHost* render_view_host) override; |
61 void DocumentAvailableInMainFrame() override; | 63 void DocumentAvailableInMainFrame() override; |
62 void WebContentsDestroyed() override; | 64 void WebContentsDestroyed() override; |
63 | 65 |
64 // content::DevToolsFrontendHost::Delegate implementation. | 66 // content::DevToolsFrontendHost::Delegate implementation. |
65 void HandleMessageFromDevToolsFrontend(const std::string& message) override; | 67 void HandleMessageFromDevToolsFrontend(const std::string& message) override; |
66 void HandleMessageFromDevToolsFrontendToBackend( | 68 void HandleMessageFromDevToolsFrontendToBackend( |
67 const std::string& message) override; | 69 const std::string& message) override; |
68 | 70 |
69 // net::URLFetcherDelegate overrides. | 71 // net::URLFetcherDelegate overrides. |
70 void OnURLFetchComplete(const net::URLFetcher* source) override; | 72 void OnURLFetchComplete(const net::URLFetcher* source) override; |
71 | 73 |
72 void SendMessageAck(int request_id, | 74 void SendMessageAck(int request_id, |
73 const base::Value* arg1); | 75 const base::Value* arg1); |
74 | 76 |
75 Shell* frontend_shell_; | 77 Shell* frontend_shell_; |
76 WebContents* inspected_contents_; | 78 WebContents* inspected_contents_; |
77 scoped_refptr<DevToolsAgentHost> agent_host_; | 79 scoped_refptr<DevToolsAgentHost> agent_host_; |
78 scoped_ptr<DevToolsFrontendHost> frontend_host_; | 80 scoped_ptr<DevToolsFrontendHost> frontend_host_; |
79 using PendingRequestsMap = std::map<const net::URLFetcher*, int>; | 81 using PendingRequestsMap = std::map<const net::URLFetcher*, int>; |
80 PendingRequestsMap pending_requests_; | 82 PendingRequestsMap pending_requests_; |
| 83 base::DictionaryValue preferences_; |
81 base::WeakPtrFactory<ShellDevToolsFrontend> weak_factory_; | 84 base::WeakPtrFactory<ShellDevToolsFrontend> weak_factory_; |
82 | 85 |
83 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsFrontend); | 86 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsFrontend); |
84 }; | 87 }; |
85 | 88 |
86 } // namespace content | 89 } // namespace content |
87 | 90 |
88 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ | 91 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_FRONTEND_H_ |
OLD | NEW |