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

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. Added a bit more infrastructure than in the previous patch. 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..eae8d449ae335113396388571bc37ab4a71ac410 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) {
@@ -22,6 +23,12 @@ function GuestViewContainer(element, viewType) {
var shadowRoot = this.element.createShadowRoot();
shadowRoot.appendChild(privates(this).browserPluginElement);
+
+ // Track when the element resizes using the element resize callback.
+ if (this.internalInstanceId) {
+ GuestViewInternalNatives.RegisterElementResizeCallback(
Fady Samuel 2015/01/19 23:57:01 nit: spacing.
Fady Samuel 2015/01/20 00:04:25 This needs to be called every time we get a new in
paulmeyer 2015/01/20 00:24:38 Done.
paulmeyer 2015/01/20 00:24:38 Done.
+ this.internalInstanceId, this.onElementResize.bind(this));
+ }
}
// Forward public API methods from |proto| to their internal implementations.
@@ -114,6 +121,11 @@ GuestViewContainer.prototype.onElementAttached = function() {};
GuestViewContainer.prototype.onElementDetached = function() {
this.guest.destroy();
};
Fady Samuel 2015/01/19 23:57:01 nit: Add a blank line after this.
paulmeyer 2015/01/20 00:24:38 onElementResize() is still a function that will be
+GuestViewContainer.prototype.onElementResize = function(oldWidth, oldHeight,
+ newWidth, newHeight) {
+ // TODO(paulmeyer): If any code is entered here, and this function is called
+ // while the dev-tool 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