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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/HistoryInput.js

Issue 2604883002: DevTools: namespace globals (Closed)
Patch Set: address CL feedback Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 UI.HistoryInput = class extends HTMLInputElement { 7 UI.HistoryInput = class extends HTMLInputElement {
8 constructor() { 8 constructor() {
9 super(); 9 super();
10 } 10 }
11 11
12 /** 12 /**
13 * @return {!UI.HistoryInput} 13 * @return {!UI.HistoryInput}
14 */ 14 */
15 static create() { 15 static create() {
16 if (!UI.HistoryInput._constructor) 16 if (!UI.HistoryInput._constructor)
17 UI.HistoryInput._constructor = registerCustomElement('input', 'history-inp ut', UI.HistoryInput.prototype); 17 UI.HistoryInput._constructor = UI.registerCustomElement('input', 'history- input', UI.HistoryInput.prototype);
18 18
19 return /** @type {!UI.HistoryInput} */ (new UI.HistoryInput._constructor()); 19 return /** @type {!UI.HistoryInput} */ (new UI.HistoryInput._constructor());
20 } 20 }
21 21
22 /** 22 /**
23 * @override 23 * @override
24 */ 24 */
25 createdCallback() { 25 createdCallback() {
26 this._history = ['']; 26 this._history = [''];
27 this._historyPosition = 0; 27 this._historyPosition = 0;
(...skipping 29 matching lines...) Expand all
57 } 57 }
58 58
59 _saveToHistory() { 59 _saveToHistory() {
60 if (this._history.length > 1 && this._history[this._history.length - 2] === this.value) 60 if (this._history.length > 1 && this._history[this._history.length - 2] === this.value)
61 return; 61 return;
62 this._history[this._history.length - 1] = this.value; 62 this._history[this._history.length - 1] = this.value;
63 this._historyPosition = this._history.length - 1; 63 this._historyPosition = this._history.length - 1;
64 this._history.push(''); 64 this._history.push('');
65 } 65 }
66 }; 66 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/FilterBar.js ('k') | third_party/WebKit/Source/devtools/front_end/ui/Icon.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698