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

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

Issue 2200493002: using ulp to improve TranslateManager GetTargetLanguage() and InitiateTranslation() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix global state problem in unittests Created 4 years, 4 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_prefs.h
diff --git a/components/translate/core/browser/translate_prefs.h b/components/translate/core/browser/translate_prefs.h
index d03e2590061debcd9317873d50af269330d1de37..8a34621be00b329392259b5aa9b4a25b60944f89 100644
--- a/components/translate/core/browser/translate_prefs.h
+++ b/components/translate/core/browser/translate_prefs.h
@@ -78,6 +78,7 @@ class DenialTimeUpdate {
// It is assumed that |prefs_| is alive while this instance is alive.
class TranslatePrefs {
public:
+ static const char kPrefLanguageProfile[];
static const char kPrefTranslateSiteBlacklist[];
static const char kPrefTranslateWhitelists[];
static const char kPrefTranslateDeniedCount[];
@@ -165,6 +166,17 @@ class TranslatePrefs {
bool ShouldAutoTranslate(const std::string& original_language,
std::string* target_language);
+ // Language and probability pair.
+ typedef std::pair<std::string, double> LanguageAndProbability;
Lei Zhang 2016/11/17 07:03:28 nit: using LanguageAndProbability = std::pair... i
+ typedef std::vector<LanguageAndProbability> LanguageAndProbabilityList;
+
+ // Output the User Profile Profile's (ULP) "reading list" into |list| as
+ // ordered list of <string, double> pair, sorted by the double in decreasing
+ // order. Return the confidence of the list or 0.0 if there no ULP "reading
+ // list".
+ double GetReadingFromUserLanguageProfile(
+ LanguageAndProbabilityList* list) const;
+
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
static void MigrateUserPrefs(PrefService* user_prefs,
const char* accept_languages_pref);

Powered by Google App Engine
This is Rietveld 408576698