| 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 ExtensionView. | 5 // Event management for ExtensionView. |
| 6 | 6 |
| 7 var CreateEvent = require('guestViewEvents').CreateEvent; | 7 var CreateEvent = require('guestViewEvents').CreateEvent; |
| 8 var GuestViewEvents = require('guestViewEvents').GuestViewEvents; | 8 var GuestViewEvents = require('guestViewEvents').GuestViewEvents; |
| 9 | 9 |
| 10 function ExtensionViewEvents(extensionViewImpl) { | 10 function ExtensionViewEvents(extensionViewImpl) { |
| 11 GuestViewEvents.call(this, extensionViewImpl); | 11 GuestViewEvents.call(this, extensionViewImpl); |
| 12 } | 12 } |
| 13 | 13 |
| 14 ExtensionViewEvents.prototype.__proto__ = GuestViewEvents.prototype; | 14 ExtensionViewEvents.prototype.__proto__ = GuestViewEvents.prototype; |
| 15 | 15 |
| 16 ExtensionViewEvents.EVENTS = { | 16 ExtensionViewEvents.EVENTS = { |
| 17 'loadcommit': { | 17 'loadcommit': { |
| 18 evt: CreateEvent('extensionViewInternal.onLoadCommit'), | 18 evt: CreateEvent('extensionViewInternal.onLoadCommit'), |
| 19 handler: 'handleLoadCommitEvent' | 19 handler: 'handleLoadCommitEvent', |
| 20 internal: true |
| 20 } | 21 } |
| 21 }; | 22 }; |
| 22 | 23 |
| 23 ExtensionViewEvents.prototype.getEvents = function() { | 24 ExtensionViewEvents.prototype.getEvents = function() { |
| 24 return ExtensionViewEvents.EVENTS; | 25 return ExtensionViewEvents.EVENTS; |
| 25 }; | 26 }; |
| 26 | 27 |
| 27 ExtensionViewEvents.prototype.handleLoadCommitEvent = function(event) { | 28 ExtensionViewEvents.prototype.handleLoadCommitEvent = function(event) { |
| 28 this.extensionViewImpl.onLoadCommit(event.url); | 29 this.extensionViewImpl.onLoadCommit(event.url); |
| 29 }; | 30 }; |
| 30 | 31 |
| 31 exports.ExtensionViewEvents = ExtensionViewEvents; | 32 exports.ExtensionViewEvents = ExtensionViewEvents; |
| OLD | NEW |