OLD | NEW |
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 Loading... |
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 }; |
OLD | NEW |