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

Unified Diff: chrome/browser/media/router/media_router.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: Clarifying pseudo sink comments Created 4 years, 8 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_router.h
diff --git a/chrome/browser/media/router/media_router.h b/chrome/browser/media/router/media_router.h
index 9fa22d71207046000a778f09c1ffa65d12cb6a52..690d4c25caa21fee4b11207edc4936d6b8e7a6a6 100644
--- a/chrome/browser/media/router/media_router.h
+++ b/chrome/browser/media/router/media_router.h
@@ -43,6 +43,12 @@ class RouteRequestResult;
using MediaRouteResponseCallback =
base::Callback<void(const RouteRequestResult& result)>;
+// Type of callback used for |SearchSinksAndCreateRoute()| to return the sink ID
+// of the newly-found sink. The sink ID will be the empty string if no sink was
+// found.
+using MediaSinkSearchResponseCallback =
+ base::Callback<void(const std::string& sink_id)>;
+
// Subscription object returned by calling
// |AddPresentationConnectionStateChangedCallback|. See the method comments for
// details.
@@ -159,6 +165,24 @@ class MediaRouter : public KeyedService {
// approriate to be done at construction.
virtual void OnUserGesture() = 0;
+ // Searches for a MediaSink using |search_input| and |domain| as criteria.
+ // |sink_callback| will be called either with the ID of the new sink when it
+ // is found or with an empty string if no sink was found. If a sink was found
+ // then a MediaRoute will be created between it and the MediaSource specified
+ // by |source_id|. If no sink was found or if there was an error,
+ // |route_callbacks| will each be called with an error.
+ virtual void SearchSinksAndCreateRoute(
+ const MediaSource::Id& source_id,
+ const MediaSink::Id& sink_id,
+ const std::string& search_input,
+ const std::string& domain,
+ const GURL& origin,
+ content::WebContents* web_contents,
+ const std::vector<MediaRouteResponseCallback>& route_callbacks,
+ const MediaSinkSearchResponseCallback& sink_callback,
+ base::TimeDelta timeout,
+ bool off_the_record) = 0;
+
// Adds |callback| to listen for state changes for presentation connected to
// |route_id|. The returned Subscription object is owned by the caller.
// |callback| will be invoked whenever there are state changes, until the
« no previous file with comments | « chrome/browser/media/android/router/media_router_android.cc ('k') | chrome/browser/media/router/mock_media_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698