OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 // Sync protocol datatype extension for user events. | 5 // Sync protocol datatype extension for user events. |
6 | 6 |
7 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change | 7 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change |
8 // any fields in this file. | 8 // any fields in this file. |
9 | 9 |
10 syntax = "proto2"; | 10 syntax = "proto2"; |
11 | 11 |
12 option optimize_for = LITE_RUNTIME; | 12 option optimize_for = LITE_RUNTIME; |
13 | 13 |
14 package sync_pb; | 14 package sync_pb; |
15 | 15 |
16 message FieldTrial { | |
17 message FieldTrialPair { | |
18 optional fixed32 name_id = 1; | |
19 optional fixed32 group_id = 2; | |
20 } | |
21 repeated FieldTrialPair field_trial_pairs = 1; | |
22 } | |
23 | |
24 // Language detection output. | |
25 message LanguageDetection { | |
26 message Language { | |
27 // ISO 639 language code will be used. | |
28 optional string language_code = 1; | |
29 // Whether the detected language is reliable, note this is determined by | |
30 // the CLD3. | |
31 optional bool is_reliable = 2; | |
32 } | |
33 // Top n languages. Typically we just log the top language, but for page that | |
34 // we're not confident about, we may log up to 3 top languages in descending | |
35 // order. | |
36 repeated Language detected_languages = 1; | |
37 // Adopted language code is the code of final determined language. | |
38 // It will be stored only if it's different from the first detected language. | |
39 optional string adopted_language_code = 2; | |
40 } | |
41 | |
42 // User translated a page or interacted with translate suggestion. | |
43 message Translation { | |
44 // Source language of the translation. | |
45 optional string from_language_code = 1; | |
46 // Target language of the translation. | |
47 optional string to_language_code = 2; | |
48 enum Interaction { | |
49 UNKNOWN = 0; | |
50 ACCEPT = 1; | |
51 DECLINE = 2; | |
52 // This happens when user scroll or click outside the UI without | |
53 // translation. | |
54 IGNORED = 3; | |
55 // This happens when user choose to close the translation window without | |
56 // translation. | |
57 DISMISSED = 4; | |
58 // User manually entered either language. | |
59 // In this case, from_language_code and to_language_code will be user chosen | |
60 // values. | |
61 MANUAL = 5; | |
62 // User choose to revert the translation, in this case, from_language_code | |
63 // and to_language_code will be previous chosen values. | |
64 TRANSLATION_REVERTED = 6; | |
65 // Automatically triggered translation. | |
66 // User sets always translate in user settings. | |
67 AUTO_TRANSLATION_BY_PREF = 7; | |
68 // User navigated through a click from a translated page. | |
69 AUTO_TRANSLATION_BY_LINK = 8; | |
70 } | |
71 optional Interaction interaction = 3; | |
72 } | |
73 | |
74 message UserEventSpecifics { | 16 message UserEventSpecifics { |
75 // Time of event, as measured by client in microseconds since Windows epoch. | 17 // Time of event, as measured by client in microseconds since Windows epoch. |
76 optional int64 event_time_usec = 1; | 18 optional int64 event_time_usec = 1; |
77 | 19 |
78 // The |global_id| field of the associated navigation, if there is one. | 20 // The |global_id| field of the associated navigation, if there is one. |
79 optional int64 navigation_id = 2; | 21 optional int64 navigation_id = 2; |
80 | 22 |
81 // On startup we generate a new random id to identify which FieldTrialEvents | 23 // On startup we generate a new random id to identify which FieldTrialEvents |
82 // other events belonged to. | 24 // other events belonged to. |
83 optional fixed64 session_id = 3; | 25 optional fixed64 session_id = 3; |
84 | 26 |
85 // 4-7 reserved for future scalars. | 27 // 4-7 reserved for future scalars. |
86 | 28 |
87 // Used for testing and debugging EventLog system. | 29 // Used for testing and debugging EventLog system. |
88 message Test {} | 30 message Test {} |
89 | 31 |
| 32 // Reports field trial membership for the subset of trials that have been |
| 33 // registered as important to other event types. |
| 34 message FieldTrial { |
| 35 message FieldTrialPair { |
| 36 optional fixed32 name_id = 1; |
| 37 optional fixed32 group_id = 2; |
| 38 } |
| 39 repeated FieldTrialPair field_trial_pairs = 1; |
| 40 } |
| 41 |
| 42 // Language detection output. |
| 43 message LanguageDetection { |
| 44 message Language { |
| 45 // ISO 639 language code will be used. |
| 46 optional string language_code = 1; |
| 47 // Whether the detected language is reliable, note this is determined by |
| 48 // the CLD3. |
| 49 optional bool is_reliable = 2; |
| 50 } |
| 51 // Top n languages. Typically we just log the top language, but for page |
| 52 // that we're not confident about, we may log up to 3 top languages in |
| 53 // descending order. |
| 54 repeated Language detected_languages = 1; |
| 55 // Adopted language code is the code of final determined language. |
| 56 // It will be stored only if it's different from the first detected |
| 57 // language. |
| 58 optional string adopted_language_code = 2; |
| 59 } |
| 60 |
| 61 // User translated a page or interacted with translate suggestion. |
| 62 message Translation { |
| 63 // Source language of the translation. |
| 64 optional string from_language_code = 1; |
| 65 // Target language of the translation. |
| 66 optional string to_language_code = 2; |
| 67 enum Interaction { |
| 68 UNKNOWN = 0; |
| 69 ACCEPT = 1; |
| 70 DECLINE = 2; |
| 71 // This happens when user scroll or click outside the UI without |
| 72 // translation. |
| 73 IGNORED = 3; |
| 74 // This happens when user choose to close the translation window without |
| 75 // translation. |
| 76 DISMISSED = 4; |
| 77 // User manually entered either language. |
| 78 // In this case, from_language_code and to_language_code will be user |
| 79 // chosen values. |
| 80 MANUAL = 5; |
| 81 // User choose to revert the translation, in this case, from_language_code |
| 82 // and to_language_code will be previous chosen values. |
| 83 TRANSLATION_REVERTED = 6; |
| 84 // Automatically triggered translation. |
| 85 // User sets always translate in user settings. |
| 86 AUTO_TRANSLATION_BY_PREF = 7; |
| 87 // User navigated through a click from a translated page. |
| 88 AUTO_TRANSLATION_BY_LINK = 8; |
| 89 } |
| 90 optional Interaction interaction = 3; |
| 91 } |
| 92 |
90 oneof event { | 93 oneof event { |
91 Test test_event = 8; | 94 Test test_event = 8; |
92 FieldTrial field_trial_event = 9; | 95 FieldTrial field_trial_event = 9; |
93 LanguageDetection language_detection_event = 10; | 96 LanguageDetection language_detection_event = 10; |
94 Translation translation_event = 11; | 97 Translation translation_event = 11; |
95 } | 98 } |
96 } | 99 } |
OLD | NEW |