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

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

Issue 987473002: Added the onResize and onContentResize events to GuestViewEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small fix. Created 5 years, 9 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.js
diff --git a/extensions/renderer/resources/guest_view/guest_view.js b/extensions/renderer/resources/guest_view/guest_view.js
index 8ff4f3c52b30d52bce6d408d72adbc25404e505b..616cc3fb3bf9779ccd6265e2dc2de79d57c4e179 100644
--- a/extensions/renderer/resources/guest_view/guest_view.js
+++ b/extensions/renderer/resources/guest_view/guest_view.js
@@ -5,16 +5,13 @@
// This module implements a wrapper for a guestview that manages its
// creation, attaching, and destruction.
+var CreateEvent = require('guestViewEvents').CreateEvent;
var EventBindings = require('event_bindings');
var GuestViewInternal =
require('binding').Binding.create('guestViewInternal').generate();
var GuestViewInternalNatives = requireNative('guest_view_internal');
// Events.
-var CreateEvent = function(name) {
- var eventOpts = {supportsListeners: true, supportsFilters: true};
- return new EventBindings.Event(name, undefined, eventOpts);
-};
var ResizeEvent = CreateEvent('guestViewInternal.onResize');
// Possible states.
@@ -30,7 +27,7 @@ var ERROR_MSG_NOT_ATTACHED = 'The guest is not attached.';
var ERROR_MSG_NOT_CREATED = 'The guest has not been created.';
// Properties.
-var PROPERTY_ON_RESIZE = 'onResize';
+var PROPERTY_ON_RESIZE = 'onresize';
// Contains and hides the internal implementation details of |GuestView|,
// including maintaining its state and enforcing the proper usage of its API
@@ -55,7 +52,7 @@ function GuestViewImpl(guestView, viewType, guestInstanceId) {
// Sets up the onResize property on the GuestView.
GuestViewImpl.prototype.setupOnResize = function() {
- Object.defineProperty(this.guestView, PROPERTY_ON_RESIZE, {
+ $Object.defineProperty(this.guestView, PROPERTY_ON_RESIZE, {
get: function() {
return this[PROPERTY_ON_RESIZE];
}.bind(this),
@@ -69,7 +66,7 @@ GuestViewImpl.prototype.setupOnResize = function() {
if (!this[PROPERTY_ON_RESIZE]) {
return;
}
- this[PROPERTY_ON_RESIZE](e.oldWidth, e.oldHeight, e.newWidth, e.newHeight);
+ this[PROPERTY_ON_RESIZE](e);
}.bind(this);
};

Powered by Google App Engine
This is Rietveld 408576698