OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_DEVTOOLS_PROTOCOL_TEST_BINDINGS_H_ |
| 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_DEVTOOLS_PROTOCOL_TEST_BINDINGS_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <string> |
| 10 |
| 11 #include "content/public/browser/devtools_agent_host_client.h" |
| 12 #include "content/public/browser/web_contents_observer.h" |
| 13 #include "url/gurl.h" |
| 14 |
| 15 namespace content { |
| 16 |
| 17 class DevToolsAgentHost; |
| 18 class DevToolsFrontendHost; |
| 19 |
| 20 class DevToolsProtocolTestBindings : public WebContentsObserver, |
| 21 public DevToolsAgentHostClient { |
| 22 public: |
| 23 explicit DevToolsProtocolTestBindings(WebContents* devtools); |
| 24 ~DevToolsProtocolTestBindings() override; |
| 25 static GURL GetProtocolTestURL(const GURL& test_url); |
| 26 |
| 27 private: |
| 28 // content::DevToolsAgentHostClient implementation. |
| 29 void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override; |
| 30 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, |
| 31 const std::string& message) override; |
| 32 |
| 33 // WebContentsObserver overrides |
| 34 void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override; |
| 35 void WebContentsDestroyed() override; |
| 36 |
| 37 void HandleMessageFromTest(const std::string& message); |
| 38 |
| 39 scoped_refptr<DevToolsAgentHost> agent_host_; |
| 40 #if !defined(OS_ANDROID) |
| 41 std::unique_ptr<DevToolsFrontendHost> frontend_host_; |
| 42 #endif |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(DevToolsProtocolTestBindings); |
| 45 }; |
| 46 |
| 47 } // namespace content |
| 48 |
| 49 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_DEVTOOLS_PROTOCOL_TEST_BINDINGS_H_ |
OLD | NEW |