OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
6 #include "media/mojo/interfaces/service_factory.mojom.h" | 6 #include "media/mojo/interfaces/service_factory.mojom.h" |
7 #include "mojo/shell/public/cpp/application_delegate.h" | |
8 #include "mojo/shell/public/cpp/interface_factory_impl.h" | 7 #include "mojo/shell/public/cpp/interface_factory_impl.h" |
| 8 #include "mojo/shell/public/cpp/shell_client.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 | 10 |
11 namespace media { | 11 namespace media { |
12 | 12 |
13 class MediaLog; | 13 class MediaLog; |
14 class MojoMediaClient; | 14 class MojoMediaClient; |
15 | 15 |
16 class MojoMediaApplication | 16 class MojoMediaApplication |
17 : public mojo::ApplicationDelegate, | 17 : public mojo::ShellClient, |
18 public mojo::InterfaceFactory<interfaces::ServiceFactory> { | 18 public mojo::InterfaceFactory<interfaces::ServiceFactory> { |
19 public: | 19 public: |
20 static scoped_ptr<mojo::ApplicationDelegate> CreateApp(); | 20 static scoped_ptr<mojo::ShellClient> CreateApp(); |
21 | 21 |
22 explicit MojoMediaApplication(scoped_ptr<MojoMediaClient> mojo_media_client); | 22 explicit MojoMediaApplication(scoped_ptr<MojoMediaClient> mojo_media_client); |
23 ~MojoMediaApplication() final; | 23 ~MojoMediaApplication() final; |
24 | 24 |
25 private: | 25 private: |
26 // mojo::ApplicationDelegate implementation. | 26 // mojo::ShellClient implementation. |
27 void Initialize(mojo::Shell* shell, | 27 void Initialize(mojo::Shell* shell, |
28 const std::string& url, | 28 const std::string& url, |
29 uint32_t id) final; | 29 uint32_t id) final; |
30 bool AcceptConnection(mojo::ApplicationConnection* connection) final; | 30 bool AcceptConnection(mojo::Connection* connection) final; |
31 | 31 |
32 // mojo::InterfaceFactory<interfaces::ServiceFactory> implementation. | 32 // mojo::InterfaceFactory<interfaces::ServiceFactory> implementation. |
33 void Create(mojo::ApplicationConnection* connection, | 33 void Create(mojo::Connection* connection, |
34 mojo::InterfaceRequest<interfaces::ServiceFactory> request) final; | 34 mojo::InterfaceRequest<interfaces::ServiceFactory> request) final; |
35 | 35 |
36 scoped_ptr<MojoMediaClient> mojo_media_client_; | 36 scoped_ptr<MojoMediaClient> mojo_media_client_; |
37 mojo::Shell* shell_; | 37 mojo::Shell* shell_; |
38 scoped_refptr<MediaLog> media_log_; | 38 scoped_refptr<MediaLog> media_log_; |
39 }; | 39 }; |
40 | 40 |
41 } // namespace media | 41 } // namespace media |
OLD | NEW |