OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_BINDINGS_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_ |
6 #define CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_ | 6 #define CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 ~ShellDevToolsBindings() override; | 54 ~ShellDevToolsBindings() override; |
55 | 55 |
56 protected: | 56 protected: |
57 // content::DevToolsAgentHostClient implementation. | 57 // content::DevToolsAgentHostClient implementation. |
58 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override; | 58 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override; |
59 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, | 59 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, |
60 const std::string& message) override; | 60 const std::string& message) override; |
61 | 61 |
62 void SetPreferences(const std::string& json); | 62 void SetPreferences(const std::string& json); |
63 virtual void HandleMessageFromDevToolsFrontend(const std::string& message); | 63 virtual void HandleMessageFromDevToolsFrontend(const std::string& message); |
64 void CreateFrontendHost(); | 64 void CreateFrontendHost(RenderFrameHost* render_frame_host); |
dgozman
2017/06/15 21:16:48
This can be private now.
chenwilliam
2017/06/19 18:33:29
Done.
| |
65 | 65 |
66 private: | 66 private: |
67 // WebContentsObserver overrides | 67 // WebContentsObserver overrides |
68 void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override; | 68 void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override; |
69 void RenderViewCreated(RenderViewHost* render_view_host) override; | |
70 void DocumentAvailableInMainFrame() override; | 69 void DocumentAvailableInMainFrame() override; |
71 void WebContentsDestroyed() override; | 70 void WebContentsDestroyed() override; |
72 | 71 |
73 // net::URLFetcherDelegate overrides. | 72 // net::URLFetcherDelegate overrides. |
74 void OnURLFetchComplete(const net::URLFetcher* source) override; | 73 void OnURLFetchComplete(const net::URLFetcher* source) override; |
75 | 74 |
76 void SendMessageAck(int request_id, const base::Value* arg1); | 75 void SendMessageAck(int request_id, const base::Value* arg1); |
77 | 76 |
78 WebContents* inspected_contents_; | 77 WebContents* inspected_contents_; |
79 ShellDevToolsDelegate* delegate_; | 78 ShellDevToolsDelegate* delegate_; |
80 scoped_refptr<DevToolsAgentHost> agent_host_; | 79 scoped_refptr<DevToolsAgentHost> agent_host_; |
81 int inspect_element_at_x_; | 80 int inspect_element_at_x_; |
82 int inspect_element_at_y_; | 81 int inspect_element_at_y_; |
83 #if !defined(OS_ANDROID) | 82 #if !defined(OS_ANDROID) |
84 std::unique_ptr<DevToolsFrontendHost> frontend_host_; | 83 std::unique_ptr<DevToolsFrontendHost> frontend_host_; |
85 #endif | 84 #endif |
86 using PendingRequestsMap = std::map<const net::URLFetcher*, int>; | 85 using PendingRequestsMap = std::map<const net::URLFetcher*, int>; |
87 PendingRequestsMap pending_requests_; | 86 PendingRequestsMap pending_requests_; |
88 base::DictionaryValue preferences_; | 87 base::DictionaryValue preferences_; |
89 using ExtensionsAPIs = std::map<std::string, std::string>; | 88 using ExtensionsAPIs = std::map<std::string, std::string>; |
90 ExtensionsAPIs extensions_api_; | 89 ExtensionsAPIs extensions_api_; |
91 base::WeakPtrFactory<ShellDevToolsBindings> weak_factory_; | 90 base::WeakPtrFactory<ShellDevToolsBindings> weak_factory_; |
92 | 91 |
93 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsBindings); | 92 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsBindings); |
94 }; | 93 }; |
95 | 94 |
96 } // namespace content | 95 } // namespace content |
97 | 96 |
98 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_ | 97 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_ |
OLD | NEW |