Commit 9e4db570 authored by Shawn Gallea's avatar Shawn Gallea Committed by Commit Bot

Add PlatformViewsService to Webview proto

This is to allow associating cast apps with platform views.
WebviewService will be deprecated in future change.

Bug: b/136460199
Test: Compile cast_shell
Change-Id: I5bad0fe7817ec65e3719d9c43d0b08fcb679cd80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1856278Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Commit-Queue: Shawn Gallea <sagallea@google.com>
Cr-Commit-Position: refs/heads/master@{#705216}
parent 5a0c1455
...@@ -184,13 +184,26 @@ message JavascriptChannelMessage { ...@@ -184,13 +184,26 @@ message JavascriptChannelMessage {
string message = 2; string message = 2;
} }
// Associate a cast application with a platform view
message AssociateCastAppWindowRequest {
// This identifies the surface that the cast app will display into.
// It should be unique from all other platform views.
// This is the same platform id that is set in webview_id in
// WebviewCreateRequest
int32 platform_view_id = 1;
// This is the id of a cast application.
int32 app_window_id = 2;
}
message AssociateCastAppWindowResponse {}
message WebviewRequest { message WebviewRequest {
// Unique identifier for the request. For requests that will have a response, // Unique identifier for the request. For requests that will have a response,
// the response id will match the request id. // the response id will match the request id.
// Valid ID values must be greater than 0. // Valid ID values must be greater than 0.
int64 id = 18; int64 id = 18;
oneof type { oneof type {
// This must be the first message. // This must be the first message for CreateWebview.
WebviewCreateRequest create = 1; WebviewCreateRequest create = 1;
// No response. // No response.
InputEvent input = 2; InputEvent input = 2;
...@@ -226,6 +239,8 @@ message WebviewRequest { ...@@ -226,6 +239,8 @@ message WebviewRequest {
SetAutoMediaPlaybackPolicyRequest set_auto_media_playback_policy = 17; SetAutoMediaPlaybackPolicyRequest set_auto_media_playback_policy = 17;
// Response to a navigation request. // Response to a navigation request.
NavigationDecision navigation_decision = 19; NavigationDecision navigation_decision = 19;
// This must be the first request for CreateCastAppWindowLink
AssociateCastAppWindowRequest associate = 20;
} }
} }
...@@ -247,10 +262,20 @@ message WebviewResponse { ...@@ -247,10 +262,20 @@ message WebviewResponse {
// Events sents from JS inside of Webviews to the embedder who added JS // Events sents from JS inside of Webviews to the embedder who added JS
// channels via AddJavascriptChannelsRequest. // channels via AddJavascriptChannelsRequest.
JavascriptChannelMessage javascript_channel_message = 10; JavascriptChannelMessage javascript_channel_message = 10;
AssociateCastAppWindowResponse associate = 20;
} }
} }
// TODO(sagallea): Deprecate this after moving to new service.
service WebviewService { service WebviewService {
// Creates a webview. See the comment at the top of the file. // Creates a webview. See the comment at the top of the file.
rpc CreateWebview(stream WebviewRequest) returns (stream WebviewResponse); rpc CreateWebview(stream WebviewRequest) returns (stream WebviewResponse);
} }
service PlatformViewsService {
// Creates a webview. See the comment at the top of the file.
rpc CreateWebview(stream WebviewRequest) returns (stream WebviewResponse);
// Only AssociateRequest and InputEvent requests are valid.
rpc CreateCastAppWindowLink(stream WebviewRequest)
returns (stream WebviewResponse);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment