| 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 // This Polymer element contains the entire media router interface. It handles | 5 // This Polymer element contains the entire media router interface. It handles |
| 6 // hiding and showing specific components. | 6 // hiding and showing specific components. |
| 7 Polymer({ | 7 Polymer({ |
| 8 is: 'media-router-container', | 8 is: 'media-router-container', |
| 9 | 9 |
| 10 properties: { | 10 properties: { |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 */ | 291 */ |
| 292 shareYourScreenSubheadingText_: { | 292 shareYourScreenSubheadingText_: { |
| 293 type: String, | 293 type: String, |
| 294 readOnly: true, | 294 readOnly: true, |
| 295 value: function() { | 295 value: function() { |
| 296 return loadTimeData.getString('shareYourScreenSubheading'); | 296 return loadTimeData.getString('shareYourScreenSubheading'); |
| 297 }, | 297 }, |
| 298 }, | 298 }, |
| 299 | 299 |
| 300 /** | 300 /** |
| 301 * Whether to show the user domain of sinks associated with identity. |
| 302 * @type {boolean} |
| 303 */ |
| 304 showDomain: { |
| 305 type: Boolean, |
| 306 value: false, |
| 307 }, |
| 308 |
| 309 /** |
| 301 * Whether to show the first run flow. | 310 * Whether to show the first run flow. |
| 302 * @type {boolean} | 311 * @type {boolean} |
| 303 */ | 312 */ |
| 304 showFirstRunFlow: { | 313 showFirstRunFlow: { |
| 305 type: Boolean, | 314 type: Boolean, |
| 306 value: false, | 315 value: false, |
| 307 observer: 'updateElementPositioning_', | 316 observer: 'updateElementPositioning_', |
| 308 }, | 317 }, |
| 309 | 318 |
| 310 /** | 319 /** |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 * Whether the user has already taken an action. | 384 * Whether the user has already taken an action. |
| 376 * @type {boolean} | 385 * @type {boolean} |
| 377 */ | 386 */ |
| 378 userHasTakenInitialAction_: { | 387 userHasTakenInitialAction_: { |
| 379 type: Boolean, | 388 type: Boolean, |
| 380 value: false, | 389 value: false, |
| 381 }, | 390 }, |
| 382 }, | 391 }, |
| 383 | 392 |
| 384 listeners: { | 393 listeners: { |
| 394 'header-height-changed': 'updateElementPositioning_', |
| 385 'header-or-arrow-click': 'toggleCastModeHidden_', | 395 'header-or-arrow-click': 'toggleCastModeHidden_', |
| 386 'mouseleave': 'onMouseLeave_', | 396 'mouseleave': 'onMouseLeave_', |
| 387 'mouseenter': 'onMouseEnter_', | 397 'mouseenter': 'onMouseEnter_', |
| 388 }, | 398 }, |
| 389 | 399 |
| 390 observers: [ | 400 observers: [ |
| 391 'maybeUpdateStartSinkDisplayStartTime_(currentView_, sinksToShow_)', | 401 'maybeUpdateStartSinkDisplayStartTime_(currentView_, sinksToShow_)', |
| 392 ], | 402 ], |
| 393 | 403 |
| 394 ready: function() { | 404 ready: function() { |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 (!!issue && issue.isBlocking); | 734 (!!issue && issue.isBlocking); |
| 725 }, | 735 }, |
| 726 | 736 |
| 727 /** | 737 /** |
| 728 * Returns whether the sink domain for |sink| should be hidden. | 738 * Returns whether the sink domain for |sink| should be hidden. |
| 729 * @param {!media_router.Sink} sink | 739 * @param {!media_router.Sink} sink |
| 730 * @return {boolean} |true| if the domain should be hidden. | 740 * @return {boolean} |true| if the domain should be hidden. |
| 731 * @private | 741 * @private |
| 732 */ | 742 */ |
| 733 computeSinkDomainHidden_: function(sink) { | 743 computeSinkDomainHidden_: function(sink) { |
| 734 // TODO(amp): Check the domain of Chrome profile identity and only show the | 744 return !this.showDomain || this.isEmptyOrWhitespace_(sink.domain); |
| 735 // sink domain if it doesn't match the profile domain. crbug.com/570797 | |
| 736 return this.isEmptyOrWhitespace_(sink.domain); | |
| 737 }, | 745 }, |
| 738 | 746 |
| 739 /** | 747 /** |
| 740 * Returns the subtext to be shown for |sink|. Only called if | 748 * Returns the subtext to be shown for |sink|. Only called if |
| 741 * |computeSinkSubtextHidden_| returns false for the same |sink| and | 749 * |computeSinkSubtextHidden_| returns false for the same |sink| and |
| 742 * |sinkToRouteMap|. | 750 * |sinkToRouteMap|. |
| 743 * @param {!media_router.Sink} sink | 751 * @param {!media_router.Sink} sink |
| 744 * @param {!Object<!string, ?media_router.Route>} sinkToRouteMap | 752 * @param {!Object<!string, ?media_router.Route>} sinkToRouteMap |
| 745 * @return {?string} The subtext to be shown. | 753 * @return {?string} The subtext to be shown. |
| 746 * @private | 754 * @private |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1219 /** | 1227 /** |
| 1220 * Update the max dialog height and update the positioning of the elements. | 1228 * Update the max dialog height and update the positioning of the elements. |
| 1221 * | 1229 * |
| 1222 * @param {number} height The max height of the Media Router dialog. | 1230 * @param {number} height The max height of the Media Router dialog. |
| 1223 */ | 1231 */ |
| 1224 updateMaxDialogHeight: function(height) { | 1232 updateMaxDialogHeight: function(height) { |
| 1225 this.dialogHeight_ = height; | 1233 this.dialogHeight_ = height; |
| 1226 this.updateElementPositioning_(); | 1234 this.updateElementPositioning_(); |
| 1227 }, | 1235 }, |
| 1228 }); | 1236 }); |
| OLD | NEW |