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

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: Removed code from one non-essential function that was causing tests to fail. It will be re-added in… 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
« no previous file with comments | « extensions/renderer/resources/guest_view/guest_view.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4bd7809a6e81885b1444e0a12b663fe5f867a2ad 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,8 @@ GuestViewContainer.prototype.onElementAttached = function() {};
GuestViewContainer.prototype.onElementDetached = function() {
this.guest.destroy();
};
+GuestViewContainer.prototype.onElementResize = function(oldWidth, oldHeight,
+ newWidth, newHeight) {};
// Registers the browser plugin <object> custom element. |viewType| is the
// name of the specific guestview container (e.g. 'webview').
« no previous file with comments | « extensions/renderer/resources/guest_view/guest_view.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698