| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // Windows. It only relies on this signalling from MR on Windows to avoid | 160 // Windows. It only relies on this signalling from MR on Windows to avoid |
| 161 // triggering a firewall prompt out of the context of MR from the user's | 161 // triggering a firewall prompt out of the context of MR from the user's |
| 162 // perspective. This particular call reminds the extension to enable mDNS | 162 // perspective. This particular call reminds the extension to enable mDNS |
| 163 // discovery when it wakes up, has been upgraded, etc. | 163 // discovery when it wakes up, has been upgraded, etc. |
| 164 if (should_enable_mdns_discovery_) { | 164 if (should_enable_mdns_discovery_) { |
| 165 DoEnsureMdnsDiscoveryEnabled(); | 165 DoEnsureMdnsDiscoveryEnabled(); |
| 166 } | 166 } |
| 167 #endif | 167 #endif |
| 168 } | 168 } |
| 169 | 169 |
| 170 void MediaRouterMojoImpl::OnIssue(const mojom::IssuePtr issue) { | 170 void MediaRouterMojoImpl::OnIssue(const IssueInfo& issue) { |
| 171 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 171 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 172 DVLOG_WITH_INSTANCE(1) << "OnIssue " << issue->title; | 172 DVLOG_WITH_INSTANCE(1) << "OnIssue " << issue.title; |
| 173 const Issue& issue_converted = issue.To<Issue>(); | 173 issue_manager_.AddIssue(issue); |
| 174 issue_manager_.AddIssue(issue_converted); | |
| 175 } | 174 } |
| 176 | 175 |
| 177 void MediaRouterMojoImpl::OnSinksReceived( | 176 void MediaRouterMojoImpl::OnSinksReceived( |
| 178 const std::string& media_source, | 177 const std::string& media_source, |
| 179 std::vector<mojom::MediaSinkPtr> sinks, | 178 std::vector<mojom::MediaSinkPtr> sinks, |
| 180 const std::vector<std::string>& origins) { | 179 const std::vector<std::string>& origins) { |
| 181 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 180 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 182 DVLOG_WITH_INSTANCE(1) << "OnSinksReceived"; | 181 DVLOG_WITH_INSTANCE(1) << "OnSinksReceived"; |
| 183 auto it = sinks_queries_.find(media_source); | 182 auto it = sinks_queries_.find(media_source); |
| 184 if (it == sinks_queries_.end()) { | 183 if (it == sinks_queries_.end()) { |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 std::unique_ptr<std::vector<uint8_t>> data, | 398 std::unique_ptr<std::vector<uint8_t>> data, |
| 400 const SendRouteMessageCallback& callback) { | 399 const SendRouteMessageCallback& callback) { |
| 401 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 400 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 402 | 401 |
| 403 SetWakeReason(MediaRouteProviderWakeReason::SEND_SESSION_BINARY_MESSAGE); | 402 SetWakeReason(MediaRouteProviderWakeReason::SEND_SESSION_BINARY_MESSAGE); |
| 404 RunOrDefer(base::Bind(&MediaRouterMojoImpl::DoSendSessionBinaryMessage, | 403 RunOrDefer(base::Bind(&MediaRouterMojoImpl::DoSendSessionBinaryMessage, |
| 405 base::Unretained(this), route_id, | 404 base::Unretained(this), route_id, |
| 406 base::Passed(std::move(data)), callback)); | 405 base::Passed(std::move(data)), callback)); |
| 407 } | 406 } |
| 408 | 407 |
| 409 void MediaRouterMojoImpl::AddIssue(const Issue& issue) { | 408 void MediaRouterMojoImpl::AddIssue(const IssueInfo& issue_info) { |
| 410 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 409 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 411 issue_manager_.AddIssue(issue); | 410 issue_manager_.AddIssue(issue_info); |
| 412 } | 411 } |
| 413 | 412 |
| 414 void MediaRouterMojoImpl::ClearIssue(const Issue::Id& issue_id) { | 413 void MediaRouterMojoImpl::ClearIssue(const Issue::Id& issue_id) { |
| 415 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 414 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 416 issue_manager_.ClearIssue(issue_id); | 415 issue_manager_.ClearIssue(issue_id); |
| 417 } | 416 } |
| 418 | 417 |
| 419 void MediaRouterMojoImpl::OnUserGesture() { | 418 void MediaRouterMojoImpl::OnUserGesture() { |
| 420 // Allow MRPM to intelligently update sinks and observers by passing in a | 419 // Allow MRPM to intelligently update sinks and observers by passing in a |
| 421 // media source. | 420 // media source. |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 base::Unretained(this), source_id)); | 986 base::Unretained(this), source_id)); |
| 988 } | 987 } |
| 989 | 988 |
| 990 void MediaRouterMojoImpl::DoUpdateMediaSinks( | 989 void MediaRouterMojoImpl::DoUpdateMediaSinks( |
| 991 const MediaSource::Id& source_id) { | 990 const MediaSource::Id& source_id) { |
| 992 DVLOG_WITH_INSTANCE(1) << "DoUpdateMediaSinks" << source_id; | 991 DVLOG_WITH_INSTANCE(1) << "DoUpdateMediaSinks" << source_id; |
| 993 media_route_provider_->UpdateMediaSinks(source_id); | 992 media_route_provider_->UpdateMediaSinks(source_id); |
| 994 } | 993 } |
| 995 | 994 |
| 996 } // namespace media_router | 995 } // namespace media_router |
| OLD | NEW |