Index: content/renderer/presentation/presentation_session_dispatcher.h |
diff --git a/content/renderer/presentation/presentation_session_dispatcher.h b/content/renderer/presentation/presentation_session_dispatcher.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7fc79cac570ff45a08e314fe73b8df8022c7bd35 |
--- /dev/null |
+++ b/content/renderer/presentation/presentation_session_dispatcher.h |
@@ -0,0 +1,43 @@ |
+// 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 CONTENT_RENDERER_PRESENTATION_PRESENTATION_SESSION_DISPATCHER_H_ |
+#define CONTENT_RENDERER_PRESENTATION_PRESENTATION_SESSION_DISPATCHER_H_ |
+ |
+#include <string> |
+ |
+#include "base/compiler_specific.h" |
+#include "content/common/content_export.h" |
+#include "content/common/presentation/presentation_session.mojom.h" |
+#include "third_party/WebKit/public/platform/modules/presentation/WebPresentationSessionClient.h" |
+ |
+namespace content { |
+ |
+// PresentationSessionDispatcher is a delegate for Presentation API messages |
+// used by Blink. It forwards the calls from the PresentationSession JS objects |
+// to the corresponding Mojo PresentationSession remote objects. |
+class CONTENT_EXPORT PresentationSessionDispatcher |
+ : public presentation::PresentationSession |
+ , public NON_EXPORTED_BASE(blink::WebPresentationSessionClient) { |
+ public: |
+ PresentationSessionDispatcher( |
+ mojo::InterfaceRequest<presentation::PresentationSession> session_request, |
+ const std::string& url, |
+ const std::string& id); |
+ ~PresentationSessionDispatcher() override; |
+ |
+ private: |
+ // WebPresentationSessionClient implementation. |
+ virtual blink::WebString getUrl(); |
+ virtual blink::WebString getId(); |
+ |
+ mojo::Binding<presentation::PresentationSession> session_binding_; |
+ |
+ std::string url_; |
+ std::string id_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_SESSION_DISPATCHER_H_ |