summaryrefslogtreecommitdiff
path: root/chromium/chrome/renderer/resources
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/renderer/resources')
-rw-r--r--chromium/chrome/renderer/resources/default_100_percent/common/sadplugin.pngbin238 -> 0 bytes
-rw-r--r--chromium/chrome/renderer/resources/default_100_percent/common/webview-crash.pngbin153 -> 0 bytes
-rw-r--r--chromium/chrome/renderer/resources/default_200_percent/common/sadplugin.pngbin321 -> 0 bytes
-rw-r--r--chromium/chrome/renderer/resources/default_200_percent/common/webview-crash.pngbin187 -> 0 bytes
-rw-r--r--chromium/chrome/renderer/resources/extensions/cast_streaming_receiver_session_custom_bindings.js15
-rw-r--r--chromium/chrome/renderer/resources/extensions/cast_streaming_rtp_stream_custom_bindings.js40
-rw-r--r--chromium/chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js15
-rw-r--r--chromium/chrome/renderer/resources/extensions/cast_streaming_udp_transport_custom_bindings.js23
-rw-r--r--chromium/chrome/renderer/resources/extensions/chromeos_tts_stream_bindings.js19
-rw-r--r--chromium/chrome/renderer/resources/extensions/media_router_bindings.js33
-rw-r--r--chromium/chrome/renderer/resources/extensions/platform_keys/get_public_key.js36
-rw-r--r--chromium/chrome/renderer/resources/extensions/platform_keys/internal_api.js3
-rw-r--r--chromium/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js18
-rw-r--r--chromium/chrome/renderer/resources/renderer_resources.grd11
14 files changed, 93 insertions, 120 deletions
diff --git a/chromium/chrome/renderer/resources/default_100_percent/common/sadplugin.png b/chromium/chrome/renderer/resources/default_100_percent/common/sadplugin.png
deleted file mode 100644
index 9ad1225ac67..00000000000
--- a/chromium/chrome/renderer/resources/default_100_percent/common/sadplugin.png
+++ /dev/null
Binary files differ
diff --git a/chromium/chrome/renderer/resources/default_100_percent/common/webview-crash.png b/chromium/chrome/renderer/resources/default_100_percent/common/webview-crash.png
deleted file mode 100644
index 0ce1db18805..00000000000
--- a/chromium/chrome/renderer/resources/default_100_percent/common/webview-crash.png
+++ /dev/null
Binary files differ
diff --git a/chromium/chrome/renderer/resources/default_200_percent/common/sadplugin.png b/chromium/chrome/renderer/resources/default_200_percent/common/sadplugin.png
deleted file mode 100644
index 78286797176..00000000000
--- a/chromium/chrome/renderer/resources/default_200_percent/common/sadplugin.png
+++ /dev/null
Binary files differ
diff --git a/chromium/chrome/renderer/resources/default_200_percent/common/webview-crash.png b/chromium/chrome/renderer/resources/default_200_percent/common/webview-crash.png
deleted file mode 100644
index eeb34b253a6..00000000000
--- a/chromium/chrome/renderer/resources/default_200_percent/common/webview-crash.png
+++ /dev/null
Binary files differ
diff --git a/chromium/chrome/renderer/resources/extensions/cast_streaming_receiver_session_custom_bindings.js b/chromium/chrome/renderer/resources/extensions/cast_streaming_receiver_session_custom_bindings.js
deleted file mode 100644
index 64c5370d233..00000000000
--- a/chromium/chrome/renderer/resources/extensions/cast_streaming_receiver_session_custom_bindings.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Custom binding for the Cast Streaming Session API.
-
-var natives = requireNative('cast_streaming_natives');
-
-apiBridge.registerCustomHook(function(bindingsAPI, extensionId) {
- var apiFunctions = bindingsAPI.apiFunctions;
- apiFunctions.setHandleRequest(
- 'createAndBind',
- function(ap, vp, local, weidgth, height, fr, url, cb, op) {
- });
-});
diff --git a/chromium/chrome/renderer/resources/extensions/cast_streaming_rtp_stream_custom_bindings.js b/chromium/chrome/renderer/resources/extensions/cast_streaming_rtp_stream_custom_bindings.js
deleted file mode 100644
index 8e4f312d147..00000000000
--- a/chromium/chrome/renderer/resources/extensions/cast_streaming_rtp_stream_custom_bindings.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Custom binding for the Cast Streaming RtpStream API.
-
-var natives = requireNative('cast_streaming_natives');
-
-apiBridge.registerCustomHook(function(bindingsAPI, extensionId) {
- var apiFunctions = bindingsAPI.apiFunctions;
-
- apiFunctions.setHandleRequest('destroy',
- function(transportId) {
- natives.DestroyCastRtpStream(transportId);
- });
- apiFunctions.setHandleRequest('getSupportedParams',
- function(transportId) {
- return natives.GetSupportedParamsCastRtpStream(transportId);
- });
- apiFunctions.setHandleRequest('start',
- function(transportId, params) {
- natives.StartCastRtpStream(transportId, params);
- });
- apiFunctions.setHandleRequest('stop',
- function(transportId) {
- natives.StopCastRtpStream(transportId);
- });
- apiFunctions.setHandleRequest('toggleLogging',
- function(transportId, enable) {
- natives.ToggleLogging(transportId, enable);
- });
- apiFunctions.setHandleRequest('getRawEvents',
- function(transportId, extraData, callback) {
- natives.GetRawEvents(transportId, extraData, callback);
- });
- apiFunctions.setHandleRequest('getStats',
- function(transportId, callback) {
- natives.GetStats(transportId, callback);
- });
-});
diff --git a/chromium/chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js b/chromium/chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js
deleted file mode 100644
index 05afdd6a0d9..00000000000
--- a/chromium/chrome/renderer/resources/extensions/cast_streaming_session_custom_bindings.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Custom binding for the Cast Streaming Session API.
-
-var natives = requireNative('cast_streaming_natives');
-
-apiBridge.registerCustomHook(function(bindingsAPI, extensionId) {
- var apiFunctions = bindingsAPI.apiFunctions;
- apiFunctions.setHandleRequest('create',
- function(audioTrack, videoTrack, callback) {
- natives.CreateSession(audioTrack, videoTrack, callback);
- });
-});
diff --git a/chromium/chrome/renderer/resources/extensions/cast_streaming_udp_transport_custom_bindings.js b/chromium/chrome/renderer/resources/extensions/cast_streaming_udp_transport_custom_bindings.js
deleted file mode 100644
index c3f64736225..00000000000
--- a/chromium/chrome/renderer/resources/extensions/cast_streaming_udp_transport_custom_bindings.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Custom binding for the Cast Streaming UdpTransport API.
-
-var natives = requireNative('cast_streaming_natives');
-
-apiBridge.registerCustomHook(function(bindingsAPI, extensionId) {
- var apiFunctions = bindingsAPI.apiFunctions;
-
- apiFunctions.setHandleRequest('destroy', function(transportId) {
- natives.DestroyCastUdpTransport(transportId);
- });
- apiFunctions.setHandleRequest('setDestination',
- function(transportId, destination) {
- natives.SetDestinationCastUdpTransport(transportId, destination);
- });
- apiFunctions.setHandleRequest('setOptions',
- function(transportId, options) {
- natives.SetOptionsCastUdpTransport(transportId, options);
- });
-});
diff --git a/chromium/chrome/renderer/resources/extensions/chromeos_tts_stream_bindings.js b/chromium/chrome/renderer/resources/extensions/chromeos_tts_stream_bindings.js
new file mode 100644
index 00000000000..de636071106
--- /dev/null
+++ b/chromium/chrome/renderer/resources/extensions/chromeos_tts_stream_bindings.js
@@ -0,0 +1,19 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+'use strict';
+
+if ((typeof mojo === 'undefined') || !mojo.bindingsLibraryInitialized) {
+ loadScript('mojo_bindings');
+}
+mojo.config.autoLoadMojomDeps = false;
+
+loadScript('chromeos.tts.mojom.tts_stream.mojom');
+
+(function() {
+ let ptr = new chromeos.tts.mojom.TtsStreamPtr;
+ Mojo.bindInterface(
+ chromeos.tts.mojom.TtsStream.name, mojo.makeRequest(ptr).handle);
+ exports.$set('returnValue', ptr);
+})();
diff --git a/chromium/chrome/renderer/resources/extensions/media_router_bindings.js b/chromium/chrome/renderer/resources/extensions/media_router_bindings.js
index 6564c71d924..f24fc18793e 100644
--- a/chromium/chrome/renderer/resources/extensions/media_router_bindings.js
+++ b/chromium/chrome/renderer/resources/extensions/media_router_bindings.js
@@ -536,7 +536,7 @@ function routeToMojo_(route) {
'iconUrl': route.iconUrl,
'isLocal': route.isLocal,
'forDisplay': route.forDisplay,
- 'isIncognito': route.offTheRecord,
+ 'isOffTheRecord': route.offTheRecord,
'isLocalPresentation': route.isOffscreenPresentation,
'controllerType': route.controllerType,
'presentationId': route.presentationId,
@@ -973,6 +973,13 @@ MediaRouter.prototype.getMediaSinkServiceStatus = function() {
}
/**
+ * @return {!Promise<!{status: string}>}
+ */
+MediaRouter.prototype.getLogsAsString = function() {
+ return this.service_.getLogsAsString();
+}
+
+/**
* @param {int32} target_tab_id
* @param {!mojo.InterfaceRequest} request
*/
@@ -1186,19 +1193,19 @@ MediaRouteProvider.prototype.stopObservingMediaSinks =
* @param {!number} tabId ID of tab requesting presentation.
* @param {!mojo_base.mojom.TimeDelta} timeout If positive, the timeout
* duration for the request. Otherwise, the default duration will be used.
- * @param {!boolean} incognito If true, the route is being requested by
- * an incognito profile.
+ * @param {!boolean} off_the_record If true, the route is being requested by
+ * an off_the_record profile.
* @return {!Promise.<!Object>} A Promise resolving to an object describing
* the newly created media route, or rejecting with an error message on
* failure.
*/
MediaRouteProvider.prototype.createRoute =
function(sourceUrn, sinkId, presentationId, origin, tabId,
- timeout, incognito) {
+ timeout, off_the_record) {
this.handlers_.onBeforeInvokeHandler();
return this.handlers_.createRoute(
sourceUrn, sinkId, presentationId, origin, tabId,
- Math.floor(timeout.microseconds / 1000), incognito)
+ Math.floor(timeout.microseconds / 1000), off_the_record)
.then(function(route) {
return toSuccessRouteResponse_(route);
},
@@ -1217,19 +1224,19 @@ MediaRouteProvider.prototype.createRoute =
* @param {!number} tabId ID of tab requesting join.
* @param {!mojo_base.mojom.TimeDelta} timeout If positive, the timeout
* duration for the request. Otherwise, the default duration will be used.
- * @param {!boolean} incognito If true, the route is being requested by
- * an incognito profile.
+ * @param {!boolean} off_the_record If true, the route is being requested by
+ * an off_the_record profile.
* @return {!Promise.<!Object>} A Promise resolving to an object describing
* the newly created media route, or rejecting with an error message on
* failure.
*/
MediaRouteProvider.prototype.joinRoute =
function(sourceUrn, presentationId, origin, tabId, timeout,
- incognito) {
+ off_the_record) {
this.handlers_.onBeforeInvokeHandler();
return this.handlers_.joinRoute(
sourceUrn, presentationId, origin, tabId,
- Math.floor(timeout.microseconds / 1000), incognito)
+ Math.floor(timeout.microseconds / 1000), off_the_record)
.then(function(route) {
return toSuccessRouteResponse_(route);
},
@@ -1249,19 +1256,19 @@ MediaRouteProvider.prototype.joinRoute =
* @param {!number} tabId ID of tab requesting join.
* @param {!mojo_base.mojom.TimeDelta} timeout If positive, the timeout
* duration for the request. Otherwise, the default duration will be used.
- * @param {!boolean} incognito If true, the route is being requested by
- * an incognito profile.
+ * @param {!boolean} off_the_record If true, the route is being requested by
+ * an off_the_record profile.
* @return {!Promise.<!Object>} A Promise resolving to an object describing
* the newly created media route, or rejecting with an error message on
* failure.
*/
MediaRouteProvider.prototype.connectRouteByRouteId =
function(sourceUrn, routeId, presentationId, origin, tabId,
- timeout, incognito) {
+ timeout, off_the_record) {
this.handlers_.onBeforeInvokeHandler();
return this.handlers_.connectRouteByRouteId(
sourceUrn, routeId, presentationId, origin, tabId,
- Math.floor(timeout.microseconds / 1000), incognito)
+ Math.floor(timeout.microseconds / 1000), off_the_record)
.then(function(route) {
return toSuccessRouteResponse_(route);
},
diff --git a/chromium/chrome/renderer/resources/extensions/platform_keys/get_public_key.js b/chromium/chrome/renderer/resources/extensions/platform_keys/get_public_key.js
index 5bf7255e88b..d5105f0902f 100644
--- a/chromium/chrome/renderer/resources/extensions/platform_keys/get_public_key.js
+++ b/chromium/chrome/renderer/resources/extensions/platform_keys/get_public_key.js
@@ -10,12 +10,14 @@ var normalizeAlgorithm =
// Returns the normalized parameters of |importParams|.
// Any unknown parameters will be ignored.
function normalizeImportParams(importParams) {
- if (!importParams.name ||
- Object.prototype.toString.call(importParams.name) !== '[object String]') {
+ if (!importParams.name || typeof importParams.name !== 'string') {
throw new Error('Algorithm: name: Missing or not a String');
}
- var filteredParams = { name: importParams.name };
+ var filteredParams = {
+ name: importParams.name,
+ namedCurve: importParams.namedCurve
+ };
var hashIsNone = false;
if (importParams.hash) {
@@ -29,9 +31,13 @@ function normalizeImportParams(importParams) {
}
}
+ if (importParams.name === 'ECDSA' && importParams.namedCurve !== 'P-256') {
+ throw new Error('Only P-256 named curve is supported.');
+ }
+
// Apply WebCrypto's algorithm normalization.
var resultParams = normalizeAlgorithm(filteredParams, 'ImportKey');
- if (!resultParams ) {
+ if (!resultParams) {
throw new Error('A required parameter was missing or out-of-range');
}
if (hashIsNone) {
@@ -47,11 +53,14 @@ function combineAlgorithms(algorithm, importParams) {
algorithm.publicExponent = new Uint8Array(algorithm.publicExponent);
}
- algorithm.hash = importParams.hash;
+ if (importParams.hash) {
+ algorithm.hash = importParams.hash;
+ }
return algorithm;
}
function getPublicKey(cert, importParams, callback) {
+ // TODO(crbug.com/1096486): Check cert type is ArrayBuffer.
importParams = normalizeImportParams(importParams);
internalAPI.getPublicKey(
cert, importParams.name, function(publicKey, algorithm) {
@@ -64,4 +73,21 @@ function getPublicKey(cert, importParams, callback) {
});
}
+function getPublicKeyBySpki(publicKeySpkiDer, importParams, callback) {
+ if (!(publicKeySpkiDer instanceof ArrayBuffer)){
+ throw $Error.self('publicKeySpkiDer: Not an ArrayBuffer');
+ }
+ importParams = normalizeImportParams(importParams);
+ internalAPI.getPublicKeyBySpki(
+ publicKeySpkiDer, importParams.name, function(publicKey, algorithm) {
+ if (bindingUtil.hasLastError()) {
+ callback();
+ return;
+ }
+ var combinedAlgorithm = combineAlgorithms(algorithm, importParams);
+ callback(publicKey, combinedAlgorithm);
+ });
+}
+
exports.$set('getPublicKey', getPublicKey);
+exports.$set('getPublicKeyBySpki', getPublicKeyBySpki);
diff --git a/chromium/chrome/renderer/resources/extensions/platform_keys/internal_api.js b/chromium/chrome/renderer/resources/extensions/platform_keys/internal_api.js
index b3c4c0fef36..324eee7fa77 100644
--- a/chromium/chrome/renderer/resources/extensions/platform_keys/internal_api.js
+++ b/chromium/chrome/renderer/resources/extensions/platform_keys/internal_api.js
@@ -2,8 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// TODO(crbug.com/1096029): Make consumers use the API directly by calling
+// getInternalApi themselves.
var binding = getInternalApi('platformKeysInternal');
exports.$set('selectClientCertificates', binding.selectClientCertificates);
exports.$set('sign', binding.sign);
exports.$set('getPublicKey', binding.getPublicKey);
+exports.$set('getPublicKeyBySpki', binding.getPublicKeyBySpki);
diff --git a/chromium/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js b/chromium/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
index 70faf9bd0a8..147269975db 100644
--- a/chromium/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
+++ b/chromium/chrome/renderer/resources/extensions/platform_keys_custom_bindings.js
@@ -5,7 +5,9 @@
// Custom binding for the platformKeys API.
var SubtleCrypto = require('platformKeys.SubtleCrypto').SubtleCrypto;
-var getPublicKey = require('platformKeys.getPublicKey').getPublicKey;
+var publicKeyUtil = require('platformKeys.getPublicKeyUtil');
+var getPublicKey = publicKeyUtil.getPublicKey;
+var getPublicKeyBySpki = publicKeyUtil.getPublicKeyBySpki;
var internalAPI = require('platformKeys.internalAPI');
var keyModule = require('platformKeys.Key');
@@ -60,4 +62,18 @@ apiBridge.registerCustomHook(function(api) {
createPrivateKey(publicKey, algorithm));
});
});
+
+ apiFunctions.setHandleRequest(
+ 'getKeyPairBySpki', function(publicKeySpkiDer, params, callback) {
+ getPublicKeyBySpki(
+ publicKeySpkiDer, params, function(publicKey, algorithm) {
+ if (bindingUtil.hasLastError()) {
+ callback();
+ return;
+ }
+ callback(
+ createPublicKey(publicKey, algorithm),
+ createPrivateKey(publicKey, algorithm));
+ });
+ });
});
diff --git a/chromium/chrome/renderer/resources/renderer_resources.grd b/chromium/chrome/renderer/resources/renderer_resources.grd
index 3f31e156ca7..076fd011a55 100644
--- a/chromium/chrome/renderer/resources/renderer_resources.grd
+++ b/chromium/chrome/renderer/resources/renderer_resources.grd
@@ -9,10 +9,6 @@
<output filename="renderer_resources_300_percent.pak" type="data_package" context="default_300_percent" />
</outputs>
<release seq="1">
- <structures fallback_to_low_resolution="true">
- <structure type="chrome_scaled_image" name="IDR_SAD_WEBVIEW" file="common\webview-crash.png" />
- <structure type="chrome_scaled_image" name="IDR_SAD_PLUGIN" file="common\sadplugin.png" />
- </structures>
<includes>
<include name="IDR_BLOCKED_PLUGIN_HTML" file="plugins/blocked_plugin.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_DISABLED_PLUGIN_HTML" file="plugins/disabled_plugin.html" flattenhtml="true" type="BINDATA" />
@@ -25,10 +21,6 @@
<!-- Custom bindings for extension APIs. -->
<include name="IDR_ACTION_CUSTOM_BINDINGS_JS" file="extensions\action_custom_bindings.js" type="BINDATA" />
<include name="IDR_BROWSER_ACTION_CUSTOM_BINDINGS_JS" file="extensions\browser_action_custom_bindings.js" type="BINDATA" />
- <include name="IDR_CAST_STREAMING_RTP_STREAM_CUSTOM_BINDINGS_JS" file="extensions\cast_streaming_rtp_stream_custom_bindings.js" type="BINDATA" />
- <include name="IDR_CAST_STREAMING_SESSION_CUSTOM_BINDINGS_JS" file="extensions\cast_streaming_session_custom_bindings.js" type="BINDATA" />
- <include name="IDR_CAST_STREAMING_UDP_TRANSPORT_CUSTOM_BINDINGS_JS" file="extensions\cast_streaming_udp_transport_custom_bindings.js" type="BINDATA" />
- <include name="IDR_CAST_STREAMING_RECEIVER_SESSION_CUSTOM_BINDINGS_JS" file="extensions\cast_streaming_receiver_session_custom_bindings.js" type="BINDATA" />
<include name="IDR_CHROME_WEB_VIEW_INTERNAL_CUSTOM_BINDINGS_JS" file="extensions\web_view\chrome_web_view_internal_custom_bindings.js" type="BINDATA" />
<include name="IDR_CHROME_WEB_VIEW_JS" file="extensions\web_view\chrome_web_view.js" type="BINDATA" />
<include name="IDR_DECLARATIVE_CONTENT_CUSTOM_BINDINGS_JS" file="extensions\declarative_content_custom_bindings.js" type="BINDATA" />
@@ -72,6 +64,9 @@
<!-- ChromeOS IME Mojo service and bindings. -->
<include name="IDR_IME_SERVICE_BINDINGS_JS" file="extensions\chromeos_ime_service_bindings.js" type="BINDATA" />
<include name="IDR_IME_SERVICE_MOJOM_JS" file="${mojom_root}\chromeos/services/ime/public/mojom/input_engine.mojom.js" use_base_dir="false" type="BINDATA" />
+
+ <include name="IDR_TTS_STREAM_BINDINGS_JS" file="extensions\chromeos_tts_stream_bindings.js" type="BINDATA" />
+ <include name="IDR_TTS_STREAM_MOJOM_JS" file="${mojom_root}\chromeos/services/tts/public/mojom/tts_service.mojom.js" use_base_dir="false" type="BINDATA" />
</if>
<!-- Media Router Mojo service and bindings. -->
<include name="IDR_MEDIA_CONTROLLER_MOJOM_JS" file="${mojom_root}\chrome\common\media_router\mojom\media_controller.mojom.js" use_base_dir="false" type="BINDATA" />