1<!DOCTYPE HTML>
2<html>
3<head i18n-values="dir:textdirection;">
4<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5<meta charset="utf-8"/>
6<title>Android System Trace</title>
7<style>
8  html,
9  body {
10    height: 100%;
11  }
12
13  body {
14    -webkit-flex-direction: column;
15    display: -webkit-flex;
16    margin: 0;
17    padding: 0;
18  }
19
20  body > tr-ui-timeline-view {
21    -webkit-flex: 1 1 auto;
22    min-height: 0;
23  }
24  body > tr-ui-timeline-view:focus {
25    outline: none;
26  }
27</style>
28{{SYSTRACE_TRACE_VIEWER_HTML}}
29</head>
30<body>
31  <tr-ui-timeline-view>
32    <track-view-container id='track_view_container'></track-view-container>
33  </tr-ui-timeline-view>
34
35  <script>
36  'use strict';
37  var timelineViewEl;
38
39  function onLoad() {
40    timelineViewEl = document.querySelector('tr-ui-timeline-view');
41    timelineViewEl.globalMode = true;
42
43    var traceDataEls = document.body.querySelectorAll('.trace-data');
44    var traces = [];
45    for (var i = 0; i < traceDataEls.length; i++) {
46      var traceText = traceDataEls[i].textContent;
47      // Remove the leading newline.
48      traceText = traceText.substring(1);
49      traces.push(traceText);
50    }
51
52    var m = new tr.Model();
53    var p = m.importTracesWithProgressDialog(traces, true);
54    p.then(
55      function() {
56        timelineViewEl.model = m;
57        timelineViewEl.updateDocumentFavicon();
58        timelineViewEl.globalMode = true;
59        timelineViewEl.viewTitle = 'Android System Trace';
60      },
61      function(err) {
62        var overlay = new tr.ui.b.Overlay();
63        overlay.textContent = tr.b.normalizeException(err).message;
64        overlay.title = 'Import error';
65        overlay.visible = true;
66      });
67  }
68  window.addEventListener('load', onLoad);
69  </script>
70