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

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

Issue 2627463003: Convert MediaRouter mojom apis to intake url::Origin objects instead of strings (Closed)
Patch Set: Add missing dependency for extensions_renderer_resources target Created 3 years, 10 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/issue.h" 17 #include "chrome/browser/media/router/issue.h"
18 #include "chrome/browser/media/router/media_route.h" 18 #include "chrome/browser/media/router/media_route.h"
19 #include "chrome/browser/media/router/media_sink.h" 19 #include "chrome/browser/media/router/media_sink.h"
20 #include "chrome/browser/media/router/media_source.h" 20 #include "chrome/browser/media/router/media_source.h"
21 #include "chrome/browser/media/router/route_message_observer.h" 21 #include "chrome/browser/media/router/route_message_observer.h"
22 #include "components/keyed_service/core/keyed_service.h" 22 #include "components/keyed_service/core/keyed_service.h"
23 #include "content/public/browser/presentation_service_delegate.h" 23 #include "content/public/browser/presentation_service_delegate.h"
24 24
25 namespace content { 25 namespace content {
26 class WebContents; 26 class WebContents;
27 } 27 }
28 28
29 namespace url {
30 class Origin;
31 } // namespace url
32
29 namespace media_router { 33 namespace media_router {
30 34
31 class IssuesObserver; 35 class IssuesObserver;
32 class MediaRoutesObserver; 36 class MediaRoutesObserver;
33 class MediaSinksObserver; 37 class MediaSinksObserver;
34 class PresentationConnectionStateObserver; 38 class PresentationConnectionStateObserver;
35 class RouteRequestResult; 39 class RouteRequestResult;
36 40
37 // Type of callback used in |CreateRoute()|, |JoinRoute()|, and 41 // Type of callback used in |CreateRoute()|, |JoinRoute()|, and
38 // |ConnectRouteByRouteId()|. Callback is invoked when the route request either 42 // |ConnectRouteByRouteId()|. Callback is invoked when the route request either
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // CreateRoute()). 75 // CreateRoute()).
72 // The caller may pass in nullptr for |web_contents| if tab is not applicable. 76 // The caller may pass in nullptr for |web_contents| if tab is not applicable.
73 // Each callback in |callbacks| is invoked with a response indicating 77 // Each callback in |callbacks| is invoked with a response indicating
74 // success or failure, in the order they are listed. 78 // success or failure, in the order they are listed.
75 // If |timeout| is positive, then any un-invoked |callbacks| will be invoked 79 // If |timeout| is positive, then any un-invoked |callbacks| will be invoked
76 // with a timeout error after the timeout expires. 80 // with a timeout error after the timeout expires.
77 // If |incognito| is true, the request was made by an incognito profile. 81 // If |incognito| is true, the request was made by an incognito profile.
78 virtual void CreateRoute( 82 virtual void CreateRoute(
79 const MediaSource::Id& source_id, 83 const MediaSource::Id& source_id,
80 const MediaSink::Id& sink_id, 84 const MediaSink::Id& sink_id,
81 const GURL& origin, 85 const url::Origin& origin,
82 content::WebContents* web_contents, 86 content::WebContents* web_contents,
83 const std::vector<MediaRouteResponseCallback>& callbacks, 87 const std::vector<MediaRouteResponseCallback>& callbacks,
84 base::TimeDelta timeout, 88 base::TimeDelta timeout,
85 bool incognito) = 0; 89 bool incognito) = 0;
86 90
87 // Creates a route and connects it to an existing route identified by 91 // Creates a route and connects it to an existing route identified by
88 // |route_id|. |route_id| must refer to a non-local route, unnassociated with 92 // |route_id|. |route_id| must refer to a non-local route, unnassociated with
89 // a Presentation ID, because a new Presentation ID will be created. 93 // a Presentation ID, because a new Presentation ID will be created.
90 // |source|: The source to route to the existing route. 94 // |source|: The source to route to the existing route.
91 // |route_id|: Route ID of the existing route. 95 // |route_id|: Route ID of the existing route.
92 // |origin|, |web_contents|: Origin and WebContents of the join route request. 96 // |origin|, |web_contents|: Origin and WebContents of the join route request.
93 // Used for validation when enforcing same-origin and/or same-tab scope. 97 // Used for validation when enforcing same-origin and/or same-tab scope.
94 // (See CreateRoute documentation). 98 // (See CreateRoute documentation).
95 // Each callback in |callbacks| is invoked with a response indicating 99 // Each callback in |callbacks| is invoked with a response indicating
96 // success or failure, in the order they are listed. 100 // success or failure, in the order they are listed.
97 // If |timeout| is positive, then any un-invoked |callbacks| will be invoked 101 // If |timeout| is positive, then any un-invoked |callbacks| will be invoked
98 // with a timeout error after the timeout expires. 102 // with a timeout error after the timeout expires.
99 // If |incognito| is true, the request was made by an incognito profile. 103 // If |incognito| is true, the request was made by an incognito profile.
100 virtual void ConnectRouteByRouteId( 104 virtual void ConnectRouteByRouteId(
101 const MediaSource::Id& source_id, 105 const MediaSource::Id& source_id,
102 const MediaRoute::Id& route_id, 106 const MediaRoute::Id& route_id,
103 const GURL& origin, 107 const url::Origin& origin,
104 content::WebContents* web_contents, 108 content::WebContents* web_contents,
105 const std::vector<MediaRouteResponseCallback>& callbacks, 109 const std::vector<MediaRouteResponseCallback>& callbacks,
106 base::TimeDelta timeout, 110 base::TimeDelta timeout,
107 bool incognito) = 0; 111 bool incognito) = 0;
108 112
109 // Joins an existing route identified by |presentation_id|. 113 // Joins an existing route identified by |presentation_id|.
110 // |source|: The source to route to the existing route. 114 // |source|: The source to route to the existing route.
111 // |presentation_id|: Presentation ID of the existing route. 115 // |presentation_id|: Presentation ID of the existing route.
112 // |origin|, |web_contents|: Origin and WebContents of the join route request. 116 // |origin|, |web_contents|: Origin and WebContents of the join route request.
113 // Used for validation when enforcing same-origin and/or same-tab scope. 117 // Used for validation when enforcing same-origin and/or same-tab scope.
114 // (See CreateRoute documentation). 118 // (See CreateRoute documentation).
115 // Each callback in |callbacks| is invoked with a response indicating 119 // Each callback in |callbacks| is invoked with a response indicating
116 // success or failure, in the order they are listed. 120 // success or failure, in the order they are listed.
117 // If |timeout| is positive, then any un-invoked |callbacks| will be invoked 121 // If |timeout| is positive, then any un-invoked |callbacks| will be invoked
118 // with a timeout error after the timeout expires. 122 // with a timeout error after the timeout expires.
119 // If |incognito| is true, the request was made by an incognito profile. 123 // If |incognito| is true, the request was made by an incognito profile.
120 virtual void JoinRoute( 124 virtual void JoinRoute(
121 const MediaSource::Id& source, 125 const MediaSource::Id& source,
122 const std::string& presentation_id, 126 const std::string& presentation_id,
123 const GURL& origin, 127 const url::Origin& origin,
124 content::WebContents* web_contents, 128 content::WebContents* web_contents,
125 const std::vector<MediaRouteResponseCallback>& callbacks, 129 const std::vector<MediaRouteResponseCallback>& callbacks,
126 base::TimeDelta timeout, 130 base::TimeDelta timeout,
127 bool incognito) = 0; 131 bool incognito) = 0;
128 132
129 // Terminates the media route specified by |route_id|. 133 // Terminates the media route specified by |route_id|.
130 virtual void TerminateRoute(const MediaRoute::Id& route_id) = 0; 134 virtual void TerminateRoute(const MediaRoute::Id& route_id) = 0;
131 135
132 // Detaches the media route specified by |route_id|. The request might come 136 // Detaches the media route specified by |route_id|. The request might come
133 // from the page or from an event like navigation or garbage collection. 137 // from the page or from an event like navigation or garbage collection.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 245
242 // Unregisters a previously registered RouteMessagesObserver. |observer| will 246 // Unregisters a previously registered RouteMessagesObserver. |observer| will
243 // stop receiving further updates. 247 // stop receiving further updates.
244 virtual void UnregisterRouteMessageObserver( 248 virtual void UnregisterRouteMessageObserver(
245 RouteMessageObserver* observer) = 0; 249 RouteMessageObserver* observer) = 0;
246 }; 250 };
247 251
248 } // namespace media_router 252 } // namespace media_router
249 253
250 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ 254 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698