| 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 EventBindings = require('event_bindings'); | 5 var EventBindings = require('event_bindings'); |
| 6 | 6 |
| 7 var CreateEvent = function(name) { | 7 var CreateEvent = function(name) { |
| 8 var eventOpts = {supportsListeners: true, supportsFilters: true}; | 8 var eventOpts = {supportsListeners: true, supportsFilters: true}; |
| 9 return new EventBindings.Event(name, undefined, eventOpts); | 9 return new EventBindings.Event(name, undefined, eventOpts); |
| 10 }; | 10 }; |
| 11 | 11 |
| 12 var EXTENSION_OPTIONS_EVENTS = { | 12 var EXTENSION_OPTIONS_EVENTS = { |
| 13 'close': { |
| 14 evt: CreateEvent('extensionOptionsInternal.onClose'), |
| 15 fields: [] |
| 16 }, |
| 13 'load': { | 17 'load': { |
| 14 evt: CreateEvent('extensionOptionsInternal.onLoad'), | 18 evt: CreateEvent('extensionOptionsInternal.onLoad'), |
| 15 fields: [] | 19 fields: [] |
| 16 }, | 20 }, |
| 17 'sizechanged': { | 21 'sizechanged': { |
| 18 evt: CreateEvent('extensionOptionsInternal.onSizeChanged'), | 22 evt: CreateEvent('extensionOptionsInternal.onSizeChanged'), |
| 19 customHandler: function(handler, event, webViewEvent) { | 23 customHandler: function(handler, event, webViewEvent) { |
| 20 handler.handleSizeChangedEvent(event, webViewEvent); | 24 handler.handleSizeChangedEvent(event, webViewEvent); |
| 21 }, | 25 }, |
| 22 fields:['width', 'height'] | 26 fields:['width', 'height'] |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 67 |
| 64 ExtensionOptionsEvents.prototype.handleSizeChangedEvent = function( | 68 ExtensionOptionsEvents.prototype.handleSizeChangedEvent = function( |
| 65 event, extensionOptionsEvent) { | 69 event, extensionOptionsEvent) { |
| 66 this.extensionOptionsInternal.onSizeChanged(extensionOptionsEvent.width, | 70 this.extensionOptionsInternal.onSizeChanged(extensionOptionsEvent.width, |
| 67 extensionOptionsEvent.height); | 71 extensionOptionsEvent.height); |
| 68 this.extensionOptionsInternal.dispatchEvent(extensionOptionsEvent); | 72 this.extensionOptionsInternal.dispatchEvent(extensionOptionsEvent); |
| 69 } | 73 } |
| 70 | 74 |
| 71 exports.ExtensionOptionsEvents = ExtensionOptionsEvents; | 75 exports.ExtensionOptionsEvents = ExtensionOptionsEvents; |
| 72 exports.CreateEvent = CreateEvent; | 76 exports.CreateEvent = CreateEvent; |
| OLD | NEW |