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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 25 matching lines...) Expand all
36 class PresentationConnectionStateObserver; 36 class PresentationConnectionStateObserver;
37 class PresentationSessionMessagesObserver; 37 class PresentationSessionMessagesObserver;
38 class RouteRequestResult; 38 class RouteRequestResult;
39 39
40 // Type of callback used in |CreateRoute()|, |JoinRoute()|, and 40 // Type of callback used in |CreateRoute()|, |JoinRoute()|, and
41 // |ConnectRouteByRouteId()|. Callback is invoked when the route request either 41 // |ConnectRouteByRouteId()|. Callback is invoked when the route request either
42 // succeeded or failed. 42 // succeeded or failed.
43 using MediaRouteResponseCallback = 43 using MediaRouteResponseCallback =
44 base::Callback<void(const RouteRequestResult& result)>; 44 base::Callback<void(const RouteRequestResult& result)>;
45 45
46 // Type of callback used for |SearchSinksAndCreateRoute()| to return the sink ID
47 // of the newly-found sink. The sink ID will be the empty string if no sink was
48 // found.
49 using MediaSinkSearchResponseCallback =
50 base::Callback<void(const std::string& sink_id)>;
51
46 // Subscription object returned by calling 52 // Subscription object returned by calling
47 // |AddPresentationConnectionStateChangedCallback|. See the method comments for 53 // |AddPresentationConnectionStateChangedCallback|. See the method comments for
48 // details. 54 // details.
49 using PresentationConnectionStateSubscription = base::CallbackList<void( 55 using PresentationConnectionStateSubscription = base::CallbackList<void(
50 const content::PresentationConnectionStateChangeInfo&)>::Subscription; 56 const content::PresentationConnectionStateChangeInfo&)>::Subscription;
51 57
52 // An interface for handling resources related to media routing. 58 // An interface for handling resources related to media routing.
53 // Responsible for registering observers for receiving sink availability 59 // Responsible for registering observers for receiving sink availability
54 // updates, handling route requests/responses, and operating on routes (e.g. 60 // updates, handling route requests/responses, and operating on routes (e.g.
55 // posting messages or closing). 61 // posting messages or closing).
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 virtual void AddIssue(const Issue& issue) = 0; 158 virtual void AddIssue(const Issue& issue) = 0;
153 159
154 // Clears the issue with the id |issue_id|. 160 // Clears the issue with the id |issue_id|.
155 virtual void ClearIssue(const Issue::Id& issue_id) = 0; 161 virtual void ClearIssue(const Issue::Id& issue_id) = 0;
156 162
157 // Notifies the Media Router that the user has taken an action involving the 163 // Notifies the Media Router that the user has taken an action involving the
158 // Media Router. This can be used to perform any initialization that is not 164 // Media Router. This can be used to perform any initialization that is not
159 // approriate to be done at construction. 165 // approriate to be done at construction.
160 virtual void OnUserGesture() = 0; 166 virtual void OnUserGesture() = 0;
161 167
168 // Searches for a MediaSink using |search_input| and |domain| as criteria.
169 // |sink_callback| will be called either with the ID of the new sink when it
170 // is found or with an empty string if no sink was found. If a sink was found
171 // then a MediaRoute will be created between it and the MediaSource specified
172 // by |source_id|. If no sink was found or if there was an error,
173 // |route_callbacks| will each be called with an error.
174 virtual void SearchSinksAndCreateRoute(
175 const MediaSource::Id& source_id,
176 const MediaSink::Id& sink_id,
177 const std::string& search_input,
178 const std::string& domain,
179 const GURL& origin,
180 content::WebContents* web_contents,
181 const std::vector<MediaRouteResponseCallback>& route_callbacks,
182 const MediaSinkSearchResponseCallback& sink_callback,
183 base::TimeDelta timeout,
184 bool off_the_record) = 0;
185
162 // Adds |callback| to listen for state changes for presentation connected to 186 // Adds |callback| to listen for state changes for presentation connected to
163 // |route_id|. The returned Subscription object is owned by the caller. 187 // |route_id|. The returned Subscription object is owned by the caller.
164 // |callback| will be invoked whenever there are state changes, until the 188 // |callback| will be invoked whenever there are state changes, until the
165 // caller destroys the Subscription object. 189 // caller destroys the Subscription object.
166 virtual std::unique_ptr<PresentationConnectionStateSubscription> 190 virtual std::unique_ptr<PresentationConnectionStateSubscription>
167 AddPresentationConnectionStateChangedCallback( 191 AddPresentationConnectionStateChangedCallback(
168 const MediaRoute::Id& route_id, 192 const MediaRoute::Id& route_id,
169 const content::PresentationConnectionStateChangedCallback& callback) = 0; 193 const content::PresentationConnectionStateChangedCallback& callback) = 0;
170 194
171 // Called when the off the record (incognito) profile for this instance is 195 // Called when the off the record (incognito) profile for this instance is
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 254
231 // Unregisters a previously registered PresentationSessionMessagesObserver. 255 // Unregisters a previously registered PresentationSessionMessagesObserver.
232 // |observer| will stop receiving further updates. 256 // |observer| will stop receiving further updates.
233 virtual void UnregisterPresentationSessionMessagesObserver( 257 virtual void UnregisterPresentationSessionMessagesObserver(
234 PresentationSessionMessagesObserver* observer) = 0; 258 PresentationSessionMessagesObserver* observer) = 0;
235 }; 259 };
236 260
237 } // namespace media_router 261 } // namespace media_router
238 262
239 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ 263 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_
OLDNEW
« 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