Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: components/html_viewer/devtools_agent_impl.h

Issue 1163953002: html_viewer: Add DevToolsAgentImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't create DevToolsAgentImpl instance unless --remote-debugging-port is specified Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/html_viewer/DEPS ('k') | components/html_viewer/devtools_agent_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/html_viewer/devtools_agent_impl.h
diff --git a/components/html_viewer/devtools_agent_impl.h b/components/html_viewer/devtools_agent_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..53074ce6d7df85fed545204b747650c675cc62dc
--- /dev/null
+++ b/components/html_viewer/devtools_agent_impl.h
@@ -0,0 +1,56 @@
+// Copyright 2015 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 COMPONENTS_HTML_VIEWER_DEVTOOLS_AGENT_IMPL_H_
+#define COMPONENTS_HTML_VIEWER_DEVTOOLS_AGENT_IMPL_H_
+
+#include "base/macros.h"
+#include "components/devtools_service/public/interfaces/devtools_service.mojom.h"
+#include "third_party/WebKit/public/web/WebDevToolsAgentClient.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h"
+
+namespace blink {
+class WebLocalFrame;
+}
+
+namespace mojo {
+class Shell;
+}
+
+namespace html_viewer {
+
+class DevToolsAgentImpl : public devtools_service::DevToolsAgent,
+ public blink::WebDevToolsAgentClient,
+ public mojo::ErrorHandler {
+ public:
+ // |frame| must outlive this object.
+ DevToolsAgentImpl(blink::WebLocalFrame* frame, mojo::Shell* shell);
+ ~DevToolsAgentImpl() override;
+
+ blink::WebLocalFrame* frame() const { return frame_; }
+
+ private:
+ // devtools_service::DevToolsAgent implementation.
+ void SetClient(devtools_service::DevToolsAgentClientPtr client,
+ const mojo::String& client_id) override;
+ void DispatchProtocolMessage(const mojo::String& message) override;
+
+ // blink::WebDevToolsAgentClient implementation.
+ void sendProtocolMessage(int call_id,
+ const blink::WebString& response,
+ const blink::WebString& state);
+
+ // mojo::ErrorHandler implementation.
+ void OnConnectionError() override;
+
+ blink::WebLocalFrame* const frame_;
+ mojo::Binding<DevToolsAgent> binding_;
+ devtools_service::DevToolsAgentClientPtr client_;
+
+ DISALLOW_COPY_AND_ASSIGN(DevToolsAgentImpl);
+};
+
+} // namespace html_viewer
+
+#endif // COMPONENTS_HTML_VIEWER_DEVTOOLS_AGENT_IMPL_H_
« no previous file with comments | « components/html_viewer/DEPS ('k') | components/html_viewer/devtools_agent_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698