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

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

Issue 987473002: Added the onResize and onContentResize events to GuestViewEvents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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_events.js
diff --git a/extensions/renderer/resources/guest_view/guest_view_events.js b/extensions/renderer/resources/guest_view/guest_view_events.js
index 415d0c4326df4ca4562839829a3244839d7b0f98..714cf47036f15cba1334546a52d91aefd91f52fd 100644
--- a/extensions/renderer/resources/guest_view/guest_view_events.js
+++ b/extensions/renderer/resources/guest_view/guest_view_events.js
@@ -15,6 +15,10 @@ function GuestViewEvents(view) {
this.view = view;
this.on = {};
+ // |setupEventProperty| is normally called automatically, but the
+ // 'resize' event is registered here because the event is fired from
+ // GuestViewContainer instead of in response to an extension event.
+ this.setupEventProperty('resize');
this.setupEvents();
}
@@ -36,7 +40,12 @@ function GuestViewEvents(view) {
// should be dispatched within this handler function (if desired). With no
// handler function, the DOM event will be dispatched by default each time
// the extension event is caught.
-GuestViewEvents.EVENTS = {};
+GuestViewEvents.EVENTS = {
+ 'contentresize': {
+ evt: CreateEvent('guestViewInternal.onContentResize'),
+ fields: ['oldWidth', 'oldHeight', 'newWidth', 'newHeight']
+ }
+};
// Sets up the handling of events.
GuestViewEvents.prototype.setupEvents = function() {

Powered by Google App Engine
This is Rietveld 408576698