| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 item.activity.tab_id = 0; | 198 item.activity.tab_id = 0; |
| 199 if (media_router::IsDesktopMirroringMediaSource(route.media_source())) | 199 if (media_router::IsDesktopMirroringMediaSource(route.media_source())) |
| 200 item.activity.tab_id = Activity::TabId::DESKTOP; | 200 item.activity.tab_id = Activity::TabId::DESKTOP; |
| 201 } | 201 } |
| 202 | 202 |
| 203 break; | 203 break; |
| 204 } | 204 } |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 | 207 |
| 208 FOR_EACH_OBSERVER(ash::CastConfigDelegate::Observer, observer_list_, | 208 for (ash::CastConfigDelegate::Observer& observer : observer_list_) |
| 209 OnDevicesUpdated(items)); | 209 observer.OnDevicesUpdated(items); |
| 210 } | 210 } |
| 211 | 211 |
| 212 void CastConfigDelegateMediaRouter::CastToReceiver( | 212 void CastConfigDelegateMediaRouter::CastToReceiver( |
| 213 const std::string& receiver_id) { | 213 const std::string& receiver_id) { |
| 214 // TODO(imcheng): Pass in tab casting timeout. | 214 // TODO(imcheng): Pass in tab casting timeout. |
| 215 GetMediaRouter()->CreateRoute( | 215 GetMediaRouter()->CreateRoute( |
| 216 media_router::MediaSourceForDesktop().id(), receiver_id, | 216 media_router::MediaSourceForDesktop().id(), receiver_id, |
| 217 GURL("http://cros-cast-origin/"), nullptr, | 217 GURL("http://cros-cast-origin/"), nullptr, |
| 218 std::vector<media_router::MediaRouteResponseCallback>(), | 218 std::vector<media_router::MediaRouteResponseCallback>(), |
| 219 base::TimeDelta(), false); | 219 base::TimeDelta(), false); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 232 | 232 |
| 233 void CastConfigDelegateMediaRouter::AddObserver( | 233 void CastConfigDelegateMediaRouter::AddObserver( |
| 234 ash::CastConfigDelegate::Observer* observer) { | 234 ash::CastConfigDelegate::Observer* observer) { |
| 235 observer_list_.AddObserver(observer); | 235 observer_list_.AddObserver(observer); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void CastConfigDelegateMediaRouter::RemoveObserver( | 238 void CastConfigDelegateMediaRouter::RemoveObserver( |
| 239 ash::CastConfigDelegate::Observer* observer) { | 239 ash::CastConfigDelegate::Observer* observer) { |
| 240 observer_list_.RemoveObserver(observer); | 240 observer_list_.RemoveObserver(observer); |
| 241 } | 241 } |
| OLD | NEW |