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 35e8afbffc77111b409eafd6784c3cff5fc79889..1cc270ca9f0cc0667c937359016367aecc044301 100644 |
--- a/chrome/browser/resources/media_router/media_router_ui_interface.js |
+++ b/chrome/browser/resources/media_router/media_router_ui_interface.js |
@@ -10,6 +10,9 @@ cr.define('media_router.ui', function() { |
// The media-router-container element. |
var container = null; |
+ // The media-router-header element. |
+ var header = null; |
+ |
/** |
* Handles response of previous create route attempt. |
* |
@@ -33,12 +36,14 @@ cr.define('media_router.ui', function() { |
} |
/** |
- * Sets |container|. |
+ * Sets |container| and |header|. |
* |
* @param {!MediaRouterContainerElement} mediaRouterContainer |
+ * @param {!MediaRouterHeaderElement} mediaRouterHeader |
*/ |
- function setContainer(mediaRouterContainer) { |
+ function setElements(mediaRouterContainer, mediaRouterHeader) { |
container = mediaRouterContainer; |
+ header = mediaRouterHeader; |
} |
/** |
@@ -51,6 +56,9 @@ cr.define('media_router.ui', function() { |
* routes: !Array<!media_router.Route>, |
* castModes: !Array<!media_router.CastMode>, |
* wasFirstRunFlowAcknowledged: boolean, |
+ * userEmail: string, |
+ * userDomain: string, |
+ * identityVisibility: number, |
* showFirstRunFlowCloudPref: boolean}} data |
* Parameters in data: |
* firstRunFlowCloudPrefLearnMoreUrl - url to open when the cloud services |
@@ -63,6 +71,9 @@ cr.define('media_router.ui', function() { |
* castModes - list of available cast modes. |
* wasFirstRunFlowAcknowledged - true if first run flow was previously |
* acknowledged by user. |
+ * userEmail - The email of the user if the user is signed in. |
+ * userDomain - The domain of the user if the user is signed in. |
+ * identityVisibility - State of showing email and user domain. |
* showFirstRunFlowCloudPref - true if the cloud pref option should be |
* shown. |
*/ |
@@ -75,6 +86,10 @@ cr.define('media_router.ui', function() { |
container.castModeList = data['castModes']; |
container.allSinks = data['sinks']; |
container.routeList = data['routes']; |
+ container.userDomain = data['userDomain']; |
+ container.showDomain = data['identityVisibility'] == 2; |
+ header.userEmail = data['userEmail']; |
+ header.showEmail = data['identityVisibility'] > 0; |
container.showFirstRunFlowCloudPref = |
data['showFirstRunFlowCloudPref']; |
// Some users acknowledged the first run flow before the cloud prefs |
@@ -106,12 +121,19 @@ cr.define('media_router.ui', function() { |
} |
/** |
- * Sets the list of discovered sinks. |
+ * Sets the list of discovered sinks along with properties of whether to hide |
+ * identity of the user email and domain. |
* |
- * @param {!Array<!media_router.Sink>} sinkList |
+ * @param {{sinks: !Array<!media_router.Sink>, |
+ * identityVisibility: number}} data |
+ * Parameters in data: |
+ * sinks - list of sinks to be displayed. |
+ * identityVisibility - State of showing email and user domain. |
*/ |
- function setSinkList(sinkList) { |
- container.allSinks = sinkList; |
+ function setSinkListAndIdentityVisibility(data) { |
+ container.allSinks = data['sinks']; |
+ container.showDomain = data['identityVisibility'] == 2; |
+ header.showEmail = data['identityVisibility'] > 0; |
} |
/** |