| 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 ExtensionViewEvents = require('extensionViewEvents').ExtensionViewEvents; | 10 var ExtensionViewEvents = require('extensionViewEvents').ExtensionViewEvents; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 // Let the changed attribute handle its own mutation. | 51 // Let the changed attribute handle its own mutation. |
| 52 this.attributes[attributeName].maybeHandleMutation(oldValue, newValue); | 52 this.attributes[attributeName].maybeHandleMutation(oldValue, newValue); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 ExtensionViewImpl.prototype.onElementDetached = function() { | 55 ExtensionViewImpl.prototype.onElementDetached = function() { |
| 56 this.guest.destroy(); | 56 this.guest.destroy(); |
| 57 | 57 |
| 58 // Reset all attributes. | 58 // Reset all attributes. |
| 59 for (var i in this.attributes) { | 59 for (var i in this.attributes) { |
| 60 this.attributes[i].reset(); | 60 this.attributes[i].setValueIgnoreMutation(); |
| 61 } | 61 } |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 // Updates src upon loadcommit. | 64 // Updates src upon loadcommit. |
| 65 ExtensionViewImpl.prototype.onLoadCommit = function(url) { | 65 ExtensionViewImpl.prototype.onLoadCommit = function(url) { |
| 66 this.attributes[ExtensionViewConstants.ATTRIBUTE_SRC]. | 66 this.attributes[ExtensionViewConstants.ATTRIBUTE_SRC]. |
| 67 setValueIgnoreMutation(url); | 67 setValueIgnoreMutation(url); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 GuestViewContainer.registerElement(ExtensionViewImpl); | 70 GuestViewContainer.registerElement(ExtensionViewImpl); |
| 71 | 71 |
| 72 // Exports. | 72 // Exports. |
| 73 exports.ExtensionViewImpl = ExtensionViewImpl; | 73 exports.ExtensionViewImpl = ExtensionViewImpl; |
| OLD | NEW |