Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / web_components / results_viewer.html
1 <!DOCTYPE html>
2 <!--
3 Copyright 2014 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
6 -->
7 <link rel="import" href="/tvcm/ui.html">
8 <script>
9 'use strict';
10
11 tvcm.exportTo('telemetry.web_components', function() {
12   /**
13    * @constructor
14    */
15   var ResultsViewer = tvcm.ui.define('x-results-viewer');
16
17   ResultsViewer.prototype = {
18     __proto__: HTMLUnknownElement.prototype,
19
20     decorate: function() {
21       this.dataToView_ = undefined;
22     },
23
24     get dataToView() {
25       return dataToView_;
26     },
27
28     set dataToView(dataToView) {
29       this.dataToView_ = dataToView;
30       this.updateContents_();
31     },
32
33     updateContents_: function() {
34       this.textContent = JSON.stringify(this.dataToView_);
35     }
36   };
37
38   return {
39     ResultsViewer: ResultsViewer
40   };
41 });
42 </script>