| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 return Math.min(kMaxWidth, UI.measurePreferredSize(element, this._element).w
idth); | 122 return Math.min(kMaxWidth, UI.measurePreferredSize(element, this._element).w
idth); |
| 123 } | 123 } |
| 124 | 124 |
| 125 /** | 125 /** |
| 126 * @suppressGlobalPropertiesCheck | 126 * @suppressGlobalPropertiesCheck |
| 127 */ | 127 */ |
| 128 _show() { | 128 _show() { |
| 129 if (this.visible()) | 129 if (this.visible()) |
| 130 return; | 130 return; |
| 131 // TODO(dgozman): take document as a parameter. | 131 // TODO(dgozman): take document as a parameter. |
| 132 this._glassPane.showGlassPane(document); | 132 this._glassPane.show(document); |
| 133 this._rowHeight = | 133 this._rowHeight = |
| 134 UI.measurePreferredSize(this.createElementForItem({text: '1', subtitle:
'12'}), this._element).height; | 134 UI.measurePreferredSize(this.createElementForItem({text: '1', subtitle:
'12'}), this._element).height; |
| 135 } | 135 } |
| 136 | 136 |
| 137 hide() { | 137 hide() { |
| 138 if (!this.visible()) | 138 if (!this.visible()) |
| 139 return; | 139 return; |
| 140 this._userInteracted = false; | 140 this._userInteracted = false; |
| 141 this._glassPane.hideGlassPane(); | 141 this._glassPane.hide(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 /** | 144 /** |
| 145 * @param {boolean=} isIntermediateSuggestion | 145 * @param {boolean=} isIntermediateSuggestion |
| 146 * @return {boolean} | 146 * @return {boolean} |
| 147 */ | 147 */ |
| 148 _applySuggestion(isIntermediateSuggestion) { | 148 _applySuggestion(isIntermediateSuggestion) { |
| 149 if (this._onlyCompletion) { | 149 if (this._onlyCompletion) { |
| 150 this._suggestBoxDelegate.applySuggestion(this._onlyCompletion, isIntermedi
ateSuggestion); | 150 this._suggestBoxDelegate.applySuggestion(this._onlyCompletion, isIntermedi
ateSuggestion); |
| 151 return true; | 151 return true; |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 /** | 360 /** |
| 361 * @typedef {!{text: string, subtitle: (string|undefined), iconType: (string|und
efined), priority: (number|undefined), isSecondary: (boolean|undefined), title:
(string|undefined)}} | 361 * @typedef {!{text: string, subtitle: (string|undefined), iconType: (string|und
efined), priority: (number|undefined), isSecondary: (boolean|undefined), title:
(string|undefined)}} |
| 362 */ | 362 */ |
| 363 UI.SuggestBox.Suggestion; | 363 UI.SuggestBox.Suggestion; |
| 364 | 364 |
| 365 /** | 365 /** |
| 366 * @typedef {!Array<!UI.SuggestBox.Suggestion>} | 366 * @typedef {!Array<!UI.SuggestBox.Suggestion>} |
| 367 */ | 367 */ |
| 368 UI.SuggestBox.Suggestions; | 368 UI.SuggestBox.Suggestions; |
| OLD | NEW |