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

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: Change based on 8/3 design review and simplified the use of ULP 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..9ecce6c71c2771f358da9b4c5a6fe33b2987ddfc 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,16 @@ class TranslatePrefs {
bool ShouldAutoTranslate(const std::string& original_language,
std::string* target_language);
+ // Language and probability pair.
+ typedef std::pair<std::string, double> LanguageAndProbability;
+ typedef std::vector<LanguageAndProbability> LanguageAndProbabilityList;
+
+ // Output the User Profile Profile's (ULP) "reading list" into |list| as
+ // ordered list of <string, double> pair. Return the confidence of the list
groby-ooo-7-16 2016/08/04 02:33:43 What is the list ordered by? I assume the double?
ftang 2016/08/05 04:45:28 Done.
+ // or 0.0 if there no ULP "reading list".
+ virtual double GetReadingFromUserLanguageProfile(
groby-ooo-7-16 2016/08/04 02:33:42 Please don't make this virtual (relates to the "no
ftang 2016/08/05 04:45:28 Done.
+ 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