| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @unrestricted |
| 7 */ |
| 8 WebInspector.InlineBreakpoint = class extends HTMLSpanElement { |
| 9 constructor() { |
| 10 super(); |
| 11 } |
| 12 |
| 13 /** |
| 14 * @return {!WebInspector.InlineBreakpoint} |
| 15 */ |
| 16 static create() { |
| 17 if (!WebInspector.InlineBreakpoint._constructor) |
| 18 WebInspector.InlineBreakpoint._constructor = |
| 19 registerCustomElement('span', 'inline-breakpoint', WebInspector.Inline
Breakpoint.prototype); |
| 20 return /** @type {!WebInspector.InlineBreakpoint} */ (new WebInspector.Inlin
eBreakpoint._constructor()); |
| 21 } |
| 22 |
| 23 setEnabled(enabled) { |
| 24 if (!enabled) |
| 25 this._swatchInner.classList.add('breakpoint-disabled'); |
| 26 else |
| 27 this._swatchInner.classList.remove('breakpoint-disabled'); |
| 28 } |
| 29 |
| 30 setConditional(conditional) { |
| 31 // different type for never pause here (condition === "false") |
| 32 if (conditional) |
| 33 this._swatchInner.classList.add('inline-condition-breakpoint'); |
| 34 else |
| 35 this._swatchInner.classList.remove('inline-condition-breakpoint'); |
| 36 } |
| 37 |
| 38 /** |
| 39 * @override |
| 40 */ |
| 41 createdCallback() { |
| 42 var root = WebInspector.createShadowRootWithCoreStyles(this, 'ui/inlineBreak
point.css'); |
| 43 this._swatchInner = root.createChild('span', 'inline-breakpoint'); |
| 44 this._swatchInner.addEventListener('dblclick', (e) => e.consume(), false); |
| 45 this._swatchInner.addEventListener('mousedown', (e) => e.consume(), false); |
| 46 } |
| 47 }; |
| OLD | NEW |