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

Unified Diff: chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js

Issue 1415533019: [Media Router] Use common media-router-header for MR UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per imcheng@'s comments. Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
diff --git a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
index a94a0c4ec513393d4779e6453c97743a43ca3ed9..1e30beaaaddbf485b28f1d506ede1a828cf43623 100644
--- a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
+++ b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
@@ -100,6 +100,17 @@ Polymer({
issue: {
type: Object,
value: null,
+ observer: 'maybeShowIssueView_',
+ },
+
+ /**
+ * The header text.
+ * @private {string}
+ */
+ issueHeaderText_: {
+ type: String,
+ readOnly: true,
+ value: loadTimeData.getString('issueHeader'),
},
/**
@@ -301,10 +312,15 @@ Polymer({
*/
computeHeaderText_: function(view, headerText) {
switch (view) {
- case media_router.MediaRouterView.SINK_LIST:
- return this.headerText;
case media_router.MediaRouterView.CAST_MODE_LIST:
return this.selectCastModeHeaderText_;
+ case media_router.MediaRouterView.ISSUE:
+ return this.issueHeaderText_;
+ case media_router.MediaRouterView.ROUTE_DETAILS:
+ return this.currentRoute_ ?
+ this.sinkMap_[this.currentRoute_.sinkId].name : '';
+ case media_router.MediaRouterView.SINK_LIST:
+ return this.headerText;
default:
return '';
}
@@ -532,6 +548,17 @@ Polymer({
},
/**
+ * Updates |currentView_| if there is a new blocking issue.
+ *
+ * @param {?media_router.Issue} issue The new issue.
+ * @private
+ */
+ maybeShowIssueView_: function(issue) {
+ if (!!issue && issue.isBlocking)
+ this.currentView_ = media_router.MediaRouterView.ISSUE;
+ },
+
+ /**
* Handles a cast mode selection. Updates |headerText|, |headerTextTooltip|,
* and |selectedCastModeValue_|.
*

Powered by Google App Engine
This is Rietveld 408576698