Index: extensions/renderer/resources/guest_view/guest_view_container.js |
diff --git a/extensions/renderer/resources/guest_view/guest_view_container.js b/extensions/renderer/resources/guest_view/guest_view_container.js |
index ebcc3136b5e56a3b0bb67996f3da111ab60ebb61..ed66ba06591337d25b8c8171f76d579a73cfc7bd 100644 |
--- a/extensions/renderer/resources/guest_view/guest_view_container.js |
+++ b/extensions/renderer/resources/guest_view/guest_view_container.js |
@@ -22,7 +22,7 @@ function GuestViewContainer(element, viewType) { |
this.guest = new GuestView(viewType); |
this.setupAttributes(); |
- privates(this).browserPluginElement = this.createBrowserPluginElement(); |
+ privates(this).browserPluginElement = this.createInternalElement$(); |
Fady Samuel
2015/06/05 23:45:53
rename browserPluginElement to internalElement all
lazyboy
2015/06/05 23:52:37
Done.
|
this.setupFocusPropagation(); |
var shadowRoot = this.element.createShadowRoot(); |
shadowRoot.appendChild(privates(this).browserPluginElement); |
@@ -84,7 +84,7 @@ GuestViewContainer.prototype.setupGuestProperty = function() { |
}); |
}; |
-GuestViewContainer.prototype.createBrowserPluginElement = function() { |
+GuestViewContainer.prototype.createInternalElement$ = function() { |
// We create BrowserPlugin as a custom element in order to observe changes |
// to attributes synchronously. |
var browserPluginElement = |
@@ -122,22 +122,27 @@ GuestViewContainer.prototype.attachWindow = function() { |
return true; |
}; |
+GuestViewContainer.prototype.onInternalInstanceID = function( |
+ internalInstanceId) { |
+ this.internalInstanceId = internalInstanceId; |
+ |
+ // Track when the element resizes using the element resize callback. |
+ GuestViewInternalNatives.RegisterElementResizeCallback( |
+ this.internalInstanceId, this.weakWrapper(this.onElementResize)); |
+ |
+ if (!this.guest.getId()) { |
+ return; |
+ } |
+ this.guest.attach(this.internalInstanceId, |
+ this.viewInstanceId, |
+ this.buildParams()); |
+}; |
+ |
GuestViewContainer.prototype.handleBrowserPluginAttributeMutation = |
function(name, oldValue, newValue) { |
if (name == 'internalinstanceid' && !oldValue && !!newValue) { |
privates(this).browserPluginElement.removeAttribute('internalinstanceid'); |
- this.internalInstanceId = parseInt(newValue); |
- |
- // Track when the element resizes using the element resize callback. |
- GuestViewInternalNatives.RegisterElementResizeCallback( |
- this.internalInstanceId, this.weakWrapper(this.onElementResize)); |
- |
- if (!this.guest.getId()) { |
- return; |
- } |
- this.guest.attach(this.internalInstanceId, |
- this.viewInstanceId, |
- this.buildParams()); |
+ this.onInternalInstanceID(parseInt(newValue)); |
} |
}; |