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/model/selectable_item.html">
9<link rel="import" href="/tracing/model/selection_state.html">
10
11<script>
12'use strict';
13
14tr.exportTo('tr.model', function() {
15  var SelectableItem = tr.model.SelectableItem;
16  var SelectionState = tr.model.SelectionState;
17
18  /**
19   * A ProxySelectableItem is a selectable item which is not a model item itself
20   * but instead acts as a proxy for a model item.
21   *
22   * @constructor
23   * @extends {SelectableItem}
24   */
25  function ProxySelectableItem(modelItem) {
26    SelectableItem.call(this, modelItem);
27  };
28
29  ProxySelectableItem.prototype = {
30    __proto__: SelectableItem.prototype,
31
32    get selectionState() {
33      var modelItem = this.modelItem_;
34      if (modelItem === undefined)
35        return SelectionState.NONE;
36      return modelItem.selectionState;
37    }
38  };
39
40  return {
41    ProxySelectableItem: ProxySelectableItem
42  };
43});
44</script>
45