Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTES_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTES_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTES_OBSERVER_H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTES_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chrome/browser/media/router/media_route.h" | 11 #include "chrome/browser/media/router/media_route.h" |
| 12 | 12 |
| 13 namespace media_router { | 13 namespace media_router { |
| 14 | 14 |
| 15 class MediaRouter; | 15 class MediaRouter; |
| 16 | 16 |
| 17 // Base class for observing when the set of MediaRoutes and their associated | 17 // Base class for observing when the set of MediaRoutes and their associated |
| 18 // MediaSinks have been updated. | 18 // MediaSinks have been updated. |
| 19 class MediaRoutesObserver { | 19 class MediaRoutesObserver { |
| 20 public: | 20 public: |
| 21 explicit MediaRoutesObserver(MediaRouter* router); | 21 explicit MediaRoutesObserver(MediaRouter* router, |
| 22 const MediaSource::Id source_id = std::string("")); | |
|
imcheng
2015/11/19 18:55:08
const MediaSource::Id& source_id = MediaSource::Id
matt.boetger
2015/11/24 19:45:23
Done.
| |
| 22 virtual ~MediaRoutesObserver(); | 23 virtual ~MediaRoutesObserver(); |
| 23 | 24 |
| 24 // Invoked when the list of routes and their associated sinks have been | 25 // Invoked when the list of routes and their associated sinks have been |
|
imcheng
2015/11/19 18:55:08
Could you update comments?
matt.boetger
2015/11/24 19:45:23
Done.
| |
| 25 // updated. | 26 // updated. |
| 26 // Implementations may not perform operations that modify the Media Router's | 27 // Implementations may not perform operations that modify the Media Router's |
| 27 // observer list. In particular, invoking this observer's destructor within | 28 // observer list. In particular, invoking this observer's destructor within |
| 28 // OnRoutesUpdated will result in undefined behavior. | 29 // OnRoutesUpdated will result in undefined behavior. |
| 29 virtual void OnRoutesUpdated(const std::vector<MediaRoute>& routes) {} | 30 virtual void OnRoutesUpdated( |
| 31 const MediaSource::Id source_id, | |
|
imcheng
2015/11/19 18:55:08
Is |source_id| needed? MR should ensure that |sour
matt.boetger
2015/11/24 19:45:23
Done.
| |
| 32 const std::vector<MediaRoute>& routes, | |
| 33 const std::vector<MediaRoute>& joinable_routes) {} | |
| 34 | |
| 35 const MediaSource::Id source_id() const { return source_id_; } | |
| 30 | 36 |
| 31 private: | 37 private: |
| 32 MediaRouter* router_; | 38 MediaRouter* router_; |
| 39 const MediaSource::Id source_id_; | |
| 33 | 40 |
| 34 DISALLOW_COPY_AND_ASSIGN(MediaRoutesObserver); | 41 DISALLOW_COPY_AND_ASSIGN(MediaRoutesObserver); |
| 35 }; | 42 }; |
| 36 | 43 |
| 37 } // namespace media_router | 44 } // namespace media_router |
| 38 | 45 |
| 39 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTES_OBSERVER_H_ | 46 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTES_OBSERVER_H_ |
| OLD | NEW |