OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/router/mojo/media_router_mojo_impl.h" | 5 #include "chrome/browser/media/router/mojo/media_router_mojo_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 } | 1014 } |
1015 | 1015 |
1016 void MediaRouterMojoImpl::OnMediaControllerCreated( | 1016 void MediaRouterMojoImpl::OnMediaControllerCreated( |
1017 const MediaRoute::Id& route_id, | 1017 const MediaRoute::Id& route_id, |
1018 bool success) { | 1018 bool success) { |
1019 DVLOG_WITH_INSTANCE(1) << "OnMediaControllerCreated: " << route_id | 1019 DVLOG_WITH_INSTANCE(1) << "OnMediaControllerCreated: " << route_id |
1020 << (success ? " was successful." : " failed."); | 1020 << (success ? " was successful." : " failed."); |
1021 MediaRouterMojoMetrics::RecordMediaRouteControllerCreationResult(success); | 1021 MediaRouterMojoMetrics::RecordMediaRouteControllerCreationResult(success); |
1022 } | 1022 } |
1023 | 1023 |
| 1024 void MediaRouterMojoImpl::OnMediaRemoterCreated( |
| 1025 int32_t tab_id, |
| 1026 media::mojom::MirrorServiceRemoterPtr remoter, |
| 1027 media::mojom::MirrorServiceRemotingSourceRequest source_request) { |
| 1028 DVLOG_WITH_INSTANCE(1) << __func__ << ": tab_id = " << tab_id; |
| 1029 |
| 1030 auto it = remoting_sources_.find(tab_id); |
| 1031 if (it == remoting_sources_.end()) { |
| 1032 LOG(WARNING) << __func__ |
| 1033 << ": No registered remoting source for tab_id = " << tab_id; |
| 1034 return; |
| 1035 } |
| 1036 |
| 1037 CastRemotingConnector* connector = it->second; |
| 1038 connector->ConnectToService(std::move(source_request), std::move(remoter)); |
| 1039 } |
| 1040 |
1024 } // namespace media_router | 1041 } // namespace media_router |
OLD | NEW |