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

Unified Diff: chrome/renderer/resources/event_bindings.js

Issue 262016: Implement chrome.extension.connectExternal and fix various API inconsistencies. (Closed)
Patch Set: addressed comments Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/mock_render_thread.cc ('k') | chrome/renderer/resources/extension_process_bindings.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/event_bindings.js
diff --git a/chrome/renderer/resources/event_bindings.js b/chrome/renderer/resources/event_bindings.js
index 3def161f7d300c292ca337e6668f69e76a838ff2..dc69268c34d387d41cb98077eaaa8911d8771bbd 100644
--- a/chrome/renderer/resources/event_bindings.js
+++ b/chrome/renderer/resources/event_bindings.js
@@ -2,11 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// -----------------------------------------------------------------------------
-// NOTE: If you change this file you need to touch renderer_resources.grd to
-// have your change take effect.
-// -----------------------------------------------------------------------------
-
var chrome = chrome || {};
(function () {
native function GetChromeHidden();
@@ -105,6 +100,11 @@ var chrome = chrome || {};
return this.findListeners_(cb) > -1;
};
+ // Test if any callbacks are registered for this event.
+ chrome.Event.prototype.hasListeners = function(cb) {
+ return this.listeners_.length > 0;
+ };
+
// Returns the index of the given callback if registered, or -1 if not
// found.
chrome.Event.prototype.findListener_ = function(cb) {
« no previous file with comments | « chrome/renderer/mock_render_thread.cc ('k') | chrome/renderer/resources/extension_process_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698