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

Side by Side Diff: chrome/renderer/resources/event_bindings.js

Issue 7029031: Content settings extension API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync & review Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 chrome = chrome || {}; 5 var chrome = chrome || {};
6 (function () { 6 (function () {
7 native function GetChromeHidden(); 7 native function GetChromeHidden();
8 native function AttachEvent(eventName); 8 native function AttachEvent(eventName);
9 native function DetachEvent(eventName); 9 native function DetachEvent(eventName);
10 native function GetExternalFileEntry(fileDefinition); 10 native function GetExternalFileEntry(fileDefinition);
11 11
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 var validationErrors = this.validate_(args); 174 var validationErrors = this.validate_(args);
175 if (validationErrors) { 175 if (validationErrors) {
176 return validationErrors; 176 return validationErrors;
177 } 177 }
178 } 178 }
179 for (var i = 0; i < this.listeners_.length; i++) { 179 for (var i = 0; i < this.listeners_.length; i++) {
180 try { 180 try {
181 this.listeners_[i].apply(null, args); 181 this.listeners_[i].apply(null, args);
182 } catch (e) { 182 } catch (e) {
183 console.error("Error in event handler for '" + this.eventName_ + 183 console.error("Error in event handler for '" + this.eventName_ +
184 "': " + e); 184 "': " + e.stack);
185 } 185 }
186 } 186 }
187 }; 187 };
188 188
189 // Attaches this event object to its name. Only one object can have a given 189 // Attaches this event object to its name. Only one object can have a given
190 // name. 190 // name.
191 chrome.Event.prototype.attach_ = function() { 191 chrome.Event.prototype.attach_ = function() {
192 AttachEvent(this.eventName_); 192 AttachEvent(this.eventName_);
193 allAttachedEvents[allAttachedEvents.length] = this; 193 allAttachedEvents[allAttachedEvents.length] = this;
194 if (!this.eventName_) 194 if (!this.eventName_)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 var event = allAttachedEvents[i]; 241 var event = allAttachedEvents[i];
242 if (event) 242 if (event)
243 event.detach_(); 243 event.detach_();
244 } 244 }
245 }; 245 };
246 246
247 chromeHidden.dispatchError = function(msg) { 247 chromeHidden.dispatchError = function(msg) {
248 console.error(msg); 248 console.error(msg);
249 }; 249 };
250 })(); 250 })();
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/samples.json ('k') | chrome/renderer/resources/extension_apitest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698