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

Side by Side 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: 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This module implements a wrapper for a guestview that manages its 5 // This module implements a wrapper for a guestview that manages its
6 // creation, attaching, and destruction. 6 // creation, attaching, and destruction.
7 7
8 var CreateEvent = require('guestViewEvents').CreateEvent;
8 var EventBindings = require('event_bindings'); 9 var EventBindings = require('event_bindings');
9 var GuestViewInternal = 10 var GuestViewInternal =
10 require('binding').Binding.create('guestViewInternal').generate(); 11 require('binding').Binding.create('guestViewInternal').generate();
11 var GuestViewInternalNatives = requireNative('guest_view_internal'); 12 var GuestViewInternalNatives = requireNative('guest_view_internal');
12 13
13 // Events. 14 // Events.
14 var CreateEvent = function(name) {
15 var eventOpts = {supportsListeners: true, supportsFilters: true};
16 return new EventBindings.Event(name, undefined, eventOpts);
17 };
18 var ResizeEvent = CreateEvent('guestViewInternal.onResize'); 15 var ResizeEvent = CreateEvent('guestViewInternal.onResize');
19 16
20 // Possible states. 17 // Possible states.
21 var GUEST_STATE_ATTACHED = 2; 18 var GUEST_STATE_ATTACHED = 2;
22 var GUEST_STATE_CREATED = 1; 19 var GUEST_STATE_CREATED = 1;
23 var GUEST_STATE_START = 0; 20 var GUEST_STATE_START = 0;
24 21
25 // Error messages. 22 // Error messages.
26 var ERROR_MSG_ALREADY_ATTACHED = 'The guest has already been attached.'; 23 var ERROR_MSG_ALREADY_ATTACHED = 'The guest has already been attached.';
27 var ERROR_MSG_ALREADY_CREATED = 'The guest has already been created.'; 24 var ERROR_MSG_ALREADY_CREATED = 'The guest has already been created.';
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 }; 319 };
323 320
324 // Returns the ID for this guestview. 321 // Returns the ID for this guestview.
325 GuestView.prototype.getId = function() { 322 GuestView.prototype.getId = function() {
326 var internal = privates(this).internal; 323 var internal = privates(this).internal;
327 return internal.id; 324 return internal.id;
328 }; 325 };
329 326
330 // Exports 327 // Exports
331 exports.GuestView = GuestView; 328 exports.GuestView = GuestView;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698