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

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: Comments and tests 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 // Sends a SearchSinks request to the MRPM using the given criteria.
imcheng 2016/04/18 23:15:46 nit on comment: MRPM is a detail of the mojo imple
btolsch 2016/04/19 01:39:42 Done.
169 virtual void SearchSinksAndCreateRoute(
170 const MediaSource::Id& source_id,
171 const MediaSink::Id& sink_id,
172 const std::string& search_input,
173 const std::string& domain,
174 const GURL& origin,
175 content::WebContents* web_contents,
176 const std::vector<MediaRouteResponseCallback>& route_callbacks,
177 const MediaSinkSearchResponseCallback& sink_callback,
178 base::TimeDelta timeout,
179 bool off_the_record) = 0;
180
162 // Adds |callback| to listen for state changes for presentation connected to 181 // Adds |callback| to listen for state changes for presentation connected to
163 // |route_id|. The returned Subscription object is owned by the caller. 182 // |route_id|. The returned Subscription object is owned by the caller.
164 // |callback| will be invoked whenever there are state changes, until the 183 // |callback| will be invoked whenever there are state changes, until the
165 // caller destroys the Subscription object. 184 // caller destroys the Subscription object.
166 virtual scoped_ptr<PresentationConnectionStateSubscription> 185 virtual scoped_ptr<PresentationConnectionStateSubscription>
167 AddPresentationConnectionStateChangedCallback( 186 AddPresentationConnectionStateChangedCallback(
168 const MediaRoute::Id& route_id, 187 const MediaRoute::Id& route_id,
169 const content::PresentationConnectionStateChangedCallback& callback) = 0; 188 const content::PresentationConnectionStateChangedCallback& callback) = 0;
170 189
171 // Called when the off the record (incognito) profile for this instance is 190 // 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 249
231 // Unregisters a previously registered PresentationSessionMessagesObserver. 250 // Unregisters a previously registered PresentationSessionMessagesObserver.
232 // |observer| will stop receiving further updates. 251 // |observer| will stop receiving further updates.
233 virtual void UnregisterPresentationSessionMessagesObserver( 252 virtual void UnregisterPresentationSessionMessagesObserver(
234 PresentationSessionMessagesObserver* observer) = 0; 253 PresentationSessionMessagesObserver* observer) = 0;
235 }; 254 };
236 255
237 } // namespace media_router 256 } // namespace media_router
238 257
239 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ 258 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698