| 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(); | |
| 65 | 64 |
| 66 private: | 65 private: |
| 67 // WebContentsObserver overrides | 66 // WebContentsObserver overrides |
| 68 void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override; | 67 void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override; |
| 69 void RenderViewCreated(RenderViewHost* render_view_host) override; | |
| 70 void DocumentAvailableInMainFrame() override; | 68 void DocumentAvailableInMainFrame() override; |
| 71 void WebContentsDestroyed() override; | 69 void WebContentsDestroyed() override; |
| 72 | 70 |
| 73 // net::URLFetcherDelegate overrides. | 71 // net::URLFetcherDelegate overrides. |
| 74 void OnURLFetchComplete(const net::URLFetcher* source) override; | 72 void OnURLFetchComplete(const net::URLFetcher* source) override; |
| 75 | 73 |
| 76 void SendMessageAck(int request_id, const base::Value* arg1); | 74 void SendMessageAck(int request_id, const base::Value* arg1); |
| 77 | 75 |
| 78 WebContents* inspected_contents_; | 76 WebContents* inspected_contents_; |
| 79 ShellDevToolsDelegate* delegate_; | 77 ShellDevToolsDelegate* delegate_; |
| 80 scoped_refptr<DevToolsAgentHost> agent_host_; | 78 scoped_refptr<DevToolsAgentHost> agent_host_; |
| 81 int inspect_element_at_x_; | 79 int inspect_element_at_x_; |
| 82 int inspect_element_at_y_; | 80 int inspect_element_at_y_; |
| 83 #if !defined(OS_ANDROID) | 81 #if !defined(OS_ANDROID) |
| 84 std::unique_ptr<DevToolsFrontendHost> frontend_host_; | 82 std::unique_ptr<DevToolsFrontendHost> frontend_host_; |
| 85 #endif | 83 #endif |
| 86 using PendingRequestsMap = std::map<const net::URLFetcher*, int>; | 84 using PendingRequestsMap = std::map<const net::URLFetcher*, int>; |
| 87 PendingRequestsMap pending_requests_; | 85 PendingRequestsMap pending_requests_; |
| 88 base::DictionaryValue preferences_; | 86 base::DictionaryValue preferences_; |
| 89 using ExtensionsAPIs = std::map<std::string, std::string>; | 87 using ExtensionsAPIs = std::map<std::string, std::string>; |
| 90 ExtensionsAPIs extensions_api_; | 88 ExtensionsAPIs extensions_api_; |
| 91 base::WeakPtrFactory<ShellDevToolsBindings> weak_factory_; | 89 base::WeakPtrFactory<ShellDevToolsBindings> weak_factory_; |
| 92 | 90 |
| 93 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsBindings); | 91 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsBindings); |
| 94 }; | 92 }; |
| 95 | 93 |
| 96 } // namespace content | 94 } // namespace content |
| 97 | 95 |
| 98 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_ | 96 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_ |
| OLD | NEW |