OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // Event management for GuestViewContainers. | 5 // Event management for GuestViewContainers. |
6 | 6 |
7 var GuestViewInternalNatives = requireNative('guest_view_internal'); | 7 var GuestViewInternalNatives = requireNative('guest_view_internal'); |
8 var MessagingNatives = requireNative('messaging_natives'); | 8 var MessagingNatives = requireNative('messaging_natives'); |
9 | 9 |
10 var EventBindings; | 10 var EventBindings; |
11 var CreateEvent = function(name) { | 11 var CreateEvent = function(name) { |
12 if (bindingUtil) { | 12 if (bindingUtil) { |
13 return bindingUtil.createCustomEvent(name, null, | 13 return bindingUtil.createCustomEvent(name, null, |
14 true /* supportsFilters */); | 14 true /* supportsFilters */, |
| 15 false /* supportsLazyListeners */); |
15 } | 16 } |
16 var eventOpts = {supportsListeners: true, supportsFilters: true}; | 17 var eventOpts = { |
| 18 __proto__: null, |
| 19 supportsListeners: true, |
| 20 supportsFilters: true, |
| 21 // GuestView-related events never support lazy listeners. |
| 22 supportsLazyListeners: false, |
| 23 }; |
17 if (!EventBindings) | 24 if (!EventBindings) |
18 EventBindings = require('event_bindings'); | 25 EventBindings = require('event_bindings'); |
19 return new EventBindings.Event(name, undefined, eventOpts); | 26 return new EventBindings.Event(name, undefined, eventOpts); |
20 }; | 27 }; |
21 | 28 |
22 function GuestViewEvents(view) { | 29 function GuestViewEvents(view) { |
23 view.events = this; | 30 view.events = this; |
24 | 31 |
25 this.view = view; | 32 this.view = view; |
26 this.on = {}; | 33 this.on = {}; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 return $Function.apply(func, view.events, $Array.slice(arguments)); | 189 return $Function.apply(func, view.events, $Array.slice(arguments)); |
183 }; | 190 }; |
184 }; | 191 }; |
185 | 192 |
186 // Implemented by the derived event manager, if one exists. | 193 // Implemented by the derived event manager, if one exists. |
187 GuestViewEvents.prototype.getEvents = function() { return {}; }; | 194 GuestViewEvents.prototype.getEvents = function() { return {}; }; |
188 | 195 |
189 // Exports. | 196 // Exports. |
190 exports.$set('GuestViewEvents', GuestViewEvents); | 197 exports.$set('GuestViewEvents', GuestViewEvents); |
191 exports.$set('CreateEvent', CreateEvent); | 198 exports.$set('CreateEvent', CreateEvent); |
OLD | NEW |