summaryrefslogtreecommitdiffstats
path: root/chromecast
diff options
context:
space:
mode:
Diffstat (limited to 'chromecast')
-rw-r--r--chromecast/browser/cast_content_browser_client.cc8
-rw-r--r--chromecast/media/mojo/BUILD.gn1
-rw-r--r--chromecast/media/mojo/cast_mojo_media_client.cc37
-rw-r--r--chromecast/media/mojo/cast_mojo_media_client.h32
4 files changed, 54 insertions, 24 deletions
diff --git a/chromecast/browser/cast_content_browser_client.cc b/chromecast/browser/cast_content_browser_client.cc
index aea55a6..12a4754 100644
--- a/chromecast/browser/cast_content_browser_client.cc
+++ b/chromecast/browser/cast_content_browser_client.cc
@@ -52,6 +52,7 @@
#include "ui/gl/gl_switches.h"
#if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
+#include "chromecast/media/mojo/cast_mojo_media_client.h"
// nogncheck because of conditional dependency.
#include "media/mojo/services/mojo_media_application.h" // nogncheck
#endif // ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS
@@ -357,9 +358,10 @@ bool CastContentBrowserClient::CanCreateWindow(
void CastContentBrowserClient::RegisterInProcessMojoApplications(
StaticMojoApplicationMap* apps) {
#if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
- apps->insert(
- std::make_pair(GURL("mojo:media"),
- base::Bind(::media::MojoMediaApplication::CreateApp)));
+ apps->insert(std::make_pair(
+ GURL("mojo:media"),
+ base::Bind(::media::MojoMediaApplication::CreateAppWithClient,
+ base::Bind(&media::CastMojoMediaClient::Create))));
#endif
}
diff --git a/chromecast/media/mojo/BUILD.gn b/chromecast/media/mojo/BUILD.gn
index f197973..f8e8ec1 100644
--- a/chromecast/media/mojo/BUILD.gn
+++ b/chromecast/media/mojo/BUILD.gn
@@ -10,6 +10,7 @@ assert(enable_mojo_media == "browser")
source_set("mojo") {
sources = [
"cast_mojo_media_client.cc",
+ "cast_mojo_media_client.h",
]
public_deps = [
diff --git a/chromecast/media/mojo/cast_mojo_media_client.cc b/chromecast/media/mojo/cast_mojo_media_client.cc
index e239269..3a16021 100644
--- a/chromecast/media/mojo/cast_mojo_media_client.cc
+++ b/chromecast/media/mojo/cast_mojo_media_client.cc
@@ -2,31 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "media/mojo/services/mojo_media_application.h"
+#include "chromecast/media/mojo/cast_mojo_media_client.h"
-#include "media/mojo/services/mojo_media_client.h"
-
-namespace {
-class CastMojoMediaClient : public ::media::MojoMediaClient {
- public:
- CastMojoMediaClient() {}
- ~CastMojoMediaClient() override {}
+namespace chromecast {
+namespace media {
- // MojoMediaClient overrides.
- void Initialize() override {}
- scoped_ptr<::media::RendererFactory> CreateRendererFactory(
- const scoped_refptr<::media::MediaLog>& media_log) override {
- return scoped_ptr<::media::RendererFactory>();
- }
+CastMojoMediaClient::CastMojoMediaClient() {}
- private:
- DISALLOW_COPY_AND_ASSIGN(CastMojoMediaClient);
-};
-} // namespace
+CastMojoMediaClient::~CastMojoMediaClient() {}
-namespace media {
// static
-scoped_ptr<MojoMediaClient> MojoMediaClient::Create() {
- return make_scoped_ptr(new CastMojoMediaClient());
+scoped_ptr<::media::MojoMediaClient> CastMojoMediaClient::Create() {
+ return scoped_ptr<::media::MojoMediaClient>(new CastMojoMediaClient());
}
+
+void CastMojoMediaClient::Initialize() {}
+
+scoped_ptr<::media::RendererFactory> CastMojoMediaClient::CreateRendererFactory(
+ const scoped_refptr<::media::MediaLog>& /* media_log */) {
+ return scoped_ptr<::media::RendererFactory>();
+}
+
} // namespace media
+} // namespace chromecast
diff --git a/chromecast/media/mojo/cast_mojo_media_client.h b/chromecast/media/mojo/cast_mojo_media_client.h
new file mode 100644
index 0000000..1f7fcde
--- /dev/null
+++ b/chromecast/media/mojo/cast_mojo_media_client.h
@@ -0,0 +1,32 @@
+// 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 CHROMECAST_MEDIA_MOJO_CAST_MOJO_MEDIA_CLIENT_H_
+#define CHROMECAST_MEDIA_MOJO_CAST_MOJO_MEDIA_CLIENT_H_
+
+#include "media/mojo/services/mojo_media_client.h"
+
+namespace chromecast {
+namespace media {
+
+class CastMojoMediaClient : public ::media::MojoMediaClient {
+ public:
+ CastMojoMediaClient();
+ ~CastMojoMediaClient() override;
+
+ static scoped_ptr<::media::MojoMediaClient> Create();
+
+ // MojoMediaClient overrides.
+ void Initialize() override;
+ scoped_ptr<::media::RendererFactory> CreateRendererFactory(
+ const scoped_refptr<::media::MediaLog>& media_log) override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(CastMojoMediaClient);
+};
+
+} // namespace media
+} // namespace chromecast
+
+#endif // CHROMECAST_MEDIA_MOJO_CAST_MOJO_MEDIA_CLIENT_H_