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 CreateEvent = require('guestViewEvents').CreateEvent; | 5 var CreateEvent = require('guestViewEvents').CreateEvent; |
6 var GuestViewEvents = require('guestViewEvents').GuestViewEvents; | 6 var GuestViewEvents = require('guestViewEvents').GuestViewEvents; |
7 | 7 |
8 function ExtensionOptionsEvents(extensionOptionsImpl) { | 8 function ExtensionOptionsEvents(extensionOptionsImpl) { |
9 GuestViewEvents.call(this, extensionOptionsImpl); | 9 GuestViewEvents.call(this, extensionOptionsImpl); |
10 | 10 |
11 // setupEventProperty is normally called automatically, but the 'createfailed' | 11 // |setupEventProperty| is normally called automatically, but the |
12 // event is registered here because the event is fired from | 12 // 'createfailed' event is registered here because the event is fired from |
13 // ExtensionOptionsImpl instead of in response to an extension event. | 13 // ExtensionOptionsImpl instead of in response to an extension event. |
14 this.setupEventProperty('createfailed'); | 14 this.setupEventProperty('createfailed'); |
15 } | 15 } |
16 | 16 |
17 ExtensionOptionsEvents.prototype.__proto__ = GuestViewEvents.prototype; | 17 ExtensionOptionsEvents.prototype.__proto__ = GuestViewEvents.prototype; |
18 | 18 |
19 // A dictionary of <extensionoptions> extension events to be listened for. This | 19 // A dictionary of <extensionoptions> extension events to be listened for. This |
20 // dictionary augments |GuestViewEvents.EVENTS| in guest_view_events.js. See the | 20 // dictionary augments |GuestViewEvents.EVENTS| in guest_view_events.js. See the |
21 // documentation there for details. | 21 // documentation there for details. |
22 ExtensionOptionsEvents.EVENTS = { | 22 ExtensionOptionsEvents.EVENTS = { |
(...skipping 21 matching lines...) Expand all Loading... |
44 ExtensionOptionsEvents.prototype.handleSizeChangedEvent = function(event, | 44 ExtensionOptionsEvents.prototype.handleSizeChangedEvent = function(event, |
45 eventName) { | 45 eventName) { |
46 this.view.onSizeChanged( | 46 this.view.onSizeChanged( |
47 event.newWidth, event.newHeight, event.oldWidth, event.oldHeight); | 47 event.newWidth, event.newHeight, event.oldWidth, event.oldHeight); |
48 var extensionOptionsEvent = this.makeDomEvent(event, eventName); | 48 var extensionOptionsEvent = this.makeDomEvent(event, eventName); |
49 this.view.dispatchEvent(extensionOptionsEvent); | 49 this.view.dispatchEvent(extensionOptionsEvent); |
50 } | 50 } |
51 | 51 |
52 // Exports. | 52 // Exports. |
53 exports.ExtensionOptionsEvents = ExtensionOptionsEvents; | 53 exports.ExtensionOptionsEvents = ExtensionOptionsEvents; |
OLD | NEW |