| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 // Not owned. | 77 // Not owned. |
| 78 ash::CastConfigDelegate* cast_config_delegate_; | 78 ash::CastConfigDelegate* cast_config_delegate_; |
| 79 | 79 |
| 80 DISALLOW_COPY_AND_ASSIGN(CastDeviceCache); | 80 DISALLOW_COPY_AND_ASSIGN(CastDeviceCache); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 CastDeviceCache::CastDeviceCache(ash::CastConfigDelegate* cast_config_delegate) | 83 CastDeviceCache::CastDeviceCache(ash::CastConfigDelegate* cast_config_delegate) |
| 84 : MediaRoutesObserver(GetMediaRouter()), | 84 : MediaRoutesObserver(GetMediaRouter()), |
| 85 MediaSinksObserver(GetMediaRouter(), | 85 MediaSinksObserver(GetMediaRouter(), |
| 86 media_router::MediaSourceForDesktop()), | 86 media_router::MediaSourceForDesktop(), |
| 87 cast_config_delegate_(cast_config_delegate) { | 87 media_router::OriginForDesktop()), |
| 88 } | 88 cast_config_delegate_(cast_config_delegate) {} |
| 89 | 89 |
| 90 CastDeviceCache::~CastDeviceCache() {} | 90 CastDeviceCache::~CastDeviceCache() {} |
| 91 | 91 |
| 92 void CastDeviceCache::Init() { | 92 void CastDeviceCache::Init() { |
| 93 CHECK(MediaSinksObserver::Init()); | 93 CHECK(MediaSinksObserver::Init()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void CastDeviceCache::OnSinksReceived(const MediaSinks& sinks) { | 96 void CastDeviceCache::OnSinksReceived(const MediaSinks& sinks) { |
| 97 sinks_ = sinks; | 97 sinks_ = sinks; |
| 98 cast_config_delegate_->RequestDeviceRefresh(); | 98 cast_config_delegate_->RequestDeviceRefresh(); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 216 |
| 217 void CastConfigDelegateMediaRouter::AddObserver( | 217 void CastConfigDelegateMediaRouter::AddObserver( |
| 218 ash::CastConfigDelegate::Observer* observer) { | 218 ash::CastConfigDelegate::Observer* observer) { |
| 219 observer_list_.AddObserver(observer); | 219 observer_list_.AddObserver(observer); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void CastConfigDelegateMediaRouter::RemoveObserver( | 222 void CastConfigDelegateMediaRouter::RemoveObserver( |
| 223 ash::CastConfigDelegate::Observer* observer) { | 223 ash::CastConfigDelegate::Observer* observer) { |
| 224 observer_list_.RemoveObserver(observer); | 224 observer_list_.RemoveObserver(observer); |
| 225 } | 225 } |
| OLD | NEW |