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

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

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android compilation Created 7 years, 9 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 extension to provide permission request API (and possibly other future 5 // Shim extension to provide permission request API (and possibly other future
6 // experimental APIs) for <webview> tag. 6 // experimental APIs) for <webview> tag.
7 // See web_view.js for details. 7 // See web_view.js for details.
8 // 8 //
9 // We want to control the permission API feature in <webview> separately from 9 // We want to control the permission API feature in <webview> separately from
10 // the <webview> feature itself. <webview> is available in stable channel, but 10 // the <webview> feature itself. <webview> is available in stable channel, but
11 // permission API would only be available for channels CHANNEL_DEV and 11 // permission API would only be available for channels CHANNEL_DEV and
12 // CHANNEL_CANARY. 12 // CHANNEL_CANARY.
13 13
14 var WebView = require('webview').WebView; 14 var WebView = require('webView').WebView;
15 15
16 /** @type {Array.<string>} */ 16 /** @type {Array.<string>} */
17 var PERMISSION_TYPES = ['media', 'geolocation']; 17 var PERMISSION_TYPES = ['media', 'geolocation'];
18 18
19 /** @type {string} */ 19 /** @type {string} */
20 var ERROR_MSG_PERMISSION_ALREADY_DECIDED = '<webview>: ' + 20 var ERROR_MSG_PERMISSION_ALREADY_DECIDED = '<webview>: ' +
21 'Permission has already been decided for this "permissionrequest" event.'; 21 'Permission has already been decided for this "permissionrequest" event.';
22 22
23 /** 23 /**
24 * @param {!Object} detail The event details, originated from <object>. 24 * @param {!Object} detail The event details, originated from <object>.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 */ 79 */
80 WebView.prototype.maybeSetupExecuteScript_ = function() { 80 WebView.prototype.maybeSetupExecuteScript_ = function() {
81 var self = this; 81 var self = this;
82 this.node_['executeScript'] = function(var_args) { 82 this.node_['executeScript'] = function(var_args) {
83 var args = [self.objectNode_.getProcessId(), 83 var args = [self.objectNode_.getProcessId(),
84 self.objectNode_.getRouteId()].concat( 84 self.objectNode_.getRouteId()].concat(
85 Array.prototype.slice.call(arguments)); 85 Array.prototype.slice.call(arguments));
86 chrome.webview.executeScript.apply(null, args); 86 chrome.webview.executeScript.apply(null, args);
87 } 87 }
88 }; 88 };
OLDNEW
« no previous file with comments | « chrome/renderer/resources/extensions/web_view.js ('k') | chrome/renderer/resources/extensions/webstore_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698