Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(677)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js

Issue 2681043002: DevTools: Combine TextPrompt events into UI.TextPrompt.TextChangedEvent (Closed)
Patch Set: leave comment Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
index 375e45aab8096a6dc6ccd6d83181d90a197feb44..06160f5a513a7b3de38ae1ffb8a136039d0ed287 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/TextPrompt.js
@@ -307,6 +307,7 @@ UI.TextPrompt = class extends Common.Object {
this._queryRange.endColumn += text.length - this._previousText.length;
this._refreshGhostText();
this._previousText = text;
+ this.emit(new UI.TextPrompt.TextChangedEvent());
this.autoCompleteSoon();
}
@@ -334,7 +335,7 @@ UI.TextPrompt = class extends Common.Object {
this._refreshGhostText();
if (beforeText !== this.textWithCurrentSuggestion())
- this.dispatchEventToListeners(UI.TextPrompt.Events.ItemApplied);
+ this.emit(new UI.TextPrompt.TextChangedEvent());
}
_refreshGhostText() {
@@ -508,7 +509,7 @@ UI.TextPrompt = class extends Common.Object {
this._currentSuggestion = suggestion;
this._refreshGhostText();
if (isIntermediateSuggestion)
- this.dispatchEventToListeners(UI.TextPrompt.Events.ItemApplied);
+ this.emit(new UI.TextPrompt.TextChangedEvent());
}
/**
@@ -531,7 +532,7 @@ UI.TextPrompt = class extends Common.Object {
this._queryRange.startColumn + this._currentSuggestion.length);
this.clearAutocomplete();
- this.dispatchEventToListeners(UI.TextPrompt.Events.ItemAccepted);
+ this.emit(new UI.TextPrompt.TextChangedEvent());
return true;
}
@@ -638,8 +639,5 @@ UI.TextPrompt = class extends Common.Object {
UI.TextPrompt.DefaultAutocompletionTimeout = 250;
-/** @enum {symbol} */
-UI.TextPrompt.Events = {
- ItemApplied: Symbol('text-prompt-item-applied'),
- ItemAccepted: Symbol('text-prompt-item-accepted')
-};
+/** @implements {Common.Emittable} */
+UI.TextPrompt.TextChangedEvent = class {};
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698