| 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_media_sinks_observer.h" | 5 #include "chrome/browser/media/router/presentation_media_sinks_observer.h" |
| 6 | 6 |
| 7 #include "chrome/browser/media/router/media_router.h" | 7 #include "chrome/browser/media/router/media_router.h" |
| 8 #include "chrome/browser/media/router/media_source.h" | 8 #include "chrome/common/media_router/media_source.h" |
| 9 #include "content/public/browser/presentation_screen_availability_listener.h" | 9 #include "content/public/browser/presentation_screen_availability_listener.h" |
| 10 | 10 |
| 11 namespace media_router { | 11 namespace media_router { |
| 12 | 12 |
| 13 PresentationMediaSinksObserver::PresentationMediaSinksObserver( | 13 PresentationMediaSinksObserver::PresentationMediaSinksObserver( |
| 14 MediaRouter* router, | 14 MediaRouter* router, |
| 15 content::PresentationScreenAvailabilityListener* listener, | 15 content::PresentationScreenAvailabilityListener* listener, |
| 16 const MediaSource& source, | 16 const MediaSource& source, |
| 17 const url::Origin& origin) | 17 const url::Origin& origin) |
| 18 : MediaSinksObserver(router, source, origin), | 18 : MediaSinksObserver(router, source, origin), |
| (...skipping 15 matching lines...) Expand all Loading... |
| 34 << (result.empty() ? "unavailable" : "available"); | 34 << (result.empty() ? "unavailable" : "available"); |
| 35 | 35 |
| 36 // Don't send if new result is same as previous. | 36 // Don't send if new result is same as previous. |
| 37 if (previous_availablity_ != current_availability) | 37 if (previous_availablity_ != current_availability) |
| 38 listener_->OnScreenAvailabilityChanged(current_availability == AVAILABLE); | 38 listener_->OnScreenAvailabilityChanged(current_availability == AVAILABLE); |
| 39 | 39 |
| 40 previous_availablity_ = current_availability; | 40 previous_availablity_ = current_availability; |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace media_router | 43 } // namespace media_router |
| OLD | NEW |