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

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

Issue 1868983003: [Media Router WebUI] Switch back to sink view after blocking issue is resolved. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per mfoltz@'s comments. Fix styling bug. Created 4 years, 8 months 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 4aebf74bb9c72fc4110d74f9d01e790e18416c39..46bf89b7c61ead3901efe3bf7d707724ebf34007 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
@@ -1088,18 +1088,29 @@ Polymer({
},
/**
- * Updates |currentView_| if there is a new blocking issue. Clears any
- * pending route creation properties if the issue corresponds with
- * |pendingCreatedRouteId_|.
+ * Updates |currentView_| if there is a new blocking issue or a blocking
+ * issue is resolved. Clears any pending route creation properties if the
+ * issue corresponds with |pendingCreatedRouteId_|.
*
- * @param {?media_router.Issue} issue The new issue.
+ * @param {?media_router.Issue} issue The new issue, or null if the
+ * blocking issue was resolved.
* @private
*/
maybeShowIssueView_: function(issue) {
- if (!!issue && issue.isBlocking)
- this.currentView_ = media_router.MediaRouterView.ISSUE;
- else
- this.updateElementPositioning_();
+ if (!!issue) {
+ if (issue.isBlocking) {
+ this.currentView_ = media_router.MediaRouterView.ISSUE;
+ } else if (this.currentView_ == media_router.MediaRouterView.SINK_LIST) {
+ // Make space for the non-blocking issue in the sink list.
+ this.updateElementPositioning_();
+ }
+ } else {
+ // Switch back to the sink list if the issue was cleared. If the previous
+ // issue was non-blocking, this would be a no-op. It is expected that
+ // the only way to clear an issue is by user action; the IssueManager
+ // (C++ side) does not clear issues in the UI.
+ this.currentView_ = media_router.MediaRouterView.SINK_LIST;
+ }
if (!!this.pendingCreatedRouteId_ && !!issue &&
issue.routeId == this.pendingCreatedRouteId_) {

Powered by Google App Engine
This is Rietveld 408576698