OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 } | 275 } |
276 | 276 |
277 this._selectionTimeout = setTimeout(moveBackIfOutside.bind(this), 100); | 277 this._selectionTimeout = setTimeout(moveBackIfOutside.bind(this), 100); |
278 }, | 278 }, |
279 | 279 |
280 /** | 280 /** |
281 * @param {boolean=} force | 281 * @param {boolean=} force |
282 */ | 282 */ |
283 _updateAutoComplete: function(force) | 283 _updateAutoComplete: function(force) |
284 { | 284 { |
285 this.clearAutocomplete(); | 285 this._clearAutocompleteElement(); |
286 this.autoCompleteSoon(force); | 286 this.autoCompleteSoon(force); |
287 }, | 287 }, |
288 | 288 |
289 /** | 289 /** |
290 * @param {!Event} event | 290 * @param {!Event} event |
291 */ | 291 */ |
292 onMouseWheel: function(event) | 292 onMouseWheel: function(event) |
293 { | 293 { |
294 // Subclasses can implement. | 294 // Subclasses can implement. |
295 }, | 295 }, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 if (!result) | 369 if (!result) |
370 result = this._acceptSuggestionInternal(); | 370 result = this._acceptSuggestionInternal(); |
371 | 371 |
372 return result; | 372 return result; |
373 }, | 373 }, |
374 | 374 |
375 clearAutocomplete: function() | 375 clearAutocomplete: function() |
376 { | 376 { |
377 if (this.isSuggestBoxVisible()) | 377 if (this.isSuggestBoxVisible()) |
378 this._suggestBox.hide(); | 378 this._suggestBox.hide(); |
| 379 this._clearAutocompleteElement(); |
| 380 }, |
379 | 381 |
| 382 _clearAutocompleteElement: function() |
| 383 { |
380 if (this._completeTimeout) { | 384 if (this._completeTimeout) { |
381 clearTimeout(this._completeTimeout); | 385 clearTimeout(this._completeTimeout); |
382 delete this._completeTimeout; | 386 delete this._completeTimeout; |
383 } | 387 } |
384 | 388 |
385 if (!this.autoCompleteElement) | 389 if (!this.autoCompleteElement) |
386 return; | 390 return; |
387 | 391 |
388 this.autoCompleteElement.remove(); | 392 this.autoCompleteElement.remove(); |
389 delete this.autoCompleteElement; | 393 delete this.autoCompleteElement; |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 }, | 1023 }, |
1020 | 1024 |
1021 /** | 1025 /** |
1022 * @return {string|undefined} | 1026 * @return {string|undefined} |
1023 */ | 1027 */ |
1024 _currentHistoryItem: function() | 1028 _currentHistoryItem: function() |
1025 { | 1029 { |
1026 return this._data[this._data.length - this._historyOffset]; | 1030 return this._data[this._data.length - this._historyOffset]; |
1027 } | 1031 } |
1028 }; | 1032 }; |
OLD | NEW |