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

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

Issue 942183002: Speculative fix for executeScript bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« 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 // 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 GuestView = require('guestView').GuestView; 10 var GuestView = require('guestView').GuestView;
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 }; 234 };
235 235
236 // Shared implementation of executeScript() and insertCSS(). 236 // Shared implementation of executeScript() and insertCSS().
237 WebViewImpl.prototype.executeCode = function(func, args) { 237 WebViewImpl.prototype.executeCode = function(func, args) {
238 if (!this.guest.getId()) { 238 if (!this.guest.getId()) {
239 window.console.error(WebViewConstants.ERROR_MSG_CANNOT_INJECT_SCRIPT); 239 window.console.error(WebViewConstants.ERROR_MSG_CANNOT_INJECT_SCRIPT);
240 return false; 240 return false;
241 } 241 }
242 242
243 var webviewSrc = this.attributes[WebViewConstants.ATTRIBUTE_SRC].getValue(); 243 var webviewSrc = this.attributes[WebViewConstants.ATTRIBUTE_SRC].getValue();
244 if (this.baseUrlForDataUrl != '') { 244 if (this.baseUrlForDataUrl) {
245 webviewSrc = this.baseUrlForDataUrl; 245 webviewSrc = this.baseUrlForDataUrl;
246 } 246 }
247 247
248 args = $Array.concat([this.guest.getId(), webviewSrc], 248 args = $Array.concat([this.guest.getId(), webviewSrc],
249 $Array.slice(args)); 249 $Array.slice(args));
250 $Function.apply(func, null, args); 250 $Function.apply(func, null, args);
251 return true; 251 return true;
252 } 252 }
253 253
254 // Implemented when the ChromeWebView API is available. 254 // Implemented when the ChromeWebView API is available.
255 WebViewImpl.prototype.maybeGetChromeWebViewEvents = function() {}; 255 WebViewImpl.prototype.maybeGetChromeWebViewEvents = function() {};
256 256
257 // Implemented when the experimental WebView API is available. 257 // Implemented when the experimental WebView API is available.
258 WebViewImpl.maybeGetExperimentalApiMethods = function() { return []; }; 258 WebViewImpl.maybeGetExperimentalApiMethods = function() { return []; };
259 WebViewImpl.prototype.setupExperimentalContextMenus = function() {}; 259 WebViewImpl.prototype.setupExperimentalContextMenus = function() {};
260 WebViewImpl.prototype.maybeSetupExperimentalChromeWebViewEvents = 260 WebViewImpl.prototype.maybeSetupExperimentalChromeWebViewEvents =
261 function(request) { 261 function(request) {
262 return request; 262 return request;
263 }; 263 };
264 264
265 GuestViewContainer.registerElement(WebViewImpl); 265 GuestViewContainer.registerElement(WebViewImpl);
266 266
267 // Exports. 267 // Exports.
268 exports.WebViewImpl = WebViewImpl; 268 exports.WebViewImpl = WebViewImpl;
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