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

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

Issue 17451011: Make the externally connectable browser test clobber all of the builtins, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <adview> tag via Mutation Observers. 5 // Shim that simulates a <adview> 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 // TODO(rpaquay): This file is currently very similar to "web_view.js". Do we 10 // TODO(rpaquay): This file is currently very similar to "web_view.js". Do we
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 /** 154 /**
155 * @private 155 * @private
156 */ 156 */
157 AdView.prototype.setupAdviewNodeMethods_ = function() { 157 AdView.prototype.setupAdviewNodeMethods_ = function() {
158 // this.browserPluginNode_[apiMethod] are not necessarily defined immediately 158 // this.browserPluginNode_[apiMethod] are not necessarily defined immediately
159 // after the shadow object is appended to the shadow root. 159 // after the shadow object is appended to the shadow root.
160 var self = this; 160 var self = this;
161 $Array.forEach(AD_VIEW_API_METHODS, function(apiMethod) { 161 $Array.forEach(AD_VIEW_API_METHODS, function(apiMethod) {
162 self.adviewNode_[apiMethod] = function(var_args) { 162 self.adviewNode_[apiMethod] = function(var_args) {
163 return self.browserPluginNode_[apiMethod].apply( 163 return $Function.apply(self.browserPluginNode_[apiMethod],
164 self.browserPluginNode_, arguments); 164 self.browserPluginNode_, arguments);
165 }; 165 };
166 }, this); 166 }, this);
167 } 167 }
168 168
169 /** 169 /**
170 * @private 170 * @private
171 */ 171 */
172 AdView.prototype.setupAdviewNodeObservers_ = function() { 172 AdView.prototype.setupAdviewNodeObservers_ = function() {
173 // Map attribute modifications on the <adview> tag to property changes in 173 // Map attribute modifications on the <adview> tag to property changes in
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 // Dispatch event. 465 // Dispatch event.
466 this.adviewNode_.dispatchEvent(evt); 466 this.adviewNode_.dispatchEvent(evt);
467 } 467 }
468 468
469 // 469 //
470 // Hook up <adview> tag creation in DOM. 470 // Hook up <adview> tag creation in DOM.
471 // 471 //
472 window.addEventListener('DOMContentLoaded', function() { 472 window.addEventListener('DOMContentLoaded', function() {
473 watchForTag('ADVIEW', function(addedNode) { new AdView(addedNode); }); 473 watchForTag('ADVIEW', function(addedNode) { new AdView(addedNode); });
474 }); 474 });
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/safe_builtins.cc ('k') | chrome/renderer/resources/extensions/app_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698