| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 /** @const */ var ControlledSettingIndicator = | 6 /** @const */ var ControlledSettingIndicator = |
| 7 options.ControlledSettingIndicator; | 7 options.ControlledSettingIndicator; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * A variant of the {@link ControlledSettingIndicator} that shows the status | 10 * A variant of the {@link ControlledSettingIndicator} that shows the status |
| 11 * of the hotword search setting, including a bubble to show setup errors | 11 * of the hotword search setting, including a bubble to show setup errors |
| 12 * (such as failures to download extension resources). | 12 * (such as failures to download extension resources). |
| 13 * @constructor | 13 * @constructor |
| 14 * @extends {HTMLSpanElement} | 14 * @extends {options.ControlledSettingIndicator} |
| 15 */ | 15 */ |
| 16 var HotwordSearchSettingIndicator = cr.ui.define('span'); | 16 var HotwordSearchSettingIndicator = cr.ui.define('span'); |
| 17 | 17 |
| 18 HotwordSearchSettingIndicator.prototype = { | 18 HotwordSearchSettingIndicator.prototype = { |
| 19 __proto__: ControlledSettingIndicator.prototype, | 19 __proto__: ControlledSettingIndicator.prototype, |
| 20 | 20 |
| 21 /** | 21 /** |
| 22 * Decorates the base element to show the proper icon. | 22 * Decorates the base element to show the proper icon. |
| 23 * @override | 23 * @override |
| 24 */ | 24 */ |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 */ | 62 */ |
| 63 updateBasedOnError: function() { | 63 updateBasedOnError: function() { |
| 64 if (this.errorText_) | 64 if (this.errorText_) |
| 65 this.hidden = false; | 65 this.hidden = false; |
| 66 }, | 66 }, |
| 67 | 67 |
| 68 /** | 68 /** |
| 69 * Toggles showing and hiding the error message bubble. An empty | 69 * Toggles showing and hiding the error message bubble. An empty |
| 70 * |errorText_| indicates that there is no error message. So the bubble | 70 * |errorText_| indicates that there is no error message. So the bubble |
| 71 * only be shown if |errorText_| has a value. | 71 * only be shown if |errorText_| has a value. |
| 72 * @override |
| 72 */ | 73 */ |
| 73 toggleBubble_: function() { | 74 toggleBubble: function() { |
| 74 if (this.showingBubble) { | 75 if (this.showingBubble) { |
| 75 PageManager.hideBubble(); | 76 PageManager.hideBubble(); |
| 76 return; | 77 return; |
| 77 } | 78 } |
| 78 | 79 |
| 79 if (!this.errorText_) | 80 if (!this.errorText_) |
| 80 return; | 81 return; |
| 81 | 82 |
| 82 var self = this; | 83 var self = this; |
| 83 // Create the DOM tree for the bubble content. | 84 // Create the DOM tree for the bubble content. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 99 | 100 |
| 100 PageManager.showBubble(content, this.image, this, this.location); | 101 PageManager.showBubble(content, this.image, this, this.location); |
| 101 }, | 102 }, |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 // Export | 105 // Export |
| 105 return { | 106 return { |
| 106 HotwordSearchSettingIndicator: HotwordSearchSettingIndicator | 107 HotwordSearchSettingIndicator: HotwordSearchSettingIndicator |
| 107 }; | 108 }; |
| 108 }); | 109 }); |
| OLD | NEW |