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

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

Issue 226043005: Fix webview.executeScript API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update InsertCss API. Created 6 years, 8 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
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 // This module implements Webview (<webview>) as a custom element that wraps a 5 // This module implements Webview (<webview>) as a custom element that wraps a
6 // BrowserPlugin object element. The object element is hidden within 6 // BrowserPlugin object element. The object element is hidden within
7 // the shadow DOM of the Webview element. 7 // the shadow DOM of the Webview element.
8 8
9 var DocumentNatives = requireNative('document_natives'); 9 var DocumentNatives = requireNative('document_natives');
10 var EventBindings = require('event_bindings'); 10 var EventBindings = require('event_bindings');
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 if (!this.instanceId) { 308 if (!this.instanceId) {
309 throw new Error(ERROR_MSG_CANNOT_INJECT_SCRIPT); 309 throw new Error(ERROR_MSG_CANNOT_INJECT_SCRIPT);
310 } 310 }
311 }; 311 };
312 312
313 /** 313 /**
314 * @private 314 * @private
315 */ 315 */
316 WebViewInternal.prototype.executeScript = function(var_args) { 316 WebViewInternal.prototype.executeScript = function(var_args) {
317 this.validateExecuteCodeCall(); 317 this.validateExecuteCodeCall();
318 var args = $Array.concat([this.instanceId], $Array.slice(arguments)); 318 var args = $Array.concat([this.instanceId, this.src],
319 $Array.slice(arguments));
319 $Function.apply(WebView.executeScript, null, args); 320 $Function.apply(WebView.executeScript, null, args);
320 }; 321 };
321 322
322 /** 323 /**
323 * @private 324 * @private
324 */ 325 */
325 WebViewInternal.prototype.insertCSS = function(var_args) { 326 WebViewInternal.prototype.insertCSS = function(var_args) {
326 this.validateExecuteCodeCall(); 327 this.validateExecuteCodeCall();
327 var args = $Array.concat([this.instanceId], $Array.slice(arguments)); 328 var args = $Array.concat([this.instanceId, this.src],
329 $Array.slice(arguments));
328 $Function.apply(WebView.insertCSS, null, args); 330 $Function.apply(WebView.insertCSS, null, args);
329 }; 331 };
330 332
331 /** 333 /**
332 * @private 334 * @private
333 */ 335 */
334 WebViewInternal.prototype.setupWebviewNodeProperties = function() { 336 WebViewInternal.prototype.setupWebviewNodeProperties = function() {
335 var ERROR_MSG_CONTENTWINDOW_NOT_AVAILABLE = '<webview>: ' + 337 var ERROR_MSG_CONTENTWINDOW_NOT_AVAILABLE = '<webview>: ' +
336 'contentWindow is not available at this time. It will become available ' + 338 'contentWindow is not available at this time. It will become available ' +
337 'when the page has finished loading.'; 339 'when the page has finished loading.';
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 1179
1178 /** 1180 /**
1179 * Implemented when the experimental API is available. 1181 * Implemented when the experimental API is available.
1180 * @private 1182 * @private
1181 */ 1183 */
1182 WebViewInternal.prototype.setupExperimentalContextMenus_ = function() {}; 1184 WebViewInternal.prototype.setupExperimentalContextMenus_ = function() {};
1183 1185
1184 exports.WebView = WebView; 1186 exports.WebView = WebView;
1185 exports.WebViewInternal = WebViewInternal; 1187 exports.WebViewInternal = WebViewInternal;
1186 exports.CreateEvent = CreateEvent; 1188 exports.CreateEvent = CreateEvent;
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/user_script_scheduler.cc ('k') | chrome/test/data/extensions/platform_apps/web_view/shim/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698