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

Side by Side Diff: chrome/browser/media/router/media_router.h

Issue 2679893002: [Media Router] Add ProvideSinks() Mojo API (Closed)
Patch Set: resolve code review comments from Derek and Mark Created 3 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 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>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/callback_list.h" 14 #include "base/callback_list.h"
15 #include "base/memory/scoped_vector.h" 15 #include "base/memory/scoped_vector.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "chrome/browser/media/router/discovery/media_sink_internal.h"
17 #include "chrome/browser/media/router/issue.h" 18 #include "chrome/browser/media/router/issue.h"
18 #include "chrome/browser/media/router/media_route.h" 19 #include "chrome/browser/media/router/media_route.h"
19 #include "chrome/browser/media/router/media_sink.h" 20 #include "chrome/browser/media/router/media_sink.h"
20 #include "chrome/browser/media/router/media_source.h" 21 #include "chrome/browser/media/router/media_source.h"
21 #include "chrome/browser/media/router/route_message_observer.h" 22 #include "chrome/browser/media/router/route_message_observer.h"
22 #include "components/keyed_service/core/keyed_service.h" 23 #include "components/keyed_service/core/keyed_service.h"
23 #include "content/public/browser/presentation_service_delegate.h" 24 #include "content/public/browser/presentation_service_delegate.h"
24 25
25 namespace content { 26 namespace content {
26 class WebContents; 27 class WebContents;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // the user has no domain or is not signed in. |sink_callback| will be called 166 // the user has no domain or is not signed in. |sink_callback| will be called
166 // either with the ID of the new sink when it is found or with an empty string 167 // either with the ID of the new sink when it is found or with an empty string
167 // if no sink was found. 168 // if no sink was found.
168 virtual void SearchSinks( 169 virtual void SearchSinks(
169 const MediaSink::Id& sink_id, 170 const MediaSink::Id& sink_id,
170 const MediaSource::Id& source_id, 171 const MediaSource::Id& source_id,
171 const std::string& search_input, 172 const std::string& search_input,
172 const std::string& domain, 173 const std::string& domain,
173 const MediaSinkSearchResponseCallback& sink_callback) = 0; 174 const MediaSinkSearchResponseCallback& sink_callback) = 0;
174 175
176 // Notifies the Media Router that the list of MediaSinks discovered by a
177 // MediaSinkService has been updated.
178 // |provider_name|: Name of the MediaSinkService providing the sinks.
179 // |sinks|: sinks discovered by MediaSinkService.
180 virtual void ProvideSinks(const std::string& provider_name,
181 const std::vector<MediaSinkInternal>& sinks) = 0;
182
175 // Adds |callback| to listen for state changes for presentation connected to 183 // Adds |callback| to listen for state changes for presentation connected to
176 // |route_id|. The returned Subscription object is owned by the caller. 184 // |route_id|. The returned Subscription object is owned by the caller.
177 // |callback| will be invoked whenever there are state changes, until the 185 // |callback| will be invoked whenever there are state changes, until the
178 // caller destroys the Subscription object. 186 // caller destroys the Subscription object.
179 virtual std::unique_ptr<PresentationConnectionStateSubscription> 187 virtual std::unique_ptr<PresentationConnectionStateSubscription>
180 AddPresentationConnectionStateChangedCallback( 188 AddPresentationConnectionStateChangedCallback(
181 const MediaRoute::Id& route_id, 189 const MediaRoute::Id& route_id,
182 const content::PresentationConnectionStateChangedCallback& callback) = 0; 190 const content::PresentationConnectionStateChangedCallback& callback) = 0;
183 191
184 // Called when the incognito profile for this instance is being shut down. 192 // Called when the incognito profile for this instance is being shut down.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 253
246 // Unregisters a previously registered RouteMessagesObserver. |observer| will 254 // Unregisters a previously registered RouteMessagesObserver. |observer| will
247 // stop receiving further updates. 255 // stop receiving further updates.
248 virtual void UnregisterRouteMessageObserver( 256 virtual void UnregisterRouteMessageObserver(
249 RouteMessageObserver* observer) = 0; 257 RouteMessageObserver* observer) = 0;
250 }; 258 };
251 259
252 } // namespace media_router 260 } // namespace media_router
253 261
254 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ 262 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698