Skip to content

Commit fe89cb3

Browse files
TimvdLippeCommit Bot
authored andcommitted
Migrate console_counters/ to import cross-module
Bug: 1006759 Change-Id: I307230df99c9413113c6cb3456625229f7ceeb41 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2051962 Reviewed-by: Paul Lewis <[email protected]> Commit-Queue: Tim van der Lippe <[email protected]>
1 parent 1b7303c commit fe89cb3

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

front_end/console_counters/WarningErrorCounter.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,33 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import * as Common from '../common/common.js';
6+
import * as SDK from '../sdk/sdk.js';
7+
import * as UI from '../ui/ui.js';
8+
59
/**
6-
* @implements {UI.ToolbarItem.Provider}
10+
* @implements {UI.Toolbar.Provider}
711
* @unrestricted
812
*/
913
export class WarningErrorCounter {
1014
constructor() {
1115
WarningErrorCounter._instanceForTest = this;
1216

1317
const countersWrapper = createElement('div');
14-
this._toolbarItem = new UI.ToolbarItem(countersWrapper);
18+
this._toolbarItem = new UI.Toolbar.ToolbarItem(countersWrapper);
1519

1620
this._counter = createElement('div');
1721
this._counter.addEventListener('click', self.Common.console.show.bind(self.Common.console), false);
18-
const shadowRoot = UI.createShadowRootWithCoreStyles(this._counter, 'console_counters/errorWarningCounter.css');
22+
const shadowRoot =
23+
UI.Utils.createShadowRootWithCoreStyles(this._counter, 'console_counters/errorWarningCounter.css');
1924
countersWrapper.appendChild(this._counter);
2025

2126
this._violationCounter = createElement('div');
2227
this._violationCounter.addEventListener('click', () => {
2328
self.UI.viewManager.showView('audits');
2429
});
2530
const violationShadowRoot =
26-
UI.createShadowRootWithCoreStyles(this._violationCounter, 'console_counters/errorWarningCounter.css');
31+
UI.Utils.createShadowRootWithCoreStyles(this._violationCounter, 'console_counters/errorWarningCounter.css');
2732
if (Root.Runtime.experiments.isEnabled('spotlight')) {
2833
countersWrapper.appendChild(this._violationCounter);
2934
}
@@ -38,7 +43,7 @@ export class WarningErrorCounter {
3843
this._errorCount = -1;
3944
this._warningCount = -1;
4045
this._violationCount = -1;
41-
this._throttler = new Common.Throttler(100);
46+
this._throttler = new Common.Throttler.Throttler(100);
4247

4348
self.SDK.consoleModel.addEventListener(SDK.ConsoleModel.Events.ConsoleCleared, this._update, this);
4449
self.SDK.consoleModel.addEventListener(SDK.ConsoleModel.Events.MessageAdded, this._update, this);
@@ -145,7 +150,7 @@ export class WarningErrorCounter {
145150

146151
/**
147152
* @override
148-
* @return {?UI.ToolbarItem}
153+
* @return {?UI.Toolbar.ToolbarItem}
149154
*/
150155
item() {
151156
return this._toolbarItem;

0 commit comments

Comments
 (0)