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 // This Polymer element shows information from media that is currently cast | 5 // This Polymer element shows information from media that is currently cast |
| 6 // to a device. | 6 // to a device. |
| 7 Polymer({ | 7 Polymer({ |
| 8 is: 'route-details', | 8 is: 'route-details', |
| 9 | 9 |
| 10 properties: { | 10 properties: { |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 * The route to show. | 21 * The route to show. |
| 22 * @type {?media_router.Route} | 22 * @type {?media_router.Route} |
| 23 */ | 23 */ |
| 24 route: { | 24 route: { |
| 25 type: Object, | 25 type: Object, |
| 26 value: null, | 26 value: null, |
| 27 observer: 'maybeLoadCustomController_', | 27 observer: 'maybeLoadCustomController_', |
| 28 }, | 28 }, |
| 29 | 29 |
| 30 /** | 30 /** |
| 31 * The text for the join button. | |
| 32 * @private {string} | |
| 33 */ | |
| 34 joinButtonText_: { | |
| 35 type: String, | |
| 36 readOnly: true, | |
| 37 value: loadTimeData.getString('joinButton'), | |
| 38 }, | |
| 39 | |
| 40 /** | |
| 31 * The text for the stop casting button. | 41 * The text for the stop casting button. |
| 32 * @private {string} | 42 * @private {string} |
| 33 */ | 43 */ |
| 34 stopCastingButtonText_: { | 44 stopCastingButtonText_: { |
| 35 type: String, | 45 type: String, |
| 36 readOnly: true, | 46 readOnly: true, |
| 37 value: loadTimeData.getString('stopCastingButton'), | 47 value: loadTimeData.getString('stopCastingButton'), |
| 38 }, | 48 }, |
| 39 | 49 |
| 40 /** | 50 /** |
| 41 * Whether the custom controller should be hidden. | 51 * Whether the custom controller should be hidden. |
| 42 * A custom controller is shown iff |route| specifies customControllerPath | 52 * A custom controller is shown iff |route| specifies customControllerPath |
| 43 * and the view can be loaded. | 53 * and the view can be loaded. |
| 44 * @private {boolean} | 54 * @private {boolean} |
| 45 */ | 55 */ |
| 46 isCustomControllerHidden_: { | 56 isCustomControllerHidden_: { |
| 47 type: Boolean, | 57 type: Boolean, |
| 48 value: true, | 58 value: true, |
| 49 }, | 59 }, |
| 50 }, | 60 }, |
| 51 | 61 |
| 52 /** | 62 /** |
| 63 * Fires a join-route-click event. This is called when the button to join | |
| 64 * the current route is clicked. | |
| 65 * | |
| 66 * @private | |
| 67 */ | |
| 68 joinRoute_: function() { | |
|
apacible
2015/12/18 22:34:19
nit: alphabetize after closeRoute_.
matt.boetger
2015/12/18 23:37:15
Done.
| |
| 69 this.fire('join-route-click', {route: this.route}); | |
| 70 }, | |
| 71 | |
| 72 /** | |
| 53 * Fires a close-route-click event. This is called when the button to close | 73 * Fires a close-route-click event. This is called when the button to close |
| 54 * the current route is clicked. | 74 * the current route is clicked. |
| 55 * | 75 * |
| 56 * @private | 76 * @private |
| 57 */ | 77 */ |
| 58 closeRoute_: function() { | 78 closeRoute_: function() { |
| 59 this.fire('close-route-click', {route: this.route}); | 79 this.fire('close-route-click', {route: this.route}); |
| 60 }, | 80 }, |
| 61 | 81 |
| 62 /** | 82 /** |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 89 extensionview.load(this.route.customControllerPath) | 109 extensionview.load(this.route.customControllerPath) |
| 90 .then(function() { | 110 .then(function() { |
| 91 // Load was successful; show the custom controller. | 111 // Load was successful; show the custom controller. |
| 92 that.isCustomControllerHidden_ = false; | 112 that.isCustomControllerHidden_ = false; |
| 93 }, function() { | 113 }, function() { |
| 94 // Load was unsuccessful; fall back to default view. | 114 // Load was unsuccessful; fall back to default view. |
| 95 that.isCustomControllerHidden_ = true; | 115 that.isCustomControllerHidden_ = true; |
| 96 }); | 116 }); |
| 97 }, | 117 }, |
| 98 }); | 118 }); |
| OLD | NEW |