| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_ | 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_ |
| 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_ | 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // Returns true if translate events logging is enabled. | 29 // Returns true if translate events logging is enabled. |
| 30 virtual bool IsLoggingEnabled() = 0; | 30 virtual bool IsLoggingEnabled() = 0; |
| 31 | 31 |
| 32 // Returns true if enforcement is enabled. | 32 // Returns true if enforcement is enabled. |
| 33 virtual bool IsEnforcementEnabled() = 0; | 33 virtual bool IsEnforcementEnabled() = 0; |
| 34 | 34 |
| 35 // Returns true if querying is enabled. Enabling enforcement will | 35 // Returns true if querying is enabled. Enabling enforcement will |
| 36 // automatically enable Query. | 36 // automatically enable Query. |
| 37 virtual bool IsQueryEnabled() = 0; | 37 virtual bool IsQueryEnabled() = 0; |
| 38 | 38 |
| 39 // Returns true if heuristic decisions should be overriden. |
| 40 virtual bool IsDecisionOverrideEnabled() = 0; |
| 41 |
| 39 // Returns the version id for the ranker model. | 42 // Returns the version id for the ranker model. |
| 40 virtual int GetModelVersion() const = 0; | 43 virtual int GetModelVersion() const = 0; |
| 41 | 44 |
| 42 // Returns true if executing the ranker model in the translation prompt | 45 // Returns true if executing the ranker model in the translation prompt |
| 43 // context described by |translate_prefs|, |src_lang|, |dst_lang| and possibly | 46 // context described by |translate_prefs|, |src_lang|, |dst_lang| and possibly |
| 44 // other global browser context attributes suggests that the user should be | 47 // other global browser context attributes suggests that the user should be |
| 45 // prompted as to whether translation should be performed. | 48 // prompted as to whether translation should be performed. |
| 46 virtual bool ShouldOfferTranslation(const TranslatePrefs& translate_prefs, | 49 virtual bool ShouldOfferTranslation(const TranslatePrefs& translate_prefs, |
| 47 const std::string& src_lang, | 50 const std::string& src_lang, |
| 48 const std::string& dst_lang) = 0; | 51 const std::string& dst_lang) = 0; |
| 49 | 52 |
| 50 // Caches the translate event. | 53 // Caches the translate event. |
| 51 virtual void AddTranslateEvent( | 54 virtual void AddTranslateEvent( |
| 52 const metrics::TranslateEventProto& translate_event) = 0; | 55 const metrics::TranslateEventProto& translate_event) = 0; |
| 53 | 56 |
| 54 // Transfers cached translate events to the given vector pointer and clears | 57 // Transfers cached translate events to the given vector pointer and clears |
| 55 // the cache. | 58 // the cache. |
| 56 virtual void FlushTranslateEvents( | 59 virtual void FlushTranslateEvents( |
| 57 std::vector<metrics::TranslateEventProto>* events) = 0; | 60 std::vector<metrics::TranslateEventProto>* events) = 0; |
| 58 | 61 |
| 59 private: | 62 private: |
| 60 DISALLOW_COPY_AND_ASSIGN(TranslateRanker); | 63 DISALLOW_COPY_AND_ASSIGN(TranslateRanker); |
| 61 }; | 64 }; |
| 62 | 65 |
| 63 } // namespace translate | 66 } // namespace translate |
| 64 | 67 |
| 65 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_ | 68 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_RANKER_H_ |
| OLD | NEW |