Upstream version 9.37.197.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / tracing / trace_model / event.js
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 'use strict';
6
7 tvcm.require('tvcm.guid');
8
9 /**
10  * @fileoverview Provides the Event class.
11  */
12 tvcm.exportTo('tracing.trace_model', function() {
13
14   /**
15    * The SelectionState enum defines how Events are displayed in the view.
16    */
17   var SelectionState = {
18     NONE: 0,
19     SELECTED: 1,
20     HIGHLIGHTED: 2,
21     DIMMED: 3
22   };
23
24   /**
25    * An Event is the base type for any non-container, selectable piece
26    * of data in the trace model.
27    *
28    * @constructor
29    */
30   function Event() {
31     this.guid_ = tvcm.GUID.allocate();
32     this.selectionState = SelectionState.NONE;
33   }
34
35   Event.prototype = {
36     get guid() {
37       return this.guid_;
38     },
39
40     get selected() {
41       return this.selectionState === SelectionState.SELECTED;
42     }
43   };
44
45   return {
46     Event: Event,
47     SelectionState: SelectionState
48   };
49 });