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

Side by Side Diff: extensions/renderer/resources/web_view_experimental.js

Issue 610643003: Adds new webview.loadDataWithBaseUrl API to allow data URLs to be loaded with a specified base URL … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment. Created 6 years, 2 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 | « extensions/common/api/web_view_internal.json ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 experimental API for <webview>. 5 // This module implements experimental API for <webview>.
6 // See web_view.js for details. 6 // See web_view.js for details.
7 // 7 //
8 // <webview> Experimental API is only available on canary and dev channels of 8 // <webview> Experimental API is only available on canary and dev channels of
9 // Chrome. 9 // Chrome.
10 10
11 var WebViewInternal = require('webView').WebViewInternal; 11 var WebViewInternal = require('webView').WebViewInternal;
12 var WebView = require('webViewInternal').WebView;
12 13
13 WebViewInternal.prototype.maybeGetExperimentalEvents = function() { 14 WebViewInternal.prototype.maybeGetExperimentalEvents = function() {
14 return {}; 15 return {};
15 }; 16 };
16 17
17 /** @private */ 18 /** @private */
18 WebViewInternal.prototype.maybeGetExperimentalPermissions = function() { 19 WebViewInternal.prototype.maybeGetExperimentalPermissions = function() {
19 return []; 20 return [];
20 }; 21 };
21 22
22 /** @private */ 23 /** @private */
23 WebViewInternal.prototype.captureVisibleRegion = function(spec, callback) { 24 WebViewInternal.prototype.captureVisibleRegion = function(spec, callback) {
24 WebView.captureVisibleRegion(this.guestInstanceId, spec, callback); 25 WebView.captureVisibleRegion(this.guestInstanceId, spec, callback);
25 }; 26 };
26 27
28 /** @private */
29 WebViewInternal.prototype.loadDataWithBaseUrl = function(
30 dataUrl, baseUrl, virtualUrl) {
31 if (!this.guestInstanceId) {
32 return;
33 }
34 WebView.loadDataWithBaseUrl(
35 this.guestInstanceId, dataUrl, baseUrl, virtualUrl, function () {
36 // Report any errors.
37 if (chrome.runtime.lastError != undefined) {
38 window.console.error(
39 "Error while running webview.loadDataWithBaseUrl: " +
40 chrome.runtime.lastError.message);
41 }
42 });
43 };
44
27 WebViewInternal.maybeRegisterExperimentalAPIs = function(proto) { 45 WebViewInternal.maybeRegisterExperimentalAPIs = function(proto) {
28 proto.captureVisibleRegion = function(spec, callback) { 46 proto.captureVisibleRegion = function(spec, callback) {
29 privates(this).internal.captureVisibleRegion(spec, callback); 47 privates(this).internal.captureVisibleRegion(spec, callback);
30 }; 48 };
49
50 proto.loadDataWithBaseUrl = function(dataUrl, baseUrl, virtualUrl) {
51 privates(this).internal.loadDataWithBaseUrl(dataUrl, baseUrl, virtualUrl);
52 }
31 }; 53 };
OLDNEW
« no previous file with comments | « extensions/common/api/web_view_internal.json ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698