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

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

Issue 1521433002: [MediaRouter UI] Compile MR WebUI js code with Closure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase again Created 4 years, 11 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/media_router_data.js
diff --git a/chrome/browser/resources/media_router/media_router_data.js b/chrome/browser/resources/media_router/media_router_data.js
index ea21e637145e1afc6563c6f43c3bd0c315909842..f28ccd5db9c5f1bbc220dc337a11974277e8a2d9 100644
--- a/chrome/browser/resources/media_router/media_router_data.js
+++ b/chrome/browser/resources/media_router/media_router_data.js
@@ -4,74 +4,76 @@
// Any strings used here will already be localized. Values such as
// CastMode.type or IDs will be defined elsewhere and determined later.
-cr.define('media_router', function() {
- 'use strict';
-
- /**
- * This corresponds to the C++ MediaCastMode, with the exception of AUTO.
- * See below for details. Note to support fast bitset operations, the values
- * here are (1 << [corresponding value in MR]).
- * @enum {number}
- */
- var CastModeType = {
- // Note: AUTO mode is only used to configure the sink list container to show
- // all sinks. Individual sinks are configured with a specific cast mode
- // (DEFAULT, TAB_MIRROR, DESKTOP_MIRROR).
- AUTO: -1,
- DEFAULT: 0x1,
- TAB_MIRROR: 0x2,
- DESKTOP_MIRROR: 0x4,
- };
-
- /**
- * This corresponds to the C++ MediaRouterMetrics MediaRouterUserAction.
- * @enum {number}
- */
- var MediaRouterUserAction = {
- CHANGE_MODE: 0,
- START_LOCAL: 1,
- STOP_LOCAL: 2,
- CLOSE: 3,
- STATUS_REMOTE: 4,
- };
-
- /**
- * The possible states of the Media Router dialog. Used to determine which
- * components to show.
- * @enum {string}
- */
- var MediaRouterView = {
- CAST_MODE_LIST: 'cast-mode-list',
- FILTER: 'filter',
- ISSUE: 'issue',
- ROUTE_DETAILS: 'route-details',
- SINK_LIST: 'sink-list',
- };
-
- /**
- * This corresponds to the C++ MediaSink IconType.
- * @enum {number}
- */
- var SinkIconType = {
- CAST: 0,
- CAST_AUDIO: 1,
- CAST_AUDIO_GROUP: 2,
- GENERIC: 3,
- HANGOUT: 4,
- };
- /**
- * @enum {string}
- */
- var SinkStatus = {
- IDLE: 'idle',
- ACTIVE: 'active',
- REQUEST_PENDING: 'request_pending'
- };
+cr.exportPath('media_router');
+
+/**
+ * This corresponds to the C++ MediaCastMode, with the exception of AUTO.
+ * See below for details. Note to support fast bitset operations, the values
+ * here are (1 << [corresponding value in MR]).
+ * @enum {number}
+ */
+media_router.CastModeType = {
+ // Note: AUTO mode is only used to configure the sink list container to show
+ // all sinks. Individual sinks are configured with a specific cast mode
+ // (DEFAULT, TAB_MIRROR, DESKTOP_MIRROR).
+ AUTO: -1,
+ DEFAULT: 0x1,
+ TAB_MIRROR: 0x2,
+ DESKTOP_MIRROR: 0x4,
+};
+
+/**
+ * This corresponds to the C++ MediaRouterMetrics MediaRouterUserAction.
+ * @enum {number}
+ */
+media_router.MediaRouterUserAction = {
+ CHANGE_MODE: 0,
+ START_LOCAL: 1,
+ STOP_LOCAL: 2,
+ CLOSE: 3,
+ STATUS_REMOTE: 4,
+};
+
+/**
+ * The possible states of the Media Router dialog. Used to determine which
+ * components to show.
+ * @enum {string}
+ */
+media_router.MediaRouterView = {
+ CAST_MODE_LIST: 'cast-mode-list',
+ FILTER: 'filter',
+ ISSUE: 'issue',
+ ROUTE_DETAILS: 'route-details',
+ SINK_LIST: 'sink-list',
+};
+
+/**
+ * This corresponds to the C++ MediaSink IconType.
+ * @enum {number}
+ */
+media_router.SinkIconType = {
+ CAST: 0,
+ CAST_AUDIO: 1,
+ CAST_AUDIO_GROUP: 2,
+ GENERIC: 3,
+ HANGOUT: 4,
+};
+
+/**
+ * @enum {string}
+ */
+media_router.SinkStatus = {
+ IDLE: 'idle',
+ ACTIVE: 'active',
+ REQUEST_PENDING: 'request_pending'
+};
+cr.define('media_router', function() {
+ 'use strict';
/**
- * @param {media_router.CastModeType} type The type of cast mode.
+ * @param {number} type The type of cast mode.
* @param {string} description The description of the cast mode.
* @param {?string} host The hostname of the site to cast.
* @constructor
@@ -92,10 +94,9 @@ cr.define('media_router', function() {
* Placeholder object for AUTO cast mode. See comment in CastModeType.
* @const {!media_router.CastMode}
*/
- var AUTO_CAST_MODE = new CastMode(CastModeType.AUTO,
+ var AUTO_CAST_MODE = new CastMode(media_router.CastModeType.AUTO,
loadTimeData.getString('autoCastMode'), null);
-
/**
* @param {string} id The ID of this issue.
* @param {string} title The issue title.
@@ -201,10 +202,10 @@ cr.define('media_router', function() {
/** @type {?string} */
this.domain = domain;
- /** @type {SinkIconType} */
+ /** @type {!media_router.SinkIconType} */
this.iconType = iconType;
- /** @type {media_router.SinkStatus} */
+ /** @type {!media_router.SinkStatus} */
this.status = status;
/** @type {number} */
@@ -228,11 +229,6 @@ cr.define('media_router', function() {
return {
AUTO_CAST_MODE: AUTO_CAST_MODE,
- CastModeType: CastModeType,
- MediaRouterUserAction: MediaRouterUserAction,
- MediaRouterView: MediaRouterView,
- SinkIconType: SinkIconType,
- SinkStatus: SinkStatus,
CastMode: CastMode,
Issue: Issue,
Route: Route,

Powered by Google App Engine
This is Rietveld 408576698