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

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

Issue 1984743002: [Media Router WebUI] Add slight delay before requesting initial data for Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/media_router/media_router.js
diff --git a/chrome/browser/resources/media_router/media_router.js b/chrome/browser/resources/media_router/media_router.js
index 26fd6eb5b6a4433a81a7d44ec99c7fea8e2b2453..834f9effc655bd84f1fc3004b5d1c4caf8872abb 100644
--- a/chrome/browser/resources/media_router/media_router.js
+++ b/chrome/browser/resources/media_router/media_router.js
@@ -20,7 +20,9 @@ cr.define('media_router', function() {
* router content, such as the media sink and media route lists.
*/
function initialize() {
- media_router.browserApi.requestInitialData();
+ // For non-Mac platforms, request data immediately after initialization.
+ if (!cr.isMac)
+ onRequestInitialData();
container = /** @type {!MediaRouterContainerElement} */
($('media-router-container'));
@@ -51,6 +53,8 @@ cr.define('media_router', function() {
container.addEventListener('report-sink-count', onSinkCountReported);
container.addEventListener('report-resolved-route',
onReportRouteCreationOutcome);
+ container.addEventListener('request-initial-data',
+ onRequestInitialData);
container.addEventListener('search-sinks-and-create-route',
onSearchSinksAndCreateRoute);
container.addEventListener('show-initial-state', onShowInitialState);
@@ -290,6 +294,13 @@ cr.define('media_router', function() {
}
/**
+ * Requests for initial data to load into the dialog.
+ */
+ function onRequestInitialData() {
+ media_router.browserApi.requestInitialData();
+ }
+
+ /**
* Reports the initial state of the dialog after it is opened.
* Called after initial data is populated.
*
« no previous file with comments | « chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698