| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/media/cast_remoting_connector.h" | 5 #include "chrome/browser/media/cast_remoting_connector.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 if (!contents) | 161 if (!contents) |
| 162 return; | 162 return; |
| 163 CastRemotingConnector::Get(contents)->CreateBridge(std::move(source), | 163 CastRemotingConnector::Get(contents)->CreateBridge(std::move(source), |
| 164 std::move(request)); | 164 std::move(request)); |
| 165 } | 165 } |
| 166 | 166 |
| 167 namespace { | 167 namespace { |
| 168 RemotingSinkCapabilities GetFeatureEnabledCapabilities() { | 168 RemotingSinkCapabilities GetFeatureEnabledCapabilities() { |
| 169 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 169 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 170 if (base::FeatureList::IsEnabled(features::kMediaRemoting)) { | 170 if (base::FeatureList::IsEnabled(features::kMediaRemoting)) { |
| 171 if (base::FeatureList::IsEnabled(features::kMediaRemotingEncrypted)) | |
| 172 return RemotingSinkCapabilities::CONTENT_DECRYPTION_AND_RENDERING; | |
| 173 return RemotingSinkCapabilities::RENDERING_ONLY; | 171 return RemotingSinkCapabilities::RENDERING_ONLY; |
| 174 } | 172 } |
| 175 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) | 173 #endif // !defined(OS_ANDROID) && !defined(OS_IOS) |
| 176 return RemotingSinkCapabilities::NONE; | 174 return RemotingSinkCapabilities::NONE; |
| 177 } | 175 } |
| 178 } // namespace | 176 } // namespace |
| 179 | 177 |
| 180 CastRemotingConnector::CastRemotingConnector( | 178 CastRemotingConnector::CastRemotingConnector( |
| 181 media_router::MediaRouter* router, | 179 media_router::MediaRouter* router, |
| 182 const media_router::MediaSource::Id& media_source_id) | 180 const media_router::MediaSource::Id& media_source_id) |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 media_router::MediaRoutesObserver::router(), route.media_route_id(), | 505 media_router::MediaRoutesObserver::router(), route.media_route_id(), |
| 508 this)); | 506 this)); |
| 509 // TODO(miu): In the future, scan the route ID for sink capabilities | 507 // TODO(miu): In the future, scan the route ID for sink capabilities |
| 510 // properties and pass these to the source in the OnSinkAvailable() | 508 // properties and pass these to the source in the OnSinkAvailable() |
| 511 // notification. | 509 // notification. |
| 512 for (RemotingBridge* notifyee : bridges_) | 510 for (RemotingBridge* notifyee : bridges_) |
| 513 notifyee->OnSinkAvailable(enabled_features_); | 511 notifyee->OnSinkAvailable(enabled_features_); |
| 514 break; | 512 break; |
| 515 } | 513 } |
| 516 } | 514 } |
| OLD | NEW |