| 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 24 matching lines...) Expand all Loading... |
| 35 return blink::WebPresentationError::ErrorTypeNoPresentationFound; | 35 return blink::WebPresentationError::ErrorTypeNoPresentationFound; |
| 36 case presentation::PRESENTATION_ERROR_TYPE_UNKNOWN: | 36 case presentation::PRESENTATION_ERROR_TYPE_UNKNOWN: |
| 37 default: | 37 default: |
| 38 return blink::WebPresentationError::ErrorTypeUnknown; | 38 return blink::WebPresentationError::ErrorTypeUnknown; |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 | 41 |
| 42 blink::WebPresentationConnectionState GetWebPresentationConnectionStateFromMojo( | 42 blink::WebPresentationConnectionState GetWebPresentationConnectionStateFromMojo( |
| 43 presentation::PresentationConnectionState mojoSessionState) { | 43 presentation::PresentationConnectionState mojoSessionState) { |
| 44 switch (mojoSessionState) { | 44 switch (mojoSessionState) { |
| 45 // TODO(imcheng): Add Connecting state to Blink (crbug.com/575351). |
| 45 case presentation::PRESENTATION_CONNECTION_STATE_CONNECTED: | 46 case presentation::PRESENTATION_CONNECTION_STATE_CONNECTED: |
| 46 return blink::WebPresentationConnectionState::Connected; | 47 return blink::WebPresentationConnectionState::Connected; |
| 47 case presentation::PRESENTATION_CONNECTION_STATE_CLOSED: | 48 case presentation::PRESENTATION_CONNECTION_STATE_CLOSED: |
| 48 return blink::WebPresentationConnectionState::Closed; | 49 return blink::WebPresentationConnectionState::Closed; |
| 49 case presentation::PRESENTATION_CONNECTION_STATE_TERMINATED: | 50 case presentation::PRESENTATION_CONNECTION_STATE_TERMINATED: |
| 50 return blink::WebPresentationConnectionState::Terminated; | 51 return blink::WebPresentationConnectionState::Terminated; |
| 52 default: |
| 53 NOTREACHED(); |
| 54 return blink::WebPresentationConnectionState::Terminated; |
| 51 } | 55 } |
| 52 | |
| 53 NOTREACHED(); | |
| 54 return blink::WebPresentationConnectionState::Terminated; | |
| 55 } | 56 } |
| 56 | 57 |
| 57 } // namespace | 58 } // namespace |
| 58 | 59 |
| 59 namespace content { | 60 namespace content { |
| 60 | 61 |
| 61 PresentationDispatcher::PresentationDispatcher(RenderFrame* render_frame) | 62 PresentationDispatcher::PresentationDispatcher(RenderFrame* render_frame) |
| 62 : RenderFrameObserver(render_frame), | 63 : RenderFrameObserver(render_frame), |
| 63 controller_(nullptr), | 64 controller_(nullptr), |
| 64 binding_(this) { | 65 binding_(this) { |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 PresentationDispatcher::AvailabilityStatus::AvailabilityStatus( | 502 PresentationDispatcher::AvailabilityStatus::AvailabilityStatus( |
| 502 const std::string& availability_url) | 503 const std::string& availability_url) |
| 503 : url(availability_url), | 504 : url(availability_url), |
| 504 last_known_availability(false), | 505 last_known_availability(false), |
| 505 listening_state(ListeningState::INACTIVE) {} | 506 listening_state(ListeningState::INACTIVE) {} |
| 506 | 507 |
| 507 PresentationDispatcher::AvailabilityStatus::~AvailabilityStatus() { | 508 PresentationDispatcher::AvailabilityStatus::~AvailabilityStatus() { |
| 508 } | 509 } |
| 509 | 510 |
| 510 } // namespace content | 511 } // namespace content |
| OLD | NEW |