| 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 module media_router.interfaces; | 5 module media_router.interfaces; |
| 6 | 6 |
| 7 // Represents an output sink to which media can be routed. | 7 // Represents an output sink to which media can be routed. |
| 8 struct MediaSink { | 8 struct MediaSink { |
| 9 enum IconType { | 9 enum IconType { |
| 10 CAST, | 10 CAST, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // "Tab casting". | 39 // "Tab casting". |
| 40 string description; | 40 string description; |
| 41 // Specifies that the route is requested locally. | 41 // Specifies that the route is requested locally. |
| 42 bool is_local; | 42 bool is_local; |
| 43 // An optional path to an HTML page bundled bundled with the media router | 43 // An optional path to an HTML page bundled bundled with the media router |
| 44 // component extension. When set, the route can have custom route detail as | 44 // component extension. When set, the route can have custom route detail as |
| 45 // well as its own route controls in the media router dialog. | 45 // well as its own route controls in the media router dialog. |
| 46 string? custom_controller_path; | 46 string? custom_controller_path; |
| 47 // Set to true if this route should be displayed for |media_sink_id| in UI. | 47 // Set to true if this route should be displayed for |media_sink_id| in UI. |
| 48 bool for_display; | 48 bool for_display; |
| 49 // Set to true if this route was created by an off the record (incognito) | 49 // Set to true if this route was created by an incognito profile. |
| 50 // profile. | 50 bool incognito; |
| 51 bool off_the_record; | |
| 52 }; | 51 }; |
| 53 | 52 |
| 54 // Notifications or an actionable events to be shown to the user. | 53 // Notifications or an actionable events to be shown to the user. |
| 55 // When is_blocking is true, media router UI shows issue only: | 54 // When is_blocking is true, media router UI shows issue only: |
| 56 // | 55 // |
| 57 // Title | 56 // Title |
| 58 // Message | 57 // Message |
| 59 // default_action_button secondary_action_button | 58 // default_action_button secondary_action_button |
| 60 // | 59 // |
| 61 // When is_blocking is false, media router UI uses banner: | 60 // When is_blocking is false, media router UI uses banner: |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // may be overridden by a provider implementation. The presentation ID will | 139 // may be overridden by a provider implementation. The presentation ID will |
| 141 // be used by the presentation API to refer to the created route. | 140 // be used by the presentation API to refer to the created route. |
| 142 // | 141 // |
| 143 // |origin| and |tab_id| may be passed in for enforcing same-origin and/or | 142 // |origin| and |tab_id| may be passed in for enforcing same-origin and/or |
| 144 // same-tab scopes. Use -1 as |tab_id| in cases where the request is not | 143 // same-tab scopes. Use -1 as |tab_id| in cases where the request is not |
| 145 // made on behalf of a tab. | 144 // made on behalf of a tab. |
| 146 // | 145 // |
| 147 // If |timeout_millis| is positive, it will be used in place of the default | 146 // If |timeout_millis| is positive, it will be used in place of the default |
| 148 // timeout defined by Media Route Provider Manager. | 147 // timeout defined by Media Route Provider Manager. |
| 149 // | 148 // |
| 150 // If |off_the_record| is true, the request was made by an off the record | 149 // If |incognito| is true, the request was made by an incognito profile. |
| 151 // (incognito) profile. | |
| 152 // | 150 // |
| 153 // If the operation was successful, |route| will be defined and | 151 // If the operation was successful, |route| will be defined and |
| 154 // |error_text| will be null. | 152 // |error_text| will be null. |
| 155 // If the operation failed, |route| will be null and |error_text| | 153 // If the operation failed, |route| will be null and |error_text| |
| 156 // will be set. | 154 // will be set. |
| 157 // |result| will be set to OK if successful, or an error code if an error | 155 // |result| will be set to OK if successful, or an error code if an error |
| 158 // occurred. | 156 // occurred. |
| 159 CreateRoute(string media_source, | 157 CreateRoute(string media_source, |
| 160 string sink_id, | 158 string sink_id, |
| 161 string original_presentation_id, | 159 string original_presentation_id, |
| 162 string origin, | 160 string origin, |
| 163 int32 tab_id, | 161 int32 tab_id, |
| 164 int64 timeout_millis, | 162 int64 timeout_millis, |
| 165 bool off_the_record) => | 163 bool incognito) => |
| 166 (MediaRoute? route, | 164 (MediaRoute? route, |
| 167 string? error_text, | 165 string? error_text, |
| 168 RouteRequestResultCode result_code); | 166 RouteRequestResultCode result_code); |
| 169 | 167 |
| 170 // Requests a connection to an established route for |media_source| given | 168 // Requests a connection to an established route for |media_source| given |
| 171 // by |presentation_id|. | 169 // by |presentation_id|. |
| 172 // | 170 // |
| 173 // |origin| and |tab_id| are used for validating same-origin/tab scopes; | 171 // |origin| and |tab_id| are used for validating same-origin/tab scopes; |
| 174 // see CreateRoute for additional documentation. | 172 // see CreateRoute for additional documentation. |
| 175 // | 173 // |
| 176 // If |timeout_millis| is positive, it will be used in place of the default | 174 // If |timeout_millis| is positive, it will be used in place of the default |
| 177 // timeout defined by Media Route Provider Manager. | 175 // timeout defined by Media Route Provider Manager. |
| 178 // | 176 // |
| 179 // If the route request was created by an off the record (incognito) profile, | 177 // If the route request was created by an incognito profile, |
| 180 // |off_the_record| must be true. | 178 // |incognito| must be true. |
| 181 // | 179 // |
| 182 // If the operation was successful, |route| will be defined and | 180 // If the operation was successful, |route| will be defined and |
| 183 // |error_text| will be null. | 181 // |error_text| will be null. |
| 184 // If the operation failed, |route| will be null and |error_text| | 182 // If the operation failed, |route| will be null and |error_text| |
| 185 // will be set. | 183 // will be set. |
| 186 // |result| will be set to OK if successful, or an error code if an error | 184 // |result| will be set to OK if successful, or an error code if an error |
| 187 // occurred. | 185 // occurred. |
| 188 JoinRoute(string media_source, | 186 JoinRoute(string media_source, |
| 189 string presentation_id, | 187 string presentation_id, |
| 190 string origin, | 188 string origin, |
| 191 int32 tab_id, | 189 int32 tab_id, |
| 192 int64 timeout_millis, | 190 int64 timeout_millis, |
| 193 bool off_the_record) => | 191 bool incognito) => |
| 194 (MediaRoute? route, | 192 (MediaRoute? route, |
| 195 string? error_text, | 193 string? error_text, |
| 196 RouteRequestResultCode result_code); | 194 RouteRequestResultCode result_code); |
| 197 | 195 |
| 198 // Creates a new route for |media_source| that connects to the established | 196 // Creates a new route for |media_source| that connects to the established |
| 199 // route given by |route_id|. | 197 // route given by |route_id|. |
| 200 // | 198 // |
| 201 // The presentation ID of the new route will be |presentation_id|, but it may | 199 // The presentation ID of the new route will be |presentation_id|, but it may |
| 202 // be overridden by a provider implementation. The presentation ID will be | 200 // be overridden by a provider implementation. The presentation ID will be |
| 203 // used by the presentation API to refer to the created route. | 201 // used by the presentation API to refer to the created route. |
| 204 // | 202 // |
| 205 // |origin| and |tab_id| are used for validating same-origin/tab scopes; see | 203 // |origin| and |tab_id| are used for validating same-origin/tab scopes; see |
| 206 // CreateRoute for additional documentation. | 204 // CreateRoute for additional documentation. |
| 207 // | 205 // |
| 208 // If |timeout_millis| is positive, it will be used in place of the default | 206 // If |timeout_millis| is positive, it will be used in place of the default |
| 209 // timeout defined by Media Route Provider Manager; see CreateRoute for additi
onal | 207 // timeout defined by Media Route Provider Manager; see CreateRoute for additi
onal |
| 210 // documentation. | 208 // documentation. |
| 211 // | 209 // |
| 212 // If the route request was created by an off the record (incognito) profile, | 210 // If the route request was created by an incognito profile, |
| 213 // |off_the_record| must be true. | 211 // |incognito| must be true. |
| 214 // | 212 // |
| 215 // If the operation was successful, |route| will be defined and | 213 // If the operation was successful, |route| will be defined and |
| 216 // |error_text| will be null. If the operation failed, |route| will be null | 214 // |error_text| will be null. If the operation failed, |route| will be null |
| 217 // and |error_text| will be set. | 215 // and |error_text| will be set. |
| 218 // | 216 // |
| 219 // |result| will be set to OK if successful, or an error code if an error | 217 // |result| will be set to OK if successful, or an error code if an error |
| 220 // occurred. | 218 // occurred. |
| 221 ConnectRouteByRouteId(string media_source, | 219 ConnectRouteByRouteId(string media_source, |
| 222 string route_id, | 220 string route_id, |
| 223 string presentation_id, | 221 string presentation_id, |
| 224 string origin, | 222 string origin, |
| 225 int32 tab_id, | 223 int32 tab_id, |
| 226 int64 timeout_millis, | 224 int64 timeout_millis, |
| 227 bool off_the_record) => | 225 bool incognito) => |
| 228 (MediaRoute? route, | 226 (MediaRoute? route, |
| 229 string? error_text, | 227 string? error_text, |
| 230 RouteRequestResultCode result_code); | 228 RouteRequestResultCode result_code); |
| 231 | 229 |
| 232 // Terminates the route specified by |route_id|. | 230 // Terminates the route specified by |route_id|. |
| 233 TerminateRoute(string route_id); | 231 TerminateRoute(string route_id); |
| 234 | 232 |
| 235 // Sends |message| via the media route |media_route_id|. | 233 // Sends |message| via the media route |media_route_id|. |
| 236 // If the operation was successful, |sent| is true; otherwise it is false. | 234 // If the operation was successful, |sent| is true; otherwise it is false. |
| 237 SendRouteMessage(string media_route_id, string message) => (bool sent); | 235 SendRouteMessage(string media_route_id, string message) => (bool sent); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 // changed to |state|. | 367 // changed to |state|. |
| 370 OnPresentationConnectionStateChanged( | 368 OnPresentationConnectionStateChanged( |
| 371 string route_id, PresentationConnectionState state); | 369 string route_id, PresentationConnectionState state); |
| 372 | 370 |
| 373 // Called when the presentation connected to route |route_id| has closed. | 371 // Called when the presentation connected to route |route_id| has closed. |
| 374 OnPresentationConnectionClosed( | 372 OnPresentationConnectionClosed( |
| 375 string route_id, PresentationConnectionCloseReason reason, | 373 string route_id, PresentationConnectionCloseReason reason, |
| 376 string message); | 374 string message); |
| 377 }; | 375 }; |
| 378 | 376 |
| OLD | NEW |