blob: 8632af270ca06ece87b638dd7f2b696de51f59b2 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @interface
*/
export default class MarkerDecorator {
/**
* @param {!SDK.DOMNode} node
* @return {?{title: string, color: string}}
*/
decorate(node) {}
}
/**
* @implements {MarkerDecorator}
* @unrestricted
*/
export class GenericDecorator {
/**
* @param {!Root.Runtime.Extension} extension
*/
constructor(extension) {
this._title = Common.UIString(extension.title());
this._color = extension.descriptor()['color'];
}
/**
* @override
* @param {!SDK.DOMNode} node
* @return {?{title: string, color: string}}
*/
decorate(node) {
return {title: this._title, color: this._color};
}
}
/* Legacy exported object */
self.Elements = self.Elements || {};
/* Legacy exported object */
Elements = Elements || {};
/** @interface */
Elements.MarkerDecorator = MarkerDecorator;
Elements.GenericDecorator = GenericDecorator;