Index: components/sync/protocol/user_event_specifics.proto |
diff --git a/components/sync/protocol/user_event_specifics.proto b/components/sync/protocol/user_event_specifics.proto |
index 8d3efd1b3126faa2dbe3bedd446c7c48bd381693..75091eb22b7323c2ae759cd938311b4455367be7 100644 |
--- a/components/sync/protocol/user_event_specifics.proto |
+++ b/components/sync/protocol/user_event_specifics.proto |
@@ -13,6 +13,46 @@ option optimize_for = LITE_RUNTIME; |
package sync_pb; |
+// Language detection output. |
+message TranslateLanguageDetection { |
+ // ISO 639 language code for the guessed language based on content. |
+ optional string detected_language_code = 1; |
+ |
+ // The confidence in the language guess. |
+ optional float probability = 2; |
+ |
+ // TODO(skym): Is this important to emit? I don't understand how it is used. |
+ optional int32 text_bytes = 3; |
+ |
+ // TODO(skym): This is just calculated by the client from language and |
+ // probability. Do we really need to emit? |
+ optional bool is_reliable = 4; |
+ |
+ // The |detected_language_code| can be overridden by things like html lang |
+ // attribute. This field should only be set if it differs from the |
+ // |detected_language_code| field. |
+ optional string final_language_decision = 5; |
+} |
+ |
+// User translated a page or interacted with translate suggestion. |
+message TranslateInteraction { |
+ // ISO 639 language codes explicitly set by the user, and different from what |
+ // was suggested. |
+ optional string user_set_from_language_code = 1; |
+ optional string user_set_to_language_code = 2; |
+ enum Interaction { |
+ UNKNOWN = 0; |
+ ACCEPTED = 1; |
+ ACCEPTED_ALWAYS = 2; |
+ REJECTED = 3; |
+ REJECTED_NEVER_LANGUAGE = 4; |
+ REJECTED_NEVER_SITE = 5; |
+ UNDO = 6; |
+ IGNORED = 7; |
+ } |
+ optional Interaction interaction = 3; |
+} |
+ |
message UserEventSpecifics { |
// Time of event, as measured on the client (unix epoch). |
optional int64 event_time_usec = 1; |
@@ -24,5 +64,8 @@ message UserEventSpecifics { |
// other events belonged to. |
optional fixed64 session_id = 3; |
- // TODO(skym): Wrap actual event payloads in a oneof. |
+ oneof event { |
+ TranslateLanguageDetection translate_language_detection = 4; |
+ TranslateInteraction translate_interaction = 5; |
+ } |
} |