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

Side by Side 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: 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 unified diff | Download patch
« no previous file with comments | « extensions/renderer/resources/guest_view/guest_view_container.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Event management for GuestViewContainers. 5 // Event management for GuestViewContainers.
6 6
7 var EventBindings = require('event_bindings'); 7 var EventBindings = require('event_bindings');
8 8
9 var CreateEvent = function(name) { 9 var CreateEvent = function(name) {
10 var eventOpts = {supportsListeners: true, supportsFilters: true}; 10 var eventOpts = {supportsListeners: true, supportsFilters: true};
11 return new EventBindings.Event(name, undefined, eventOpts); 11 return new EventBindings.Event(name, undefined, eventOpts);
12 }; 12 };
13 13
14 function GuestViewEvents(view) { 14 function GuestViewEvents(view) {
15 this.view = view; 15 this.view = view;
16 this.on = {}; 16 this.on = {};
17 17
18 // |setupEventProperty| is normally called automatically, but these events are
19 // are registered here because they are dispatched from GuestViewContainer
20 // instead of in response to extension events.
21 this.setupEventProperty('contentresize');
22 this.setupEventProperty('resize');
18 this.setupEvents(); 23 this.setupEvents();
19 } 24 }
20 25
21 // |GuestViewEvents.EVENTS| is a dictionary of extension events to be listened 26 // |GuestViewEvents.EVENTS| is a dictionary of extension events to be listened
22 // for, which specifies how each event should be handled. The events are 27 // for, which specifies how each event should be handled. The events are
23 // organized by name, and by default will be dispatched as DOM events with 28 // organized by name, and by default will be dispatched as DOM events with
24 // the same name. 29 // the same name.
25 // |cancelable| (default: false) specifies whether the DOM event's default 30 // |cancelable| (default: false) specifies whether the DOM event's default
26 // behavior can be canceled. If the default action associated with the event 31 // behavior can be canceled. If the default action associated with the event
27 // is prevented, then its dispatch function will return false in its event 32 // is prevented, then its dispatch function will return false in its event
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 enumerable: true 115 enumerable: true
111 }); 116 });
112 }; 117 };
113 118
114 // Implemented by the derived event manager, if one exists. 119 // Implemented by the derived event manager, if one exists.
115 GuestViewEvents.prototype.getEvents = function() { return {}; }; 120 GuestViewEvents.prototype.getEvents = function() { return {}; };
116 121
117 // Exports. 122 // Exports.
118 exports.GuestViewEvents = GuestViewEvents; 123 exports.GuestViewEvents = GuestViewEvents;
119 exports.CreateEvent = CreateEvent; 124 exports.CreateEvent = CreateEvent;
OLDNEW
« no previous file with comments | « extensions/renderer/resources/guest_view/guest_view_container.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698