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

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

Issue 2890843003: Simplify TranslateRanker API. (Closed)
Patch Set: Rebase 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 fa3eb4b3936f215a1e6946ce71b15fcc7bec7c55..abbed4d50c1a67b987836d59f72f97ef16ae8ec0 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.
« no previous file with comments | « components/translate/core/browser/translate_ranker.h ('k') | components/translate/core/browser/translate_ranker_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698