OLD | NEW |
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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 // Type of callback used in |CreateRoute()| and |JoinRoute()|. Callback is | 27 // Type of callback used in |CreateRoute()| and |JoinRoute()|. Callback is |
28 // invoked when the route request either succeeded or failed. | 28 // invoked when the route request either succeeded or failed. |
29 // On success: | 29 // On success: |
30 // |route|: The route created or joined. | 30 // |route|: The route created or joined. |
31 // |presentation_id|: | 31 // |presentation_id|: |
32 // The presentation ID of the route created or joined. In the case of | 32 // The presentation ID of the route created or joined. In the case of |
33 // |CreateRoute()|, the ID is generated by MediaRouter and is guaranteed to | 33 // |CreateRoute()|, the ID is generated by MediaRouter and is guaranteed to |
34 // be unique. | 34 // be unique. |
35 // |error|: Empty string. | 35 // |error|: Empty string. |
| 36 // |is_one_ua_presentation|: true if route is a 1-UA presentation. |
36 // On failure: | 37 // On failure: |
37 // |route|: nullptr | 38 // |route|: nullptr |
38 // |presentation_id|: Empty string. | 39 // |presentation_id|: Empty string. |
39 // |error|: Non-empty string describing the error. | 40 // |error|: Non-empty string describing the error. |
| 41 // |is_one_ua_presentation|: false. |
40 using MediaRouteResponseCallback = | 42 using MediaRouteResponseCallback = |
41 base::Callback<void(const MediaRoute* route, | 43 base::Callback<void(const MediaRoute* route, |
42 const std::string& presentation_id, | 44 const std::string& presentation_id, |
43 const std::string& error)>; | 45 const std::string& error, |
| 46 bool is_one_ua_presentation)>; |
44 | 47 |
45 // Used in cases where a tab ID is not applicable in CreateRoute/JoinRoute. | 48 // Used in cases where a tab ID is not applicable in CreateRoute/JoinRoute. |
46 const int kInvalidTabId = -1; | 49 const int kInvalidTabId = -1; |
47 | 50 |
48 // An interface for handling resources related to media routing. | 51 // An interface for handling resources related to media routing. |
49 // Responsible for registering observers for receiving sink availability | 52 // Responsible for registering observers for receiving sink availability |
50 // updates, handling route requests/responses, and operating on routes (e.g. | 53 // updates, handling route requests/responses, and operating on routes (e.g. |
51 // posting messages or closing). | 54 // posting messages or closing). |
52 class MediaRouter : public KeyedService { | 55 class MediaRouter : public KeyedService { |
53 public: | 56 public: |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 170 |
168 // Unregisters a previously registered PresentationSessionMessagesObserver. | 171 // Unregisters a previously registered PresentationSessionMessagesObserver. |
169 // |observer| will stop receiving further updates. | 172 // |observer| will stop receiving further updates. |
170 virtual void UnregisterPresentationSessionMessagesObserver( | 173 virtual void UnregisterPresentationSessionMessagesObserver( |
171 PresentationSessionMessagesObserver* observer) = 0; | 174 PresentationSessionMessagesObserver* observer) = 0; |
172 }; | 175 }; |
173 | 176 |
174 } // namespace media_router | 177 } // namespace media_router |
175 | 178 |
176 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ | 179 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_H_ |
OLD | NEW |