| 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 // This module implements the ExtensionView <extensionview>. | 5 // This module implements the ExtensionView <extensionview>. |
| 6 | 6 |
| 7 var GuestViewContainer = require('guestViewContainer').GuestViewContainer; | 7 var GuestViewContainer = require('guestViewContainer').GuestViewContainer; |
| 8 var ExtensionViewConstants = | 8 var ExtensionViewConstants = |
| 9 require('extensionViewConstants').ExtensionViewConstants; | 9 require('extensionViewConstants').ExtensionViewConstants; |
| 10 var ExtensionViewInternal = | 10 var ExtensionViewInternal = |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 return params; | 45 return params; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 // This observer monitors mutations to attributes of the <extensionview>. | 48 // This observer monitors mutations to attributes of the <extensionview>. |
| 49 ExtensionViewImpl.prototype.handleAttributeMutation = function( | 49 ExtensionViewImpl.prototype.handleAttributeMutation = function( |
| 50 attributeName, oldValue, newValue) { | 50 attributeName, oldValue, newValue) { |
| 51 if (!this.attributes[attributeName]) | 51 if (!this.attributes[attributeName]) |
| 52 return; | 52 return; |
| 53 | 53 |
| 54 // Let the changed attribute handle its own mutation; | 54 // Let the changed attribute handle its own mutation; |
| 55 this.attributes[attributeName].handleMutation(oldValue, newValue); | 55 this.attributes[attributeName].maybeHandleMutation(oldValue, newValue); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 ExtensionViewImpl.prototype.onElementDetached = function() { | 58 ExtensionViewImpl.prototype.onElementDetached = function() { |
| 59 this.guest.destroy(); | 59 this.guest.destroy(); |
| 60 this.attributes[ExtensionViewConstants.ATTRIBUTE_SRC].reset(); | 60 this.attributes[ExtensionViewConstants.ATTRIBUTE_SRC].reset(); |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 GuestViewContainer.registerElement(ExtensionViewImpl); | 63 GuestViewContainer.registerElement(ExtensionViewImpl); |
| 64 | 64 |
| 65 // Exports. | 65 // Exports. |
| 66 exports.ExtensionViewImpl = ExtensionViewImpl; | 66 exports.ExtensionViewImpl = ExtensionViewImpl; |
| OLD | NEW |