| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 Coverage.CoverageView = class extends UI.VBox { | 5 Coverage.CoverageView = class extends UI.VBox { |
| 6 constructor() { | 6 constructor() { |
| 7 super(true); | 7 super(true); |
| 8 | 8 |
| 9 /** @type {?Coverage.CoverageModel} */ | 9 /** @type {?Coverage.CoverageModel} */ |
| 10 this._model = null; | 10 this._model = null; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 /** | 118 /** |
| 119 * @implements {SourceFrame.UISourceCodeFrame.LineDecorator} | 119 * @implements {SourceFrame.UISourceCodeFrame.LineDecorator} |
| 120 */ | 120 */ |
| 121 Coverage.CoverageView.LineDecorator = class { | 121 Coverage.CoverageView.LineDecorator = class { |
| 122 /** | 122 /** |
| 123 * @override | 123 * @override |
| 124 * @param {!Workspace.UISourceCode} uiSourceCode | 124 * @param {!Workspace.UISourceCode} uiSourceCode |
| 125 * @param {!TextEditor.CodeMirrorTextEditor} textEditor | 125 * @param {!SourceFrame.SourcesTextEditor} textEditor |
| 126 */ | 126 */ |
| 127 decorate(uiSourceCode, textEditor) { | 127 decorate(uiSourceCode, textEditor) { |
| 128 var gutterType = 'CodeMirror-gutter-coverage'; | 128 var gutterType = 'CodeMirror-gutter-coverage'; |
| 129 | 129 |
| 130 var decorations = uiSourceCode.decorationsForType(Coverage.CoverageView.Line
Decorator.type); | 130 var decorations = uiSourceCode.decorationsForType(Coverage.CoverageView.Line
Decorator.type); |
| 131 textEditor.uninstallGutter(gutterType); | 131 textEditor.uninstallGutter(gutterType); |
| 132 if (!decorations || !decorations.size) | 132 if (!decorations || !decorations.size) |
| 133 return; | 133 return; |
| 134 | 134 |
| 135 textEditor.installGutter(gutterType, false); | 135 textEditor.installGutter(gutterType, false); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 162 */ | 162 */ |
| 163 handleAction(context, actionId) { | 163 handleAction(context, actionId) { |
| 164 var coverageViewId = 'coverage'; | 164 var coverageViewId = 'coverage'; |
| 165 UI.viewManager.showView(coverageViewId) | 165 UI.viewManager.showView(coverageViewId) |
| 166 .then(() => UI.viewManager.view(coverageViewId).widget()) | 166 .then(() => UI.viewManager.view(coverageViewId).widget()) |
| 167 .then(widget => /** @type !Coverage.CoverageView} */ (widget)._toggleRec
ording()); | 167 .then(widget => /** @type !Coverage.CoverageView} */ (widget)._toggleRec
ording()); |
| 168 | 168 |
| 169 return true; | 169 return true; |
| 170 } | 170 } |
| 171 }; | 171 }; |
| OLD | NEW |