Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(909)

Unified Diff: components/translate/core/browser/translate_ranker_impl.h

Issue 2890843003: Simplify TranslateRanker API. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/translate/core/browser/translate_ranker_impl.h
diff --git a/components/translate/core/browser/translate_ranker_impl.h b/components/translate/core/browser/translate_ranker_impl.h
index d4f461e52e3d0c73aef460ce51c7974fe8e87433..4fbda3da7ad255d44702767b8ec5cd089e887d53 100644
--- a/components/translate/core/browser/translate_ranker_impl.h
+++ b/components/translate/core/browser/translate_ranker_impl.h
@@ -34,8 +34,6 @@ class TranslateEventProto;
namespace translate {
-class TranslatePrefs;
-
// Features used to enable ranker query, enforcement and logging. Note that
// enabling enforcement implies (forces) enabling queries.
extern const base::Feature kTranslateRankerQuery;
@@ -53,10 +51,7 @@ struct TranslateRankerFeatures {
const std::string& cntry,
const std::string& locale);
- TranslateRankerFeatures(const TranslatePrefs& prefs,
- const std::string& src,
- const std::string& dst,
- const std::string& locale);
+ TranslateRankerFeatures(const metrics::TranslateEventProto& tep);
~TranslateRankerFeatures();
@@ -101,9 +96,6 @@ class TranslateRankerImpl : public TranslateRanker {
// TranslateRanker...
uint32_t GetModelVersion() const override;
bool ShouldOfferTranslation(
- const TranslatePrefs& translate_prefs,
- const std::string& src_lang,
- const std::string& dst_lang,
metrics::TranslateEventProto* translate_event) override;
void FlushTranslateEvents(
std::vector<metrics::TranslateEventProto>* events) override;
@@ -120,8 +112,8 @@ class TranslateRankerImpl : public TranslateRanker {
std::unique_ptr<chrome_intelligence::RankerModel> model);
// Get the model decision on whether we should show the translate
- // UI or not given |features|.
- bool GetModelDecision(const TranslateRankerFeatures& features);
+ // UI or not given |translate_event|.
+ bool GetModelDecision(const metrics::TranslateEventProto& translate_event);
// Check if the ModelLoader has been initialized. Used to test ModelLoader
// logic.

Powered by Google App Engine
This is Rietveld 408576698