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

Side by Side Diff: chrome/renderer/resources/extensions/extension_options_events.js

Issue 990223002: <extensionoptions>: Remove dead code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed broken test 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 var CreateEvent = require('guestViewEvents').CreateEvent; 5 var CreateEvent = require('guestViewEvents').CreateEvent;
6 var GuestViewEvents = require('guestViewEvents').GuestViewEvents; 6 var GuestViewEvents = require('guestViewEvents').GuestViewEvents;
7 7
8 function ExtensionOptionsEvents(extensionOptionsImpl) { 8 function ExtensionOptionsEvents(extensionOptionsImpl) {
9 GuestViewEvents.call(this, extensionOptionsImpl); 9 GuestViewEvents.call(this, extensionOptionsImpl);
10 10
11 // |setupEventProperty| is normally called automatically, but the 11 // |setupEventProperty| is normally called automatically, but the
12 // 'createfailed' event is registered here because the event is fired from 12 // 'createfailed' event is registered here because the event is fired from
13 // ExtensionOptionsImpl instead of in response to an extension event. 13 // ExtensionOptionsImpl instead of in response to an extension event.
14 this.setupEventProperty('createfailed'); 14 this.setupEventProperty('createfailed');
15 } 15 }
16 16
17 ExtensionOptionsEvents.prototype.__proto__ = GuestViewEvents.prototype; 17 ExtensionOptionsEvents.prototype.__proto__ = GuestViewEvents.prototype;
18 18
19 // A dictionary of <extensionoptions> extension events to be listened for. This 19 // A dictionary of <extensionoptions> extension events to be listened for. This
20 // dictionary augments |GuestViewEvents.EVENTS| in guest_view_events.js. See the 20 // dictionary augments |GuestViewEvents.EVENTS| in guest_view_events.js. See the
21 // documentation there for details. 21 // documentation there for details.
22 ExtensionOptionsEvents.EVENTS = { 22 ExtensionOptionsEvents.EVENTS = {
23 'close': { 23 'close': {
24 evt: CreateEvent('extensionOptionsInternal.onClose') 24 evt: CreateEvent('extensionOptionsInternal.onClose')
25 }, 25 },
26 'load': { 26 'load': {
27 evt: CreateEvent('extensionOptionsInternal.onLoad') 27 evt: CreateEvent('extensionOptionsInternal.onLoad')
28 }, 28 },
29 'sizechanged': {
30 evt: CreateEvent('extensionOptionsInternal.onSizeChanged'),
31 handler: 'handleSizeChangedEvent',
32 fields:['newWidth', 'newHeight', 'oldWidth', 'oldHeight']
33 },
34 'preferredsizechanged': { 29 'preferredsizechanged': {
35 evt: CreateEvent('extensionOptionsInternal.onPreferredSizeChanged'), 30 evt: CreateEvent('extensionOptionsInternal.onPreferredSizeChanged'),
36 fields:['width', 'height'] 31 fields:['width', 'height']
37 } 32 }
38 } 33 }
39 34
40 ExtensionOptionsEvents.prototype.getEvents = function() { 35 ExtensionOptionsEvents.prototype.getEvents = function() {
41 return ExtensionOptionsEvents.EVENTS; 36 return ExtensionOptionsEvents.EVENTS;
42 }; 37 };
43 38
44 ExtensionOptionsEvents.prototype.handleSizeChangedEvent = function(event,
45 eventName) {
46 this.view.onSizeChanged(
47 event.newWidth, event.newHeight, event.oldWidth, event.oldHeight);
48 var extensionOptionsEvent = this.makeDomEvent(event, eventName);
49 this.view.dispatchEvent(extensionOptionsEvent);
50 }
51
52 // Exports. 39 // Exports.
53 exports.ExtensionOptionsEvents = ExtensionOptionsEvents; 40 exports.ExtensionOptionsEvents = ExtensionOptionsEvents;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698