Chromium Code Reviews| Index: components/metrics/proto/translate_event.proto |
| diff --git a/components/metrics/proto/translate_event.proto b/components/metrics/proto/translate_event.proto |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1d20b312fcbb8ed9af272def63cfd06759c4bfdf |
| --- /dev/null |
| +++ b/components/metrics/proto/translate_event.proto |
| @@ -0,0 +1,135 @@ |
| +// Copyright 2016 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. |
| +// |
| +// Stores information about translate UI, translate Ranekr and user interaction. |
| + |
| +syntax = "proto2"; |
| + |
| +option optimize_for = LITE_RUNTIME; |
| +option java_outer_classname = "OmniboxEventProtos"; |
|
Roger McFarlane (Chromium)
2016/10/07 19:23:16
copy paste error?
hamelphi
2016/10/07 19:29:50
Done.
|
| +option java_package = "org.chromium.components.metrics"; |
| + |
| +package metrics; |
| + |
| +// Stores information about a single interaction between a user and |
| +// the Translate UI. Contains features used by Translate Ranker for |
| +// inference, information about the ranker model and its decision, as |
| +// well as user or automated feedback from the Translate UI. |
| +// Next tag: 14 |
| +message TranslateEventProto { |
| + // Language strings are two or three letter codes, with sometimes an extra |
| + // suffix (for e.g. chinese zh-TW or zh-CN). See |
| + // https://cs.chromium.org/chromium/src/components/translate/core/browser/translate_language_list.cc |
| + // for a list of supported languages. |
| + // Source language of the translation. |
| + optional string source_language = 1; |
| + // Target language of the translation. |
| + optional string target_language = 2; |
| + |
| + // The following counts are extracted from TranslatePrefs. |
| + // The number of times the user accepted a translation for the |
| + // source language. |
| + optional int32 accept_count = 3; |
| + // The number of times the user declined a translation for the |
| + // source language. |
| + optional int32 decline_count = 4; |
| + // The number of times the user ignored a translation for the source |
| + // language. |
| + optional int32 ignore_count = 5; |
| + |
| + // Language list from the language settings. These are languages the user |
| + // explicitly set in the language settings. |
| + repeated string language_list = 6; |
| + |
| + // The version of the translate ranker model. |
| + optional uint32 ranker_version = 7; |
| + |
| + // Timestamp of when the Ranker was queried, in seconds. |
| + // This value comes from Chromium's TimeTicks::Now(), which is an abstract |
| + // time value that is guaranteed to always be increasing (regardless of |
| + // Daylight Saving Time or any other changes to the system clock). |
| + // These numbers are only comparable within a session. To sequence events |
| + // across sessions, order by the |session_id| from the |
| + // ChromeUserMetricsExtension message. |
| + optional int64 ranker_request_timestamp_sec = 8; |
| + |
| + // The decision of translate ranker whether we should show the UI or not. |
| + enum RankerResponse { |
| + SHOW = 0; |
| + DONT_SHOW = 1; |
| + NOT_QUERIED = 2; |
| + } |
| + optional RankerResponse ranker_response = 9; |
| + |
| + // The action performed by the user in the translate UI. |
| + enum EventType { |
| + // The feedback event does not correspond to any of the enumerated |
| + // cases. |
| + UNKNOWN = 0; |
| + |
| + // User actions. |
| + // The user clicked 'Nope' in the UI. |
| + USER_DECLINE = 1; |
| + // The user clicked 'Translate' in the UI. |
| + USER_ACCEPT = 2; |
| + // The user explicitly closed the UI. |
| + USER_DISMISS = 3; |
| + // The user ignored the UI. |
| + USER_IGNORE = 4; |
| + // The user asked to never translate this source language. |
| + USER_NEVER_TRANSLATE_LANGUAGE = 5; |
| + // The user asked to never translate on this site. |
| + USER_NEVER_TRANSLATE_SITE = 6; |
| + // The user asked to always translate this source language. |
| + USER_ALWAYS_TRANSLATE_LANGUAGE = 7; |
| + // The user explicitly asked for a translation from the context menu. |
| + USER_CONTEXT_MENU_TRANSLATE = 8; |
| + // The user reverted the translation. |
| + USER_REVERT = 9; |
| + |
| + // Automated feedback. |
| + // An automatic translation was triggered. |
| + AUTOMATICALLY_TRANSLATED = 10; |
| + // The translation was not offered because translate is disabled |
| + // globally in the user preferences. |
| + DISABLED_BY_PREF = 11; |
| + // The translation was not offered because this language is |
| + // blacklisted in the user config. |
| + LANGUAGE_DISABLED_BY_USER_CONFIG = 12; |
| + // The translation was not offered because this language or URL is |
| + // blacklisted in the user config. |
| + URL_DISABLED_BY_USER_CONFIG = 13; |
| + // The translation was not offered because this language has been denied too |
| + // many times. |
| + LANGUAGE_DISABLED_BY_AUTO_BLACKLIST = 14; |
| + // The translation was not offered because Ranker dismissed it. |
| + DISABLED_BY_RANKER = 15; |
| + // The translation was not offered because the source or target |
| + // language is not supported. |
| + UNSUPPORTED_LANGUAGE = 16; |
| + // The translation was not offered because the URL is not |
| + // supported (e.g. New Tab Page). |
| + UNSUPPORTED_URL = 17; |
| + } |
| + |
| + // Feedback event received from translate UI. If several feedback are received |
|
Roger McFarlane (Chromium)
2016/10/07 19:21:00
s/Feedback event/Event/
s/If several feedback are/
hamelphi
2016/10/07 19:29:50
Done.
|
| + // in a given translate UI interaction, we only keep the last one. |
| + optional EventType feedback_event = 10; |
|
Roger McFarlane (Chromium)
2016/10/07 19:21:00
s/feedback_event/event_type/
hamelphi
2016/10/07 19:29:50
Done.
|
| + |
| + // The timestamp for the event, in seconds. |
| + // This value comes from Chromium's TimeTicks::Now(), which is an abstract |
| + // time value that is guaranteed to always be increasing (regardless of |
| + // Daylight Saving Time or any other changes to the system clock). |
| + // These numbers are only comparable within a session. To sequence events |
| + // across sessions, order by the |session_id| from the |
| + // ChromeUserMetricsExtension message. |
| + optional int64 feedback_timestamp_sec = 11; |
|
Roger McFarlane (Chromium)
2016/10/07 19:21:01
drop the feedback prefix?
hamelphi
2016/10/07 19:29:50
Done.
|
| + |
| + // Modified source language, if the user changed it. If changed more than |
| + // once, we only keep the last one. |
| + optional string modified_source_language = 12; |
| + // Modified target language, if the user changed it. If changed more than |
| + // once, we only keep the last one. |
| + optional string modified_target_language = 13; |
| +} |