| 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/ui/ash/cast_config_delegate_media_router.h" | 5 #include "chrome/browser/ui/ash/cast_config_delegate_media_router.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/media/router/media_router.h" | 10 #include "chrome/browser/media/router/media_router.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 // Not owned. | 74 // Not owned. |
| 75 ash::CastConfigDelegate* cast_config_delegate_; | 75 ash::CastConfigDelegate* cast_config_delegate_; |
| 76 | 76 |
| 77 DISALLOW_COPY_AND_ASSIGN(CastDeviceCache); | 77 DISALLOW_COPY_AND_ASSIGN(CastDeviceCache); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 CastDeviceCache::CastDeviceCache(ash::CastConfigDelegate* cast_config_delegate) | 80 CastDeviceCache::CastDeviceCache(ash::CastConfigDelegate* cast_config_delegate) |
| 81 : MediaRoutesObserver(GetMediaRouter()), | 81 : MediaRoutesObserver(GetMediaRouter()), |
| 82 MediaSinksObserver(GetMediaRouter(), | 82 MediaSinksObserver(GetMediaRouter(), |
| 83 media_router::MediaSourceForDesktop()), | 83 media_router::MediaSourceForDesktop(), |
| 84 cast_config_delegate_(cast_config_delegate) { | 84 media_router::OriginForDesktop()), |
| 85 } | 85 cast_config_delegate_(cast_config_delegate) {} |
| 86 | 86 |
| 87 CastDeviceCache::~CastDeviceCache() {} | 87 CastDeviceCache::~CastDeviceCache() {} |
| 88 | 88 |
| 89 void CastDeviceCache::Init() { | 89 void CastDeviceCache::Init() { |
| 90 CHECK(MediaSinksObserver::Init()); | 90 CHECK(MediaSinksObserver::Init()); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void CastDeviceCache::OnSinksReceived(const MediaSinks& sinks) { | 93 void CastDeviceCache::OnSinksReceived(const MediaSinks& sinks) { |
| 94 sinks_ = sinks; | 94 sinks_ = sinks; |
| 95 cast_config_delegate_->RequestDeviceRefresh(); | 95 cast_config_delegate_->RequestDeviceRefresh(); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 void CastConfigDelegateMediaRouter::AddObserver( | 212 void CastConfigDelegateMediaRouter::AddObserver( |
| 213 ash::CastConfigDelegate::Observer* observer) { | 213 ash::CastConfigDelegate::Observer* observer) { |
| 214 observer_list_.AddObserver(observer); | 214 observer_list_.AddObserver(observer); |
| 215 } | 215 } |
| 216 | 216 |
| 217 void CastConfigDelegateMediaRouter::RemoveObserver( | 217 void CastConfigDelegateMediaRouter::RemoveObserver( |
| 218 ash::CastConfigDelegate::Observer* observer) { | 218 ash::CastConfigDelegate::Observer* observer) { |
| 219 observer_list_.RemoveObserver(observer); | 219 observer_list_.RemoveObserver(observer); |
| 220 } | 220 } |
| OLD | NEW |