OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var utils = require('utils'); | 5 var utils = require('utils'); |
6 | 6 |
7 var AutomationEventImpl = function(type, target) { | 7 var AutomationEventImpl = function(type, target) { |
8 this.propagationStopped = false; | 8 this.propagationStopped = false; |
9 | 9 |
10 // TODO(aboxhall): make these read-only properties | 10 // TODO(aboxhall): make these read-only properties |
11 this.type = type; | 11 this.type = type; |
12 this.target = target; | 12 this.target = target; |
13 this.eventPhase = Event.NONE; | 13 this.eventPhase = Event.NONE; |
14 }; | 14 }; |
15 | 15 |
16 AutomationEventImpl.prototype = { | 16 AutomationEventImpl.prototype = { |
17 stopPropagation: function() { | 17 stopPropagation: function() { |
18 this.propagationStopped = true; | 18 this.propagationStopped = true; |
19 } | 19 } |
20 }; | 20 }; |
21 | 21 |
22 exports.AutomationEvent = utils.expose( | 22 function AutomationEvent() { |
23 'AutomationEvent', | 23 privates(AutomationEvent).constructPrivate(this, arguments); |
24 AutomationEventImpl, | 24 } |
25 { functions: ['stopPropagation'], | 25 utils.expose(AutomationEvent, AutomationEventImpl, { |
26 readonly: ['type', 'target', 'eventPhase'] }); | 26 functions: [ |
| 27 'stopPropagation', |
| 28 ], |
| 29 readonly: [ |
| 30 'type', |
| 31 'target', |
| 32 'eventPhase', |
| 33 ], |
| 34 }); |
| 35 |
| 36 exports.$set('AutomationEvent', AutomationEvent); |
OLD | NEW |