Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1118)

Unified Diff: chrome/browser/media/router/media_sinks_search_request.h

Issue 1805813002: [Media Router] Wiring for searching route providers for new sinks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698