| Index: chrome/browser/media/router/media_sinks_search_request.h
|
| diff --git a/chrome/browser/media/router/media_sinks_search_request.h b/chrome/browser/media/router/media_sinks_search_request.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..82d563ca10fab4dee1b2aac674a94a1136f4fc64
|
| --- /dev/null
|
| +++ b/chrome/browser/media/router/media_sinks_search_request.h
|
| @@ -0,0 +1,45 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_SEARCH_REQUEST_H_
|
| +#define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_SEARCH_REQUEST_H_
|
| +
|
| +#include <vector>
|
| +
|
| +#include "base/macros.h"
|
| +#include "chrome/browser/media/router/media_sink.h"
|
| +#include "chrome/browser/media/router/media_source.h"
|
| +
|
| +namespace media_router {
|
| +
|
| +// Base class for issuing a sink search request from to the Media Router.
|
| +// A MediaSinksSearchObserver implementation can be registered to MediaRouter to
|
| +// receive results. It will be immediately unregistered and destroyed after it
|
| +// receives results once.
|
| +class MediaSinksSearchRequest {
|
| + public:
|
| + MediaSinksSearchRequest(const MediaSource& source,
|
| + const MediaSink::Id& sink_id);
|
| + virtual ~MediaSinksSearchRequest();
|
| +
|
| + // This function is invoked a list of sinks matching |sink_id_| and that are
|
| + // compatible with |source_| is found.
|
| + // Implementations should not invoke their own destructor from here. The Media
|
| + // Router will automatically destroy the MediaSinksSearchRequest after the
|
| + // call completes.
|
| + virtual void OnResultsReceived(const std::vector<MediaSink>& sinks) {}
|
| +
|
| + const MediaSink::Id& sink_id() const { return sink_id_; }
|
| + const MediaSource& source() const { return source_; }
|
| +
|
| + private:
|
| + const MediaSource source_;
|
| + const MediaSink::Id sink_id_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(MediaSinksSearchRequest);
|
| +};
|
| +
|
| +} // namespace media_router
|
| +
|
| +#endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SINKS_SEARCH_REQUEST_H_
|
|
|