Index: content/renderer/presentation/presentation_dispatcher.h |
diff --git a/content/renderer/presentation/presentation_dispatcher.h b/content/renderer/presentation/presentation_dispatcher.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f9fb7539426abdfcd37dbc302f89c690993d4951 |
--- /dev/null |
+++ b/content/renderer/presentation/presentation_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_DISPATCHER_H_ |
+#define CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ |
+ |
+#include "content/common/presentation/presentation_service.mojom.h" |
+#include "content/common/presentation/presentation_service_client.mojom.h" |
+#include "content/public/renderer/render_frame_observer.h" |
+#include "third_party/WebKit/public/platform/WebPresentationClient.h" |
+ |
+namespace content { |
+ |
+// PresentationDispatcher is a delegate for Presentation API messages used by |
+// Blink. It forwards the calls to the Mojo PresentationService. |
+class PresentationDispatcher |
+ : public RenderFrameObserver, |
+ public blink::WebPresentationClient, |
mlamouri (slow - plz ping)
2015/01/15 11:40:13
You might need NON_EXPORTED_BASE() around blink::W
whywhat
2015/01/25 23:06:31
From the description, I need it if the base class
|
+ public mojo::InterfaceImpl<presentation::PresentationServiceClient> { |
+ public: |
+ explicit PresentationDispatcher(RenderFrame* render_frame); |
+ ~PresentationDispatcher() override; |
+ |
+ private: |
+ // WebPresentationClient implementation. |
+ virtual void setController( |
+ blink::WebPresentationController* controller); |
+ virtual void updateAvailableChangeWatched(bool watched); |
+ |
+ // PresentationServiceClient implementation. |
+ void DeviceAvailabilityChanged(bool available) override; |
+ |
+ void ConnectToPresentationServiceIfNeeded(); |
+ |
+ // Used as a weak reference. Can be null since lifetime is bound to the frame. |
+ blink::WebPresentationController* controller_; |
+ presentation::PresentationServicePtr presentation_service_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ |