Index: content/shell/browser/layout_test/devtools_protocol_test_bindings.h |
diff --git a/content/shell/browser/layout_test/devtools_protocol_test_bindings.h b/content/shell/browser/layout_test/devtools_protocol_test_bindings.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4cdb0b237db33b90eccd4094c4f9217ac1cd6de7 |
--- /dev/null |
+++ b/content/shell/browser/layout_test/devtools_protocol_test_bindings.h |
@@ -0,0 +1,49 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_DEVTOOLS_PROTOCOL_TEST_BINDINGS_H_ |
+#define CONTENT_SHELL_BROWSER_LAYOUT_TEST_DEVTOOLS_PROTOCOL_TEST_BINDINGS_H_ |
+ |
+#include <memory> |
+#include <string> |
+ |
+#include "content/public/browser/devtools_agent_host_client.h" |
+#include "content/public/browser/web_contents_observer.h" |
+#include "url/gurl.h" |
+ |
+namespace content { |
+ |
+class DevToolsAgentHost; |
+class DevToolsFrontendHost; |
+ |
+class DevToolsProtocolTestBindings : public WebContentsObserver, |
+ public DevToolsAgentHostClient { |
+ public: |
+ explicit DevToolsProtocolTestBindings(WebContents* devtools); |
+ ~DevToolsProtocolTestBindings() override; |
+ static GURL GetProtocolTestURL(const GURL& test_url); |
+ |
+ private: |
+ // content::DevToolsAgentHostClient implementation. |
+ void AgentHostClosed(DevToolsAgentHost* agent_host, bool replaced) override; |
+ void DispatchProtocolMessage(DevToolsAgentHost* agent_host, |
+ const std::string& message) override; |
+ |
+ // WebContentsObserver overrides |
+ void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override; |
+ void WebContentsDestroyed() override; |
+ |
+ void HandleMessageFromTest(const std::string& message); |
+ |
+ scoped_refptr<DevToolsAgentHost> agent_host_; |
+#if !defined(OS_ANDROID) |
+ std::unique_ptr<DevToolsFrontendHost> frontend_host_; |
+#endif |
+ |
+ DISALLOW_COPY_AND_ASSIGN(DevToolsProtocolTestBindings); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_DEVTOOLS_PROTOCOL_TEST_BINDINGS_H_ |