| 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 #include "components/translate/core/common/translation_logging_helper.h" | 5 #include "components/translate/core/common/translation_logging_helper.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "components/metrics/proto/translate_event.pb.h" | 9 #include "components/metrics/proto/translate_event.pb.h" |
| 10 #include "components/sync/protocol/user_event_specifics.pb.h" | 10 #include "components/sync/protocol/user_event_specifics.pb.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 break; | 53 break; |
| 54 case TranslateEventProto::USER_IGNORE: | 54 case TranslateEventProto::USER_IGNORE: |
| 55 translation->set_interaction(sync_pb::Translation::IGNORED); | 55 translation->set_interaction(sync_pb::Translation::IGNORED); |
| 56 break; | 56 break; |
| 57 case TranslateEventProto::USER_DISMISS: | 57 case TranslateEventProto::USER_DISMISS: |
| 58 translation->set_interaction(sync_pb::Translation::DISMISSED); | 58 translation->set_interaction(sync_pb::Translation::DISMISSED); |
| 59 break; | 59 break; |
| 60 case TranslateEventProto::USER_REVERT: | 60 case TranslateEventProto::USER_REVERT: |
| 61 translation->set_interaction(sync_pb::Translation::TRANSLATION_REVERTED); | 61 translation->set_interaction(sync_pb::Translation::TRANSLATION_REVERTED); |
| 62 break; | 62 break; |
| 63 case TranslateEventProto::AUTOMATICALLY_TRANSLATED: | 63 case TranslateEventProto::AUTO_TRANSLATION_BY_PREF: |
| 64 translation->set_interaction(sync_pb::Translation::AUTOMATIC_TRANSLATION); | 64 translation->set_interaction( |
| 65 sync_pb::Translation::AUTO_TRANSLATION_BY_PREF); |
| 66 break; |
| 67 case TranslateEventProto::AUTO_TRANSLATION_BY_LINK: |
| 68 translation->set_interaction( |
| 69 sync_pb::Translation::AUTO_TRANSLATION_BY_LINK); |
| 65 break; | 70 break; |
| 66 default: // We don't care about other events. | 71 default: // We don't care about other events. |
| 67 return false; | 72 return false; |
| 68 } | 73 } |
| 69 return true; | 74 return true; |
| 70 } | 75 } |
| 71 } // namespace translate | 76 } // namespace translate |
| OLD | NEW |