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 "content/renderer/presentation/presentation_dispatcher.h" | 5 #include "content/renderer/presentation/presentation_dispatcher.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 if (!controller_) | 365 if (!controller_) |
366 return; | 366 return; |
367 | 367 |
368 if (!session_info.is_null()) { | 368 if (!session_info.is_null()) { |
369 presentation_service_->ListenForSessionMessages(session_info.Clone()); | 369 presentation_service_->ListenForSessionMessages(session_info.Clone()); |
370 controller_->didStartDefaultSession( | 370 controller_->didStartDefaultSession( |
371 new PresentationConnectionClient(std::move(session_info))); | 371 new PresentationConnectionClient(std::move(session_info))); |
372 } | 372 } |
373 } | 373 } |
374 | 374 |
| 375 void PresentationDispatcher::OnReceiverConnectionAvailable( |
| 376 blink::mojom::PresentationSessionInfoPtr connection) { |
| 377 // TODO(imcheng): Plumb this through Blink (crbug.com/513859). |
| 378 NOTIMPLEMENTED(); |
| 379 } |
| 380 |
375 void PresentationDispatcher::OnSessionCreated( | 381 void PresentationDispatcher::OnSessionCreated( |
376 blink::WebPresentationConnectionClientCallbacks* callback, | 382 blink::WebPresentationConnectionClientCallbacks* callback, |
377 blink::mojom::PresentationSessionInfoPtr session_info, | 383 blink::mojom::PresentationSessionInfoPtr session_info, |
378 blink::mojom::PresentationErrorPtr error) { | 384 blink::mojom::PresentationErrorPtr error) { |
379 DCHECK(callback); | 385 DCHECK(callback); |
380 if (!error.is_null()) { | 386 if (!error.is_null()) { |
381 DCHECK(session_info.is_null()); | 387 DCHECK(session_info.is_null()); |
382 callback->onError(blink::WebPresentationError( | 388 callback->onError(blink::WebPresentationError( |
383 GetWebPresentationErrorTypeFromMojo(error->error_type), | 389 GetWebPresentationErrorTypeFromMojo(error->error_type), |
384 blink::WebString::fromUTF8(error->message))); | 390 blink::WebString::fromUTF8(error->message))); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 PresentationDispatcher::AvailabilityStatus::AvailabilityStatus( | 534 PresentationDispatcher::AvailabilityStatus::AvailabilityStatus( |
529 const std::string& availability_url) | 535 const std::string& availability_url) |
530 : url(availability_url), | 536 : url(availability_url), |
531 last_known_availability(false), | 537 last_known_availability(false), |
532 listening_state(ListeningState::INACTIVE) {} | 538 listening_state(ListeningState::INACTIVE) {} |
533 | 539 |
534 PresentationDispatcher::AvailabilityStatus::~AvailabilityStatus() { | 540 PresentationDispatcher::AvailabilityStatus::~AvailabilityStatus() { |
535 } | 541 } |
536 | 542 |
537 } // namespace content | 543 } // namespace content |
OLD | NEW |