| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // Windows. It only relies on this signalling from MR on Windows to avoid | 149 // Windows. It only relies on this signalling from MR on Windows to avoid |
| 150 // triggering a firewall prompt out of the context of MR from the user's | 150 // triggering a firewall prompt out of the context of MR from the user's |
| 151 // perspective. This particular call reminds the extension to enable mDNS | 151 // perspective. This particular call reminds the extension to enable mDNS |
| 152 // discovery when it wakes up, has been upgraded, etc. | 152 // discovery when it wakes up, has been upgraded, etc. |
| 153 if (should_enable_mdns_discovery_) { | 153 if (should_enable_mdns_discovery_) { |
| 154 DoEnsureMdnsDiscoveryEnabled(); | 154 DoEnsureMdnsDiscoveryEnabled(); |
| 155 } | 155 } |
| 156 #endif | 156 #endif |
| 157 } | 157 } |
| 158 | 158 |
| 159 void MediaRouterMojoImpl::OnIssue(const mojom::IssuePtr issue) { | 159 void MediaRouterMojoImpl::OnIssue(const IssueInfo& issue) { |
| 160 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 160 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 161 DVLOG_WITH_INSTANCE(1) << "OnIssue " << issue->title; | 161 DVLOG_WITH_INSTANCE(1) << "OnIssue " << issue.title; |
| 162 const Issue& issue_converted = issue.To<Issue>(); | 162 issue_manager_.AddIssue(issue); |
| 163 issue_manager_.AddIssue(issue_converted); | |
| 164 } | 163 } |
| 165 | 164 |
| 166 void MediaRouterMojoImpl::OnSinksReceived( | 165 void MediaRouterMojoImpl::OnSinksReceived( |
| 167 const std::string& media_source, | 166 const std::string& media_source, |
| 168 std::vector<mojom::MediaSinkPtr> sinks, | 167 std::vector<mojom::MediaSinkPtr> sinks, |
| 169 const std::vector<std::string>& origins) { | 168 const std::vector<std::string>& origins) { |
| 170 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 169 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 171 DVLOG_WITH_INSTANCE(1) << "OnSinksReceived"; | 170 DVLOG_WITH_INSTANCE(1) << "OnSinksReceived"; |
| 172 auto it = sinks_queries_.find(media_source); | 171 auto it = sinks_queries_.find(media_source); |
| 173 if (it == sinks_queries_.end()) { | 172 if (it == sinks_queries_.end()) { |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 std::unique_ptr<std::vector<uint8_t>> data, | 383 std::unique_ptr<std::vector<uint8_t>> data, |
| 385 const SendRouteMessageCallback& callback) { | 384 const SendRouteMessageCallback& callback) { |
| 386 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 385 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 387 | 386 |
| 388 SetWakeReason(MediaRouteProviderWakeReason::SEND_SESSION_BINARY_MESSAGE); | 387 SetWakeReason(MediaRouteProviderWakeReason::SEND_SESSION_BINARY_MESSAGE); |
| 389 RunOrDefer(base::Bind(&MediaRouterMojoImpl::DoSendSessionBinaryMessage, | 388 RunOrDefer(base::Bind(&MediaRouterMojoImpl::DoSendSessionBinaryMessage, |
| 390 base::Unretained(this), route_id, | 389 base::Unretained(this), route_id, |
| 391 base::Passed(std::move(data)), callback)); | 390 base::Passed(std::move(data)), callback)); |
| 392 } | 391 } |
| 393 | 392 |
| 394 void MediaRouterMojoImpl::AddIssue(const Issue& issue) { | 393 void MediaRouterMojoImpl::AddIssue(const IssueInfo& issue_info) { |
| 395 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 394 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 396 issue_manager_.AddIssue(issue); | 395 issue_manager_.AddIssue(issue_info); |
| 397 } | 396 } |
| 398 | 397 |
| 399 void MediaRouterMojoImpl::ClearIssue(const Issue::Id& issue_id) { | 398 void MediaRouterMojoImpl::ClearIssue(const Issue::Id& issue_id) { |
| 400 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 399 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 401 issue_manager_.ClearIssue(issue_id); | 400 issue_manager_.ClearIssue(issue_id); |
| 402 } | 401 } |
| 403 | 402 |
| 404 void MediaRouterMojoImpl::OnUserGesture() { | 403 void MediaRouterMojoImpl::OnUserGesture() { |
| 405 // Allow MRPM to intelligently update sinks and observers by passing in a | 404 // Allow MRPM to intelligently update sinks and observers by passing in a |
| 406 // media source. | 405 // media source. |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 base::Unretained(this), source_id)); | 971 base::Unretained(this), source_id)); |
| 973 } | 972 } |
| 974 | 973 |
| 975 void MediaRouterMojoImpl::DoUpdateMediaSinks( | 974 void MediaRouterMojoImpl::DoUpdateMediaSinks( |
| 976 const MediaSource::Id& source_id) { | 975 const MediaSource::Id& source_id) { |
| 977 DVLOG_WITH_INSTANCE(1) << "DoUpdateMediaSinks" << source_id; | 976 DVLOG_WITH_INSTANCE(1) << "DoUpdateMediaSinks" << source_id; |
| 978 media_route_provider_->UpdateMediaSinks(source_id); | 977 media_route_provider_->UpdateMediaSinks(source_id); |
| 979 } | 978 } |
| 980 | 979 |
| 981 } // namespace media_router | 980 } // namespace media_router |
| OLD | NEW |