Don't need both <string> and <string.h>
[chromium-blink-merge.git] / chrome / renderer / resources / extensions / extension_options_events.js
blob590d48aeea3d915b055e046621747de7e54a6474
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
3 // found in the LICENSE file.
5 var CreateEvent = require('guestViewEvents').CreateEvent;
6 var GuestViewEvents = require('guestViewEvents').GuestViewEvents;
8 function ExtensionOptionsEvents(extensionOptionsImpl) {
9   GuestViewEvents.call(this, extensionOptionsImpl);
11   // |setupEventProperty| is normally called automatically, but the
12   // 'createfailed' event is registered here because the event is fired from
13   // ExtensionOptionsImpl instead of in response to an extension event.
14   this.setupEventProperty('createfailed');
17 ExtensionOptionsEvents.prototype.__proto__ = GuestViewEvents.prototype;
19 // A dictionary of <extensionoptions> extension events to be listened for. This
20 // dictionary augments |GuestViewEvents.EVENTS| in guest_view_events.js. See the
21 // documentation there for details.
22 ExtensionOptionsEvents.EVENTS = {
23   'close': {
24     evt: CreateEvent('extensionOptionsInternal.onClose')
25   },
26   'load': {
27     evt: CreateEvent('extensionOptionsInternal.onLoad')
28   },
29   'preferredsizechanged': {
30     evt: CreateEvent('extensionOptionsInternal.onPreferredSizeChanged'),
31     fields:['width', 'height']
32   }
35 ExtensionOptionsEvents.prototype.getEvents = function() {
36   return ExtensionOptionsEvents.EVENTS;
39 // Exports.
40 exports.ExtensionOptionsEvents = ExtensionOptionsEvents;