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

Unified Diff: resources/bookmark_manager/js/cr/event.js

Issue 853002: Updating the Chromium reference build for Windows. The continuous... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/reference_builds/chrome/
Patch Set: Added the symbol files back. Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « resources/bookmark_manager/js/cr.js ('k') | resources/bookmark_manager/js/cr/eventtarget.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: resources/bookmark_manager/js/cr/event.js
===================================================================
--- resources/bookmark_manager/js/cr/event.js (revision 0)
+++ resources/bookmark_manager/js/cr/event.js (revision 0)
@@ -0,0 +1,40 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview This is a simple pure JS event class that can be used with
+ * {@code cr.ui.EventTarget}. It should not be used with DOM EventTargets.
+ */
+
+cr.define('cr', function() {
+
+ // cr.Event is called CustomEvent in here to prevent naming conflicts. We
+ // alse store the original Event in case someone does a global alias of
+ // cr.Event.
+
+ const DomEvent = Event;
+
+ /**
+ * Creates a new event to be used with cr.EventTarget or DOM EventTarget
+ * objects.
+ * @param {string} type The name of the event.
+ * @param {boolean=}
+ * @constructor
+ */
+ function CustomEvent(type, opt_bubbles, opt_capture) {
+ var e = cr.doc.createEvent('Event');
+ e.initEvent(type, !!opt_bubbles, !!opt_capture);
+ e.__proto__ = CustomEvent.prototype;
+ return e;
+ }
+
+ CustomEvent.prototype = {
+ __proto__: DomEvent.prototype
+ };
+
+ // Export
+ return {
+ Event: CustomEvent
+ };
+});
« no previous file with comments | « resources/bookmark_manager/js/cr.js ('k') | resources/bookmark_manager/js/cr/eventtarget.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698