Index: content/browser/media/android/media_session_service.h |
diff --git a/content/browser/media/android/media_session_service.h b/content/browser/media/android/media_session_service.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..60092d30819067e9fcb5e8b234e77733cf6988a5 |
--- /dev/null |
+++ b/content/browser/media/android/media_session_service.h |
@@ -0,0 +1,42 @@ |
+// Copyright 2016 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_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_SERVICE_H_ |
+#define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_SERVICE_H_ |
+ |
+#include "mojo/public/cpp/bindings/binding.h" |
+#include "third_party/WebKit/public/platform/modules/mediasession/media_session.mojom.h" |
+ |
+namespace content { |
+ |
+class RenderFrameHost; |
+ |
+class MediaSessionService |
+ : public NON_EXPORTED_BASE(blink::mojom::MediaSession) { |
+ public: |
+ ~MediaSessionService() override; |
+ |
+ static void Create(RenderFrameHost* render_frame_host, |
+ blink::mojom::MediaSessionRequest request); |
+ |
+ private: |
+ explicit MediaSessionService(RenderFrameHost* render_frame_host); |
+ |
+ void SetMetadata( |
+ const base::Optional<content::MediaMetadata>& metadata) override; |
+ |
+ void Bind(mojo::InterfaceRequest<blink::mojom::MediaSession> request); |
+ |
+ RenderFrameHost* render_frame_host_; |
+ |
+ // RAII binding of |this| to an MediaSession interface request. |
+ // The binding is removed when binding_ is cleared or goes out of scope. |
+ std::unique_ptr<mojo::Binding<blink::mojom::MediaSession>> binding_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(MediaSessionService); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_SERVICE_H_ |