Chromium Code Reviews| Index: Source/devtools/front_end/main/Main.js |
| diff --git a/Source/devtools/front_end/main/Main.js b/Source/devtools/front_end/main/Main.js |
| index 5e1e72ae43da027f7ffe362d168f187b05f4ced1..acca1d94b09fe6d44af60805d64ee7687dfd22c4 100644 |
| --- a/Source/devtools/front_end/main/Main.js |
| +++ b/Source/devtools/front_end/main/Main.js |
| @@ -789,7 +789,8 @@ WebInspector.__defineGetter__("inspectedPageURL", function() |
| */ |
| WebInspector.Main.WarningErrorCounter = function() |
| { |
| - this._counter = new WebInspector.ToolbarCounter(["error-icon", "warning-icon"]); |
| + this._counter = new WebInspector.ToolbarCounter(["error-icon", "revokedError-icon", "warning-icon"]); |
| + WebInspector.Main.WarningErrorCounter._instanceForTest = this._counter; |
| this._counter.addEventListener("click", showConsole); |
| function showConsole() |
| @@ -805,14 +806,17 @@ WebInspector.Main.WarningErrorCounter.prototype = { |
| _updateErrorAndWarningCounts: function() |
| { |
| var errors = 0; |
| + var revokedErrors = 0; |
| var warnings = 0; |
| var targets = WebInspector.targetManager.targets(); |
| for (var i = 0; i < targets.length; ++i) { |
| - errors = errors + targets[i].consoleModel.errors; |
| - warnings = warnings + targets[i].consoleModel.warnings; |
| + errors += targets[i].consoleModel.errors(); |
| + revokedErrors += targets[i].consoleModel.revokedErrors(); |
| + warnings += targets[i].consoleModel.warnings(); |
| } |
| - this._counter.setCounter("error-icon", errors, WebInspector.UIString(errors > 1 ? "%d errors" : "%d error", errors)); |
| - this._counter.setCounter("warning-icon", warnings, WebInspector.UIString(warnings > 1 ? "%d warnings" : "%d warning", warnings)); |
| + this._counter.setCounter("error-icon", errors, WebInspector.UIString((!errors || errors > 1) ? "%d errors" : "%d error", errors)); |
|
dgozman
2015/04/21 09:16:36
|errors === 0| should hide the counter, there is n
pfeldman
2015/04/21 12:15:27
How would I know that it hides it? I'll still appl
|
| + this._counter.setCounter("revokedError-icon", revokedErrors, WebInspector.UIString((!revokedErrors || revokedErrors > 1) ? "%d handled promise rejections" : "%d handled promise rejection", revokedErrors)); |
| + this._counter.setCounter("warning-icon", warnings, WebInspector.UIString((!warnings || warnings > 1) ? "%d warnings" : "%d warning", warnings)); |
| WebInspector.inspectorView.toolbarItemResized(); |
| }, |