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

Side by Side Diff: components/translate/core/browser/translate_prefs.h

Issue 1525203003: [Translate] Factor out access to Accept-Languages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@translate-manager-unit
Patch Set: Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_PREFS_H_ 5 #ifndef COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_
6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_ 6 #define COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 // Returns true if translation is denied too often. 128 // Returns true if translation is denied too often.
129 bool IsTooOftenDenied(const std::string& language) const; 129 bool IsTooOftenDenied(const std::string& language) const;
130 130
131 // Resets the prefs of denial state. Only used internally for diagnostics. 131 // Resets the prefs of denial state. Only used internally for diagnostics.
132 void ResetDenialState(); 132 void ResetDenialState();
133 133
134 // Gets the language list of the language settings. 134 // Gets the language list of the language settings.
135 void GetLanguageList(std::vector<std::string>* languages); 135 void GetLanguageList(std::vector<std::string>* languages);
136 136
137 // Gets the list of accept-languages. This differs from GetLanguageList only
138 // on ChromeOS.
139 void GetAcceptLanguageList(std::vector<std::string>* languages) const;
140
137 // Updates the language list of the language settings. 141 // Updates the language list of the language settings.
138 void UpdateLanguageList(const std::vector<std::string>& languages); 142 void UpdateLanguageList(const std::vector<std::string>& languages);
139 143
140 bool CanTranslateLanguage(TranslateAcceptLanguages* accept_languages, 144 bool CanTranslateLanguage(TranslateAcceptLanguages* accept_languages,
141 const std::string& language); 145 const std::string& language);
142 bool ShouldAutoTranslate(const std::string& original_language, 146 bool ShouldAutoTranslate(const std::string& original_language,
143 std::string* target_language); 147 std::string* target_language);
144 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 148 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
145 static void MigrateUserPrefs(PrefService* user_prefs, 149 static void MigrateUserPrefs(PrefService* user_prefs,
146 const char* accept_languages_pref); 150 const char* accept_languages_pref);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 base::DictionaryValue* GetTranslationAcceptedCountDictionary() const; 189 base::DictionaryValue* GetTranslationAcceptedCountDictionary() const;
186 190
187 PrefService* prefs_; // Weak. 191 PrefService* prefs_; // Weak.
188 192
189 DISALLOW_COPY_AND_ASSIGN(TranslatePrefs); 193 DISALLOW_COPY_AND_ASSIGN(TranslatePrefs);
190 }; 194 };
191 195
192 } // namespace translate 196 } // namespace translate
193 197
194 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_ 198 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698