Commit e2ad5f4f authored by Sam Goto's avatar Sam Goto Committed by Commit Bot

[sms] Add a new SharingMessage proto for fetching SMS messages remotely

Per instructions on the Unido design doc [1], this is the first step in
the process of creating a new Unido feature:

1) Add a new SharingMessage to the proto and update metrics mapping
2) Add your new SharingFCMHandler in SharingService constructor
3) Add a new feature in DeviceInfoSpecifics.EnabledFeatures
4) Add your enabled feature to SharingDeviceRegistration
5) Use SharingService to list device candidates, and use the new SendMessageToDevice to send messages

Steps (2-5) will follow in separate CLs, to ease reviewing and ease
other features tracking how to integrate.

[1] https://docs.google.com/document/d/1tvrKCEOaQuZv_j6j61ij_r9sjFlI25x8M8rIRL1DTsA/edit#

Design Doc: https://docs.google.com/document/d/1da8CjO71DlFbBzDcSosFRXTvDsKII_XMCohpZLQ_QbM/edit?userstoinvite=himanshujaju%40google.com&ts=5da89bb1&actionButton=1

Bug: 1015645
Change-Id: If41831a2e71ec88b4771c739be18fd17c18ac6f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1867444
Auto-Submit: Sam Goto <goto@chromium.org>
Commit-Queue: Mark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarAlex Chau <alexchau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707917}
parent 6760a002
...@@ -16,5 +16,6 @@ proto_library("proto") { ...@@ -16,5 +16,6 @@ proto_library("proto") {
"click_to_call_message.proto", "click_to_call_message.proto",
"shared_clipboard_message.proto", "shared_clipboard_message.proto",
"sharing_message.proto", "sharing_message.proto",
"sms_fetch_request.proto",
] ]
} }
...@@ -6,6 +6,7 @@ syntax = "proto3"; ...@@ -6,6 +6,7 @@ syntax = "proto3";
import "click_to_call_message.proto"; import "click_to_call_message.proto";
import "shared_clipboard_message.proto"; import "shared_clipboard_message.proto";
import "sms_fetch_request.proto";
package chrome_browser_sharing; package chrome_browser_sharing;
...@@ -22,9 +23,11 @@ enum MessageType { ...@@ -22,9 +23,11 @@ enum MessageType {
ACK_MESSAGE = 2; ACK_MESSAGE = 2;
CLICK_TO_CALL_MESSAGE = 3; CLICK_TO_CALL_MESSAGE = 3;
SHARED_CLIPBOARD_MESSAGE = 4; SHARED_CLIPBOARD_MESSAGE = 4;
SMS_FETCH_REQUEST = 5;
} }
// Message for sending between devices in Sharing. // Message for sending between devices in Sharing.
// Next tag: 9
message SharingMessage { message SharingMessage {
// Identifier of sender. required except for AckMessage. // Identifier of sender. required except for AckMessage.
string sender_guid = 1; string sender_guid = 1;
...@@ -35,6 +38,7 @@ message SharingMessage { ...@@ -35,6 +38,7 @@ message SharingMessage {
AckMessage ack_message = 3; AckMessage ack_message = 3;
ClickToCallMessage click_to_call_message = 4; ClickToCallMessage click_to_call_message = 4;
SharedClipboardMessage shared_clipboard_message = 5; SharedClipboardMessage shared_clipboard_message = 5;
SmsFetchRequest sms_fetch_request = 8;
} }
// RecipientInfo for responding an AckMessage to the sender. optional. // RecipientInfo for responding an AckMessage to the sender. optional.
......
// Copyright 2019 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.
syntax = "proto3";
package chrome_browser_sharing;
// Required in Chrome.
option optimize_for = LITE_RUNTIME;
// Request message to fetch a SMS from a remote device.
message SmsFetchRequest {}
...@@ -59,6 +59,8 @@ chrome_browser_sharing::MessageType SharingPayloadCaseToMessageType( ...@@ -59,6 +59,8 @@ chrome_browser_sharing::MessageType SharingPayloadCaseToMessageType(
return chrome_browser_sharing::CLICK_TO_CALL_MESSAGE; return chrome_browser_sharing::CLICK_TO_CALL_MESSAGE;
case chrome_browser_sharing::SharingMessage::kSharedClipboardMessage: case chrome_browser_sharing::SharingMessage::kSharedClipboardMessage:
return chrome_browser_sharing::SHARED_CLIPBOARD_MESSAGE; return chrome_browser_sharing::SHARED_CLIPBOARD_MESSAGE;
case chrome_browser_sharing::SharingMessage::kSmsFetchRequest:
return chrome_browser_sharing::SMS_FETCH_REQUEST;
} }
// For proto3 enums unrecognized enum values are kept when parsing, and a new // For proto3 enums unrecognized enum values are kept when parsing, and a new
// payload case received over the network would not default to // payload case received over the network would not default to
......
...@@ -56254,6 +56254,7 @@ Called by update_net_trust_anchors.py.--> ...@@ -56254,6 +56254,7 @@ Called by update_net_trust_anchors.py.-->
<int value="2" label="Ack"/> <int value="2" label="Ack"/>
<int value="3" label="ClickToCall"/> <int value="3" label="ClickToCall"/>
<int value="4" label="SharedClipboard"/> <int value="4" label="SharedClipboard"/>
<int value="5" label="SmsFetchRequest"/>
</enum> </enum>
<enum name="SharingSendMessageResult"> <enum name="SharingSendMessageResult">
...@@ -179262,6 +179262,7 @@ regressions. --> ...@@ -179262,6 +179262,7 @@ regressions. -->
<suffix name="CLICK_TO_CALL_MESSAGE" label="Click To Call Message"/> <suffix name="CLICK_TO_CALL_MESSAGE" label="Click To Call Message"/>
<suffix name="PING_MESSAGE" label="Ping Message"/> <suffix name="PING_MESSAGE" label="Ping Message"/>
<suffix name="SHARED_CLIPBOARD_MESSAGE" label="Shared Clipboard Message"/> <suffix name="SHARED_CLIPBOARD_MESSAGE" label="Shared Clipboard Message"/>
<suffix name="SMS_FETCH_REQUEST" label="SMS Fetch Request"/>
<suffix name="UNKNOWN_MESSAGE" label="Unknown Message"/> <suffix name="UNKNOWN_MESSAGE" label="Unknown Message"/>
<affected-histogram name="Sharing.MessageAckTime"/> <affected-histogram name="Sharing.MessageAckTime"/>
<affected-histogram name="Sharing.MessageReceivedType"/> <affected-histogram name="Sharing.MessageReceivedType"/>
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