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

Side by Side Diff: ui/webui/resources/js/cr/event_target.js

Issue 512003002: Revert of Revert "Typecheck JS files for chrome://extensions" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/browser/extension_error.cc ('k') | ui/webui/resources/js/cr/ui/alert_overlay.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 /** 5 /**
6 * @fileoverview This contains an implementation of the EventTarget interface 6 * @fileoverview This contains an implementation of the EventTarget interface
7 * as defined by DOM Level 2 Events. 7 * as defined by DOM Level 2 Events.
8 */ 8 */
9 9
10 cr.define('cr', function() { 10 cr.define('cr', function() {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 delete this.listeners_[type]; 55 delete this.listeners_[type];
56 else 56 else
57 handlers.splice(index, 1); 57 handlers.splice(index, 1);
58 } 58 }
59 } 59 }
60 }, 60 },
61 61
62 /** 62 /**
63 * Dispatches an event and calls all the listeners that are listening to 63 * Dispatches an event and calls all the listeners that are listening to
64 * the type of the event. 64 * the type of the event.
65 * @param {!cr.event.Event} event The event to dispatch. 65 * @param {!Event} event The event to dispatch.
66 * @return {boolean} Whether the default action was prevented. If someone 66 * @return {boolean} Whether the default action was prevented. If someone
67 * calls preventDefault on the event object then this returns false. 67 * calls preventDefault on the event object then this returns false.
68 */ 68 */
69 dispatchEvent: function(event) { 69 dispatchEvent: function(event) {
70 if (!this.listeners_) 70 if (!this.listeners_)
71 return true; 71 return true;
72 72
73 // Since we are using DOM Event objects we need to override some of the 73 // Since we are using DOM Event objects we need to override some of the
74 // properties and methods so that we can emulate this correctly. 74 // properties and methods so that we can emulate this correctly.
75 var self = this; 75 var self = this;
(...skipping 16 matching lines...) Expand all
92 92
93 return !prevented && !event.defaultPrevented; 93 return !prevented && !event.defaultPrevented;
94 } 94 }
95 }; 95 };
96 96
97 // Export 97 // Export
98 return { 98 return {
99 EventTarget: EventTarget 99 EventTarget: EventTarget
100 }; 100 };
101 }); 101 });
OLDNEW
« no previous file with comments | « extensions/browser/extension_error.cc ('k') | ui/webui/resources/js/cr/ui/alert_overlay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698