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

Unified Diff: content/renderer/presentation/presentation_dispatcher.h

Issue 839773002: Plumbing from WebPresentationClient to the Presentation Mojo service for (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comment Created 5 years, 11 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 | « content/renderer/presentation/OWNERS ('k') | content/renderer/presentation/presentation_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9284b4ee5e09e1036a3904cc97f075fdf228ea1a
--- /dev/null
+++ b/content/renderer/presentation/presentation_dispatcher.h
@@ -0,0 +1,40 @@
+// 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/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 {
+ public:
+ explicit PresentationDispatcher(RenderFrame* render_frame);
+ ~PresentationDispatcher() override;
+
+ private:
+ // WebPresentationClient implementation.
+ virtual void setController(
+ blink::WebPresentationController* controller);
+ virtual void updateAvailableChangeWatched(bool watched);
+
+ void OnScreenAvailabilityChanged(bool available);
+
+ 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_
« no previous file with comments | « content/renderer/presentation/OWNERS ('k') | content/renderer/presentation/presentation_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698