| 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 "components/html_viewer/media_factory.h" | 5 #include "components/html_viewer/media_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 151 } |
| 152 | 152 |
| 153 media_service_provider_.reset( | 153 media_service_provider_.reset( |
| 154 new MojoMediaServiceProvider(mojo_service_provider_ptr_.get())); | 154 new MojoMediaServiceProvider(mojo_service_provider_ptr_.get())); |
| 155 } | 155 } |
| 156 | 156 |
| 157 return media_service_provider_.get(); | 157 return media_service_provider_.get(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 media::MediaPermission* MediaFactory::GetMediaPermission() { | 160 media::MediaPermission* MediaFactory::GetMediaPermission() { |
| 161 // TODO(xhwang): Replace DefaultMediaPermission with something real when |
| 162 // permissions are supported in html_viewer. |
| 161 if (!media_permission_) | 163 if (!media_permission_) |
| 162 media_permission_.reset(new media::DefaultMediaPermission(true)); | 164 media_permission_.reset(new media::DefaultMediaPermission(true)); |
| 163 return media_permission_.get(); | 165 return media_permission_.get(); |
| 164 } | 166 } |
| 165 | 167 |
| 166 media::CdmFactory* MediaFactory::GetCdmFactory() { | 168 media::CdmFactory* MediaFactory::GetCdmFactory() { |
| 167 if (!cdm_factory_) | 169 if (!cdm_factory_) |
| 168 cdm_factory_.reset(new media::DefaultCdmFactory()); | 170 cdm_factory_.reset(new media::DefaultCdmFactory()); |
| 169 return cdm_factory_.get(); | 171 return cdm_factory_.get(); |
| 170 } | 172 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 184 scoped_refptr<base::SingleThreadTaskRunner> | 186 scoped_refptr<base::SingleThreadTaskRunner> |
| 185 MediaFactory::GetMediaThreadTaskRunner() { | 187 MediaFactory::GetMediaThreadTaskRunner() { |
| 186 if (!media_thread_.IsRunning()) | 188 if (!media_thread_.IsRunning()) |
| 187 media_thread_.Start(); | 189 media_thread_.Start(); |
| 188 | 190 |
| 189 return media_thread_.message_loop_proxy(); | 191 return media_thread_.message_loop_proxy(); |
| 190 } | 192 } |
| 191 #endif // !defined(OS_ANDROID) | 193 #endif // !defined(OS_ANDROID) |
| 192 | 194 |
| 193 } // namespace html_viewer | 195 } // namespace html_viewer |
| OLD | NEW |