tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

CensusHeader.js (2012B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 const {
      8  Component,
      9 } = require("resource://devtools/client/shared/vendor/react.mjs");
     10 const dom = require("resource://devtools/client/shared/vendor/react-dom-factories.js");
     11 const { L10N } = require("resource://devtools/client/memory/utils.js");
     12 const models = require("resource://devtools/client/memory/models.js");
     13 
     14 class CensusHeader extends Component {
     15  static get propTypes() {
     16    return {
     17      diffing: models.diffingModel,
     18    };
     19  }
     20 
     21  render() {
     22    let individualsCell;
     23    if (!this.props.diffing) {
     24      individualsCell = dom.span({
     25        className: "heap-tree-item-field heap-tree-item-individuals",
     26      });
     27    }
     28 
     29    return dom.div(
     30      {
     31        className: "header",
     32      },
     33 
     34      dom.span(
     35        {
     36          className: "heap-tree-item-bytes",
     37          title: L10N.getStr("heapview.field.bytes.tooltip"),
     38        },
     39        L10N.getStr("heapview.field.bytes")
     40      ),
     41 
     42      dom.span(
     43        {
     44          className: "heap-tree-item-count",
     45          title: L10N.getStr("heapview.field.count.tooltip"),
     46        },
     47        L10N.getStr("heapview.field.count")
     48      ),
     49 
     50      dom.span(
     51        {
     52          className: "heap-tree-item-total-bytes",
     53          title: L10N.getStr("heapview.field.totalbytes.tooltip"),
     54        },
     55        L10N.getStr("heapview.field.totalbytes")
     56      ),
     57 
     58      dom.span(
     59        {
     60          className: "heap-tree-item-total-count",
     61          title: L10N.getStr("heapview.field.totalcount.tooltip"),
     62        },
     63        L10N.getStr("heapview.field.totalcount")
     64      ),
     65 
     66      individualsCell,
     67 
     68      dom.span(
     69        {
     70          className: "heap-tree-item-name",
     71          title: L10N.getStr("heapview.field.name.tooltip"),
     72        },
     73        L10N.getStr("heapview.field.name")
     74      )
     75    );
     76  }
     77 }
     78 
     79 module.exports = CensusHeader;