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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 ~ShellDevToolsBindings() override; | 52 ~ShellDevToolsBindings() override; |
53 | 53 |
54 protected: | 54 protected: |
55 // content::DevToolsAgentHostClient implementation. | 55 // content::DevToolsAgentHostClient implementation. |
56 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override; | 56 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override; |
57 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, | 57 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, |
58 const std::string& message) override; | 58 const std::string& message) override; |
59 | 59 |
60 void SetPreferences(const std::string& json); | 60 void SetPreferences(const std::string& json); |
61 virtual void HandleMessageFromDevToolsFrontend(const std::string& message); | 61 virtual void HandleMessageFromDevToolsFrontend(const std::string& message); |
62 void CreateFrontendHost(); | 62 void CreateFrontendHost(RenderFrameHost* render_frame_host); |
63 | 63 |
64 private: | 64 private: |
65 // WebContentsObserver overrides | 65 // WebContentsObserver overrides |
66 void RenderViewCreated(RenderViewHost* render_view_host) override; | 66 void ReadyToCommitNavigation( |
| 67 content::NavigationHandle* navigation_handle) override; |
67 void DocumentAvailableInMainFrame() override; | 68 void DocumentAvailableInMainFrame() override; |
68 void WebContentsDestroyed() override; | 69 void WebContentsDestroyed() override; |
69 | 70 |
70 // net::URLFetcherDelegate overrides. | 71 // net::URLFetcherDelegate overrides. |
71 void OnURLFetchComplete(const net::URLFetcher* source) override; | 72 void OnURLFetchComplete(const net::URLFetcher* source) override; |
72 | 73 |
73 void SendMessageAck(int request_id, const base::Value* arg1); | 74 void SendMessageAck(int request_id, const base::Value* arg1); |
74 | 75 |
75 WebContents* inspected_contents_; | 76 WebContents* inspected_contents_; |
76 ShellDevToolsDelegate* delegate_; | 77 ShellDevToolsDelegate* delegate_; |
77 scoped_refptr<DevToolsAgentHost> agent_host_; | 78 scoped_refptr<DevToolsAgentHost> agent_host_; |
78 int inspect_element_at_x_; | 79 int inspect_element_at_x_; |
79 int inspect_element_at_y_; | 80 int inspect_element_at_y_; |
80 #if !defined(OS_ANDROID) | 81 #if !defined(OS_ANDROID) |
81 std::unique_ptr<DevToolsFrontendHost> frontend_host_; | 82 std::unique_ptr<DevToolsFrontendHost> frontend_host_; |
82 #endif | 83 #endif |
83 using PendingRequestsMap = std::map<const net::URLFetcher*, int>; | 84 using PendingRequestsMap = std::map<const net::URLFetcher*, int>; |
84 PendingRequestsMap pending_requests_; | 85 PendingRequestsMap pending_requests_; |
85 base::DictionaryValue preferences_; | 86 base::DictionaryValue preferences_; |
86 base::WeakPtrFactory<ShellDevToolsBindings> weak_factory_; | 87 base::WeakPtrFactory<ShellDevToolsBindings> weak_factory_; |
87 | 88 |
88 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsBindings); | 89 DISALLOW_COPY_AND_ASSIGN(ShellDevToolsBindings); |
89 }; | 90 }; |
90 | 91 |
91 } // namespace content | 92 } // namespace content |
92 | 93 |
93 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_ | 94 #endif // CONTENT_SHELL_BROWSER_SHELL_DEVTOOLS_BINDINGS_H_ |
OLD | NEW |