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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
375 * Whether the user has already taken an action. | 375 * Whether the user has already taken an action. |
376 * @type {boolean} | 376 * @type {boolean} |
377 */ | 377 */ |
378 userHasTakenInitialAction_: { | 378 userHasTakenInitialAction_: { |
379 type: Boolean, | 379 type: Boolean, |
380 value: false, | 380 value: false, |
381 }, | 381 }, |
382 }, | 382 }, |
383 | 383 |
384 listeners: { | 384 listeners: { |
385 'header-height-changed': 'updateElementPositioning_', | |
385 'header-or-arrow-click': 'toggleCastModeHidden_', | 386 'header-or-arrow-click': 'toggleCastModeHidden_', |
386 'mouseleave': 'onMouseLeave_', | 387 'mouseleave': 'onMouseLeave_', |
387 'mouseenter': 'onMouseEnter_', | 388 'mouseenter': 'onMouseEnter_', |
388 }, | 389 }, |
389 | 390 |
390 observers: [ | 391 observers: [ |
391 'maybeUpdateStartSinkDisplayStartTime_(currentView_, sinksToShow_)', | 392 'maybeUpdateStartSinkDisplayStartTime_(currentView_, sinksToShow_)', |
392 ], | 393 ], |
393 | 394 |
394 ready: function() { | 395 ready: function() { |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
724 (!!issue && issue.isBlocking); | 725 (!!issue && issue.isBlocking); |
725 }, | 726 }, |
726 | 727 |
727 /** | 728 /** |
728 * Returns whether the sink domain for |sink| should be hidden. | 729 * Returns whether the sink domain for |sink| should be hidden. |
729 * @param {!media_router.Sink} sink | 730 * @param {!media_router.Sink} sink |
730 * @return {boolean} |true| if the domain should be hidden. | 731 * @return {boolean} |true| if the domain should be hidden. |
731 * @private | 732 * @private |
732 */ | 733 */ |
733 computeSinkDomainHidden_: function(sink) { | 734 computeSinkDomainHidden_: function(sink) { |
734 // TODO(amp): Check the domain of Chrome profile identity and only show the | 735 return !this.showDomain || this.isEmptyOrWhitespace_(sink.domain); |
imcheng
2016/02/17 00:51:08
showDomain should be defined above in the properti
amp
2016/02/17 02:11:37
Done.
| |
735 // sink domain if it doesn't match the profile domain. crbug.com/570797 | |
736 return this.isEmptyOrWhitespace_(sink.domain); | |
737 }, | 736 }, |
738 | 737 |
739 /** | 738 /** |
740 * Returns the subtext to be shown for |sink|. Only called if | 739 * Returns the subtext to be shown for |sink|. Only called if |
741 * |computeSinkSubtextHidden_| returns false for the same |sink| and | 740 * |computeSinkSubtextHidden_| returns false for the same |sink| and |
742 * |sinkToRouteMap|. | 741 * |sinkToRouteMap|. |
743 * @param {!media_router.Sink} sink | 742 * @param {!media_router.Sink} sink |
744 * @param {!Object<!string, ?media_router.Route>} sinkToRouteMap | 743 * @param {!Object<!string, ?media_router.Route>} sinkToRouteMap |
745 * @return {?string} The subtext to be shown. | 744 * @return {?string} The subtext to be shown. |
746 * @private | 745 * @private |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1219 /** | 1218 /** |
1220 * Update the max dialog height and update the positioning of the elements. | 1219 * Update the max dialog height and update the positioning of the elements. |
1221 * | 1220 * |
1222 * @param {number} height The max height of the Media Router dialog. | 1221 * @param {number} height The max height of the Media Router dialog. |
1223 */ | 1222 */ |
1224 updateMaxDialogHeight: function(height) { | 1223 updateMaxDialogHeight: function(height) { |
1225 this.dialogHeight_ = height; | 1224 this.dialogHeight_ = height; |
1226 this.updateElementPositioning_(); | 1225 this.updateElementPositioning_(); |
1227 }, | 1226 }, |
1228 }); | 1227 }); |
OLD | NEW |