1<!DOCTYPE html>
2<!--
3Copyright (c) 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="/tracing/value/unit.html">
9
10<polymer-element name="tr-v-ui-preferred-display-unit">
11  <script>
12  'use strict';
13  Polymer({
14    ready: function() {
15      this.preferredTimeDisplayMode_ = undefined;
16    },
17
18    attached: function() {
19      tr.v.Unit.didPreferredTimeDisplayUnitChange();
20    },
21
22    detached: function() {
23      tr.v.Unit.didPreferredTimeDisplayUnitChange();
24    },
25
26    // null means no-preference
27    get preferredTimeDisplayMode() {
28      return this.preferredTimeDisplayMode_;
29    },
30
31    set preferredTimeDisplayMode(v) {
32      if (this.preferredTimeDisplayMode_ === v)
33        return;
34      this.preferredTimeDisplayMode_ = v;
35      tr.v.Unit.didPreferredTimeDisplayUnitChange();
36    }
37
38  });
39  </script>
40</polymer-element>
41