Update to latest trace viewer

Upstream trace viewer has changed substantially since last pull.

First, the old flattening into js + css + html workflow has been replaced with
a new flatten into single html file workflow.

Second, trace viewer has moved to git.

Some pieces that were previously only in systrace are now upstream as well.
In particular, minification is now upstream. Thus, the minifying features in
systrace can be removed.

Change-Id: Ibc6a46fa3dccff8b771a95aae1909cf178157264
diff --git a/prefix.html b/prefix.html
index 21bf427..3143913 100644
--- a/prefix.html
+++ b/prefix.html
@@ -1,37 +1,54 @@
 <!DOCTYPE HTML>
 <html>
 <head i18n-values="dir:textdirection;">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <meta charset="utf-8"/>
 <title>Android System Trace</title>
-%s
-%s
+<style>
+  html, body {
+    box-sizing: border-box;
+    overflow: hidden;
+    margin: 0px;
+    padding: 0;
+    width: 100%;
+    height: 100%;
+  }
+  body > x-timeline-view {
+    width: 100%;
+    height: 100%;
+  }
+</style>
+{{SYSTRACE_TRACE_VIEWER_HTML}}
 <script language="javascript">
 document.addEventListener('DOMContentLoaded', function() {
   if (!linuxPerfData)
     return;
 
-  var m = new tracing.TraceModel(linuxPerfData);
-  var timelineViewEl = document.querySelector('.view');
-  ui.decorate(timelineViewEl, tracing.TimelineView);
-  timelineViewEl.model = m;
-  timelineViewEl.tabIndex = 1;
-  timelineViewEl.timeline.focusElement = timelineViewEl;
+  var traceViewerEl = new tv.TraceViewer();
+  traceViewerEl.viewTitle = 'Android System Trace';
+  var viewInsertionPt = document.body.querySelector('#trace-viewer-insertion-pt');
+  viewInsertionPt.parentElement.replaceChild(traceViewerEl, viewInsertionPt);
+
+  var m = new tv.c.TraceModel();
+  var p = m.importTracesWithProgressDialog([linuxPerfData], true);
+  p.then(
+    function() {
+      traceViewerEl.model = m;
+      traceViewerEl.tabIndex = 1;
+      if (traceViewerEl.timeline)
+        traceViewerEl.timeline.focusElement = traceViewerEl;
+    },
+    function(err) {
+      var overlay = new tv.ui.Overlay();
+      overlay.textContent = tv.normalizeException(err).message;
+      overlay.title = 'Import error';
+      overlay.visible = true;
+    });
 });
 </script>
-<style>
-  .view {
-    overflow: hidden;
-    position: absolute;
-    top: 0;
-    bottom: 0;
-    left: 0;
-    right: 0;
-  }
-</style>
 </head>
 <body>
-  <div>%s</div>
-  <div class="view">
+  <div id="trace-viewer-insertion-pt">
   </div>
 <!-- BEGIN TRACE -->
   <script>