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

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

Issue 1935553003: [Media Router WebUI] Move calls in ready() and attached() to afterNextRender(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. 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
« no previous file with comments | « no previous file | chrome/test/data/webui/media_router/media_router_container_filter_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2f9283d32d4a7802dfe280d4b4d84c9fde6e6570..f61b2ed6b874889275af2f10c317cfd4ef8de604 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
@@ -359,29 +359,27 @@ Polymer({
ready: function() {
this.elementReadyTimeMs_ = performance.now();
-
- // If this is not on a Mac platform, remove the placeholder. See
- // onFocus_() for more details. ready() is only called once, so no need
- // to check if the placeholder exist before removing.
- if (!cr.isMac)
- this.$$('#focus-placeholder').remove();
-
- document.addEventListener('keydown', this.onKeydown_.bind(this), true);
- this.setSearchFocusHandlers_();
this.showSinkList_();
- },
-
- attached: function() {
- this.updateElementPositioning_();
- // Turn off the spinner after 3 seconds, then report the current number of
- // sinks.
- this.async(function() {
- this.justOpened_ = false;
- this.fire('report-sink-count', {
- sinkCount: this.allSinks.length,
- });
- }, 3000 /* 3 seconds */);
+ Polymer.RenderStatus.afterNextRender(this, function() {
+ // If this is not on a Mac platform, remove the placeholder. See
+ // onFocus_() for more details. ready() is only called once, so no need
+ // to check if the placeholder exist before removing.
+ if (!cr.isMac)
+ this.$$('#focus-placeholder').remove();
+
+ document.addEventListener('keydown', this.onKeydown_.bind(this), true);
+ this.setSearchFocusHandlers_();
+
+ // Turn off the spinner after 3 seconds, then report the current number of
+ // sinks.
+ this.async(function() {
+ this.justOpened_ = false;
+ this.fire('report-sink-count', {
+ sinkCount: this.allSinks.length,
+ });
+ }, 3000 /* 3 seconds */);
+ });
},
/**
« no previous file with comments | « no previous file | chrome/test/data/webui/media_router/media_router_container_filter_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698