Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / media / mojo / services / mojo_media_application.cc
blobfb34c80d57ad7084c5ad55013457ddfc86222ec5
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "media/mojo/services/mojo_media_application.h"
7 #include "base/logging.h"
8 #include "media/base/media_log.h"
9 #include "media/mojo/services/service_factory_impl.h"
10 #include "mojo/application/public/cpp/application_connection.h"
11 #include "mojo/application/public/cpp/application_impl.h"
13 namespace media {
15 const char kMojoMediaAppUrl[] = "mojo:media";
17 // static
18 GURL MojoMediaApplication::AppUrl() {
19 return GURL(kMojoMediaAppUrl);
22 // static
23 scoped_ptr<mojo::ApplicationDelegate> MojoMediaApplication::CreateApp() {
24 return scoped_ptr<mojo::ApplicationDelegate>(new MojoMediaApplication());
27 // TODO(xhwang): Hook up MediaLog when possible.
28 MojoMediaApplication::MojoMediaApplication() : media_log_(new MediaLog()) {
31 MojoMediaApplication::~MojoMediaApplication() {
34 void MojoMediaApplication::Initialize(mojo::ApplicationImpl* app) {
35 logging::LoggingSettings settings;
36 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
37 logging::InitLogging(settings);
38 // Display process ID, thread ID and timestamp in logs.
39 logging::SetLogItems(true, true, true, false);
42 bool MojoMediaApplication::ConfigureIncomingConnection(
43 mojo::ApplicationConnection* connection) {
44 connection->AddService<interfaces::ServiceFactory>(this);
45 return true;
48 void MojoMediaApplication::Create(
49 mojo::ApplicationConnection* connection,
50 mojo::InterfaceRequest<interfaces::ServiceFactory> request) {
51 // The created object is owned by the pipe.
52 new ServiceFactoryImpl(request.Pass(), connection->GetServiceProvider(),
53 media_log_);
56 } // namespace media