Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 <include src="media_router_data.js"> | 5 <include src="media_router_data.js"> |
| 6 <include src="media_router_ui_interface.js"> | 6 <include src="media_router_ui_interface.js"> |
| 7 | 7 |
| 8 // Handles user events for the Media Router UI. | 8 // Handles user events for the Media Router UI. |
| 9 cr.define('media_router', function() { | 9 cr.define('media_router', function() { |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 function onCastModeSelected(event) { | 73 function onCastModeSelected(event) { |
| 74 /** @type {{castModeType: number}} */ | 74 /** @type {{castModeType: number}} */ |
| 75 var detail = event.detail; | 75 var detail = event.detail; |
| 76 media_router.browserApi.reportSelectedCastMode(detail.castModeType); | 76 media_router.browserApi.reportSelectedCastMode(detail.castModeType); |
| 77 } | 77 } |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * Updates the preference that the user has seen the first run flow. | 80 * Updates the preference that the user has seen the first run flow. |
| 81 * Called when the user clicks on the acknowledgement button on the first run | 81 * Called when the user clicks on the acknowledgement button on the first run |
| 82 * flow. | 82 * flow. |
| 83 * | |
| 84 * @param {!Event} event | |
| 85 * Parameters in |event|.detail: | |
| 86 * optedIntoCloudServices - whether or not the user opted into cloud | |
| 87 * services. | |
| 83 */ | 88 */ |
| 84 function onAcknowledgeFirstRunFlow() { | 89 function onAcknowledgeFirstRunFlow(event) { |
| 85 media_router.browserApi.acknowledgeFirstRunFlow(); | 90 var detail = event.detail; |
| 91 /** @type {{optedIntoCloudServices: boolean}} */ | |
|
imcheng
2016/01/25 19:21:06
move this line above "var detail = ..."
apacible
2016/01/26 01:12:56
Done.
| |
| 92 media_router.browserApi.acknowledgeFirstRunFlow( | |
| 93 detail.optedIntoCloudServices); | |
| 86 } | 94 } |
| 87 | 95 |
| 88 /** | 96 /** |
| 89 * Closes the dialog. | 97 * Closes the dialog. |
| 90 * Called when the user clicks the close button on the dialog. | 98 * Called when the user clicks the close button on the dialog. |
| 91 */ | 99 */ |
| 92 function onCloseDialogEvent() { | 100 function onCloseDialogEvent() { |
| 93 container.maybeReportUserFirstAction( | 101 container.maybeReportUserFirstAction( |
| 94 media_router.MediaRouterUserAction.CLOSE); | 102 media_router.MediaRouterUserAction.CLOSE); |
| 95 media_router.browserApi.closeDialog(); | 103 media_router.browserApi.closeDialog(); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 273 var detail = event.detail; | 281 var detail = event.detail; |
| 274 media_router.browserApi.reportSinkCount(detail.sinkCount); | 282 media_router.browserApi.reportSinkCount(detail.sinkCount); |
| 275 } | 283 } |
| 276 | 284 |
| 277 return { | 285 return { |
| 278 initialize: initialize, | 286 initialize: initialize, |
| 279 }; | 287 }; |
| 280 }); | 288 }); |
| 281 | 289 |
| 282 window.addEventListener('load', media_router.initialize); | 290 window.addEventListener('load', media_router.initialize); |
| OLD | NEW |