| 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/presentation_service_delegate_impl.h" | 5 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 200 } |
| 201 | 201 |
| 202 PresentationFrame::~PresentationFrame() { | 202 PresentationFrame::~PresentationFrame() { |
| 203 } | 203 } |
| 204 | 204 |
| 205 void PresentationFrame::OnPresentationSessionStarted( | 205 void PresentationFrame::OnPresentationSessionStarted( |
| 206 const content::PresentationSessionInfo& session, | 206 const content::PresentationSessionInfo& session, |
| 207 const MediaRoute& route) { | 207 const MediaRoute& route) { |
| 208 presentation_id_to_route_.insert( | 208 presentation_id_to_route_.insert( |
| 209 std::make_pair(session.presentation_id, route)); | 209 std::make_pair(session.presentation_id, route)); |
| 210 router_->SetPresentationId(route.media_route_id(), session.presentation_id); |
| 210 } | 211 } |
| 211 | 212 |
| 212 const MediaRoute::Id PresentationFrame::GetRouteId( | 213 const MediaRoute::Id PresentationFrame::GetRouteId( |
| 213 const std::string& presentation_id) const { | 214 const std::string& presentation_id) const { |
| 214 auto it = presentation_id_to_route_.find(presentation_id); | 215 auto it = presentation_id_to_route_.find(presentation_id); |
| 215 return it != presentation_id_to_route_.end() ? it->second.media_route_id() | 216 return it != presentation_id_to_route_.end() ? it->second.media_route_id() |
| 216 : ""; | 217 : ""; |
| 217 } | 218 } |
| 218 | 219 |
| 219 bool PresentationFrame::SetScreenAvailabilityListener( | 220 bool PresentationFrame::SetScreenAvailabilityListener( |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 const base::ListValue* origins = | 1052 const base::ListValue* origins = |
| 1052 Profile::FromBrowserContext(web_contents_->GetBrowserContext()) | 1053 Profile::FromBrowserContext(web_contents_->GetBrowserContext()) |
| 1053 ->GetPrefs() | 1054 ->GetPrefs() |
| 1054 ->GetList(prefs::kMediaRouterTabMirroringSources); | 1055 ->GetList(prefs::kMediaRouterTabMirroringSources); |
| 1055 return origins && | 1056 return origins && |
| 1056 origins->Find(base::Value(origin.Serialize())) != origins->end(); | 1057 origins->Find(base::Value(origin.Serialize())) != origins->end(); |
| 1057 } | 1058 } |
| 1058 #endif // !defined(OS_ANDROID) | 1059 #endif // !defined(OS_ANDROID) |
| 1059 | 1060 |
| 1060 } // namespace media_router | 1061 } // namespace media_router |
| OLD | NEW |