Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: extensions/renderer/resources/guest_view/guest_view_container.js

Issue 856563002: Added the infrastructure for surfaceProxy.onResize() and SurfaceView.onResize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 876b60623de0658eda154e87ca06920835bbb73f..3318d7b16702a277982c6ad635089abbc15a13e8 100644
--- a/extensions/renderer/resources/guest_view/guest_view_container.js
+++ b/extensions/renderer/resources/guest_view/guest_view_container.js
@@ -7,6 +7,7 @@
var DocumentNatives = requireNative('document_natives');
var GuestView = require('guestView').GuestView;
+var GuestViewInternalNatives = requireNative('guest_view_internal');
var IdGenerator = requireNative('id_generator');
function GuestViewContainer(element, viewType) {
@@ -98,6 +99,10 @@ GuestViewContainer.prototype.handleBrowserPluginAttributeMutation =
privates(this).browserPluginElement.removeAttribute('internalinstanceid');
this.internalInstanceId = parseInt(newValue);
+ // Track when the element resizes using the element resize callback.
+ GuestViewInternalNatives.RegisterElementResizeCallback(
+ this.internalInstanceId, this.onElementResize.bind(this));
+
if (!this.guest.getId()) {
return;
}
@@ -114,6 +119,11 @@ GuestViewContainer.prototype.onElementAttached = function() {};
GuestViewContainer.prototype.onElementDetached = function() {
this.guest.destroy();
};
+GuestViewContainer.prototype.onElementResize = function(oldWidth, oldHeight,
+ newWidth, newHeight) {
+ // TODO(paulmeyer): If any code is entered here, and this function is called
+ // while the dev-tools inspect window is open, chrome will crash.
+};
// Registers the browser plugin <object> custom element. |viewType| is the
// name of the specific guestview container (e.g. 'webview').

Powered by Google App Engine
This is Rietveld 408576698