Index: chrome/browser/resources/media_router/media_router_ui_interface.js |
diff --git a/chrome/browser/resources/media_router/media_router_ui_interface.js b/chrome/browser/resources/media_router/media_router_ui_interface.js |
index 6232c37ae48ac53a338e345f9e0428e92be72fd7..4d65622b56bf1ae325eb906335315eaefba08628 100644 |
--- a/chrome/browser/resources/media_router/media_router_ui_interface.js |
+++ b/chrome/browser/resources/media_router/media_router_ui_interface.js |
@@ -97,12 +97,14 @@ cr.define('media_router.ui', function() { |
* showDomain: boolean |
* }, |
* routes: !Array<!media_router.Route>, |
- * castModes: !Array<!media_router.CastMode>}} data |
+ * castModes: !Array<!media_router.CastMode>, |
+ * useTabMirroring: boolean}} data |
* Parameters in data: |
* deviceMissingUrl - url to be opened on "Device missing?" clicked. |
* sinksAndIdentity - list of sinks to be displayed and user identity. |
* routes - list of routes that are associated with the sinks. |
* castModes - list of available cast modes. |
+ * useTabMirroring - whether the cast mode should be set to TAB_MIRROR. |
*/ |
function setInitialData(data) { |
container.deviceMissingUrl = data['deviceMissingUrl']; |
@@ -110,6 +112,8 @@ cr.define('media_router.ui', function() { |
this.setSinkListAndIdentity(data['sinksAndIdentity']); |
container.routeList = data['routes']; |
container.maybeShowRouteDetailsOnOpen(); |
+ if (data['useTabMirroring']) |
+ container.selectCastMode(media_router.CastModeType.TAB_MIRROR); |
media_router.browserApi.onInitialDataReceived(); |
} |