| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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_SEARCH_REQUEST_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_SEARCH_REQUEST_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "chrome/browser/media/router/media_sink.h" |
| 12 #include "chrome/browser/media/router/media_source.h" |
| 13 |
| 14 namespace media_router { |
| 15 |
| 16 // Base class for issuing a sink search request from to the Media Router. |
| 17 // A MediaSinksSearchObserver implementation can be registered to MediaRouter to |
| 18 // receive results. It will be immediately unregistered and destroyed after it |
| 19 // receives results once. |
| 20 class MediaSinksSearchRequest { |
| 21 public: |
| 22 MediaSinksSearchRequest(const MediaSource& source, |
| 23 const MediaSink::Id& sink_id); |
| 24 virtual ~MediaSinksSearchRequest(); |
| 25 |
| 26 // This function is invoked a list of sinks matching |sink_id_| and that are |
| 27 // compatible with |source_| is found. |
| 28 // Implementations should not invoke their own destructor from here. The Media |
| 29 // Router will automatically destroy the MediaSinksSearchRequest after the |
| 30 // call completes. |
| 31 virtual void OnResultsReceived(const std::vector<MediaSink>& sinks) {} |
| 32 |
| 33 const MediaSink::Id& sink_id() const { return sink_id_; } |
| 34 const MediaSource& source() const { return source_; } |
| 35 |
| 36 private: |
| 37 const MediaSource source_; |
| 38 const MediaSink::Id sink_id_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(MediaSinksSearchRequest); |
| 41 }; |
| 42 |
| 43 } // namespace media_router |
| 44 |
| 45 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_SEARCH_REQUEST_H_ |
| OLD | NEW |