Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_OBSERVER_H_ | |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_OBSERVER_H_ | |
| 7 | |
| 8 #include <map> | |
|
Kevin M
2015/03/26 20:50:14
Not needed
imcheng
2015/03/26 23:33:13
Done.
| |
| 9 #include <set> | |
| 10 #include <vector> | |
|
Kevin M
2015/03/26 20:50:15
Not needed
imcheng
2015/03/26 23:33:13
Done.
| |
| 11 | |
| 12 #include "chrome/browser/media/router/media_route.h" | |
|
Kevin M
2015/03/26 20:50:14
Not needed
imcheng
2015/03/26 23:33:13
Done.
| |
| 13 #include "chrome/browser/media/router/media_sink.h" | |
| 14 #include "chrome/browser/media/router/media_source.h" | |
| 15 | |
| 16 namespace media_router { | |
| 17 | |
| 18 struct SinksQueryResult { | |
| 19 SinksQueryResult(); | |
|
Kevin M
2015/03/26 20:50:14
No ctor/dtor
imcheng
2015/03/26 23:33:13
Needed by compiler.
| |
| 20 ~SinksQueryResult(); | |
| 21 | |
| 22 std::vector<MediaSink> sinks; | |
| 23 }; | |
| 24 | |
| 25 // Interface for observing when the set of sinks compatible with a MediaSource | |
|
Kevin M
2015/03/26 20:50:15
"set" => list || collection
imcheng
2015/03/26 23:33:13
Changed to collection.
| |
| 26 // has been updated. | |
|
Kevin M
2015/03/26 20:50:14
Can you add a comment about why this is just an in
imcheng
2015/03/26 23:33:13
Added more comments.
| |
| 27 class MediaSinksObserver { | |
| 28 public: | |
| 29 // Constructs an observer that will observe for sinks compatible | |
| 30 // with |source|. | |
| 31 explicit MediaSinksObserver(const MediaSource& source) : source_(source) {} | |
| 32 virtual ~MediaSinksObserver() {} | |
| 33 | |
| 34 // This function is invoked when the list of sinks compatible | |
| 35 // with |source_| has been updated. | |
| 36 virtual void OnSinksReceived(const SinksQueryResult& result) = 0; | |
| 37 | |
| 38 const MediaSource& source() const { return source_; } | |
| 39 | |
| 40 private: | |
| 41 MediaSource source_; | |
| 42 }; | |
| 43 | |
| 44 } // namespace media_router | |
| 45 | |
| 46 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_OBSERVER_H_ | |
| OLD | NEW |