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

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

Issue 12146002: <webview>: Enable bubbling of events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
« no previous file with comments | « no previous file | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Shim that simulates a <webview> tag via Mutation Observers. 5 // Shim that simulates a <webview> tag via Mutation Observers.
6 // 6 //
7 // The actual tag is implemented via the browser plugin. The internals of this 7 // The actual tag is implemented via the browser plugin. The internals of this
8 // are hidden via Shadow DOM. 8 // are hidden via Shadow DOM.
9 9
10 var watchForTag = require("tagWatcher").watchForTag; 10 var watchForTag = require("tagWatcher").watchForTag;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 this.objectNode_.getAttribute(mutation.attributeName)); 160 this.objectNode_.getAttribute(mutation.attributeName));
161 } 161 }
162 }; 162 };
163 163
164 /** 164 /**
165 * @private 165 * @private
166 */ 166 */
167 WebView.prototype.setupEvent_ = function(eventname, attribs) { 167 WebView.prototype.setupEvent_ = function(eventname, attribs) {
168 var node = this.node_; 168 var node = this.node_;
169 this.objectNode_.addEventListener('-internal-' + eventname, function(e) { 169 this.objectNode_.addEventListener('-internal-' + eventname, function(e) {
170 var evt = new Event(eventname); 170 var evt = new Event(eventname, { bubbles: true });
171 var detail = e.detail ? JSON.parse(e.detail) : {}; 171 var detail = e.detail ? JSON.parse(e.detail) : {};
172 attribs.forEach(function(attribName) { 172 attribs.forEach(function(attribName) {
173 evt[attribName] = detail[attribName]; 173 evt[attribName] = detail[attribName];
174 }); 174 });
175 node.dispatchEvent(evt); 175 node.dispatchEvent(evt);
176 }); 176 });
177 } 177 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698