memory_dump_view.html revision b2cbf1594f8d6e4ba32d384cf379f62a74ed7654
1<!DOCTYPE html>
2<!--
3Copyright 2015 The Chromium Authors. All rights reserved.
4Use of this source code is governed by a BSD-style license that can be
5found in the LICENSE file.
6-->
7
8<link rel="import" href="/ui/analysis/memory_dump_overview_pane.html">
9
10<polymer-element name="tr-ui-a-memory-dump-view">
11  <template>
12    <style>
13    :host {
14      display: flex;
15      flex-direction: column;
16    }
17
18    #overview_pane,
19    #details_pane_container {
20      flex: 0 0 auto;
21    }
22    </style>
23    <tr-ui-a-memory-dump-overview-pane id="overview_pane">
24    </tr-ui-a-memory-dump-overview-pane>
25    <div id="details_pane_container">
26    </div>
27  </template>
28  <script>
29  'use strict';
30
31  Polymer({
32    created: function() {
33      this.processMemoryDumps_ = undefined;
34    },
35
36    ready: function() {
37      this.$.overview_pane.addEventListener(
38          'selected-memory-cell-changed', this.updateDetailsPane_.bind(this));
39    },
40
41    set processMemoryDumps(processMemoryDumps) {
42      this.processMemoryDumps_ = processMemoryDumps;
43      this.$.overview_pane.processMemoryDumps = this.processMemoryDumps_;
44      this.updateDetailsPane_();
45    },
46
47    get processMemoryDumps() {
48      return this.processMemoryDumps_;
49    },
50
51    updateDetailsPane_: function() {
52      this.$.details_pane_container.textContent = '';
53      var selectedMemoryCell = this.$.overview_pane.selectedMemoryCell;
54      if (!selectedMemoryCell || !selectedMemoryCell.buildDetailsPane)
55        return;
56      this.$.details_pane_container.appendChild(
57          selectedMemoryCell.buildDetailsPane());
58    }
59  });
60  </script>
61</polymer-element>
62