1<!DOCTYPE html>
2<!--
3Copyright (c) 2013 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="/tracing/extras/chrome/cc/tile.html">
9<link rel="import" href="/tracing/ui/analysis/generic_object_view.html">
10<link rel="import" href="/tracing/ui/analysis/object_snapshot_view.html">
11
12<script>
13
14'use strict';
15
16tr.exportTo('tr.ui.e.chrome.cc', function() {
17  /*
18   * Displays a tile in a human readable form.
19   * @constructor
20   */
21  var TileSnapshotView = tr.ui.b.define(
22      'tr-ui-e-chrome-cc-tile-snapshot-view',
23      tr.ui.analysis.ObjectSnapshotView);
24
25  TileSnapshotView.prototype = {
26    __proto__: tr.ui.analysis.ObjectSnapshotView.prototype,
27
28    decorate: function() {
29      this.classList.add('tr-ui-e-chrome-cc-tile-snapshot-view');
30      this.layerTreeView_ =
31          new tr.ui.e.chrome.cc.LayerTreeHostImplSnapshotView();
32      this.appendChild(this.layerTreeView_);
33    },
34
35    updateContents: function() {
36      var tile = this.objectSnapshot_;
37      var layerTreeHostImpl = tile.containingSnapshot;
38      if (!layerTreeHostImpl)
39        return;
40
41      this.layerTreeView_.objectSnapshot = layerTreeHostImpl;
42      this.layerTreeView_.selection = new tr.ui.e.chrome.cc.TileSelection(tile);
43    }
44  };
45
46  tr.ui.analysis.ObjectSnapshotView.register(
47      TileSnapshotView,
48      {
49        typeName: 'cc::Tile',
50        showInTrackView: false
51      });
52
53  return {
54    TileSnapshotView: TileSnapshotView
55  };
56});
57</script>
58