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/language_detection_logging_helper.h" | 5 #include "components/translate/core/common/language_detection_logging_helper.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 specifics->set_navigation_id(navigation_id); | 24 specifics->set_navigation_id(navigation_id); |
25 | 25 |
26 sync_pb::LanguageDetection lang_detection; | 26 sync_pb::LanguageDetection lang_detection; |
27 auto* const lang = lang_detection.add_detected_languages(); | 27 auto* const lang = lang_detection.add_detected_languages(); |
28 lang->set_language_code(details.cld_language); | 28 lang->set_language_code(details.cld_language); |
29 lang->set_is_reliable(details.is_cld_reliable); | 29 lang->set_is_reliable(details.is_cld_reliable); |
30 // Only set adopted_language when it's different from cld_language. | 30 // Only set adopted_language when it's different from cld_language. |
31 if (details.adopted_language != details.cld_language) { | 31 if (details.adopted_language != details.cld_language) { |
32 lang_detection.set_adopted_language_code(details.adopted_language); | 32 lang_detection.set_adopted_language_code(details.adopted_language); |
33 } | 33 } |
34 *specifics->mutable_language_detection() = lang_detection; | 34 *specifics->mutable_language_detection_event() = lang_detection; |
35 return specifics; | 35 return specifics; |
36 } | 36 } |
37 | 37 |
38 } // namespace translate | 38 } // namespace translate |
OLD | NEW |