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

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: Fix CrOS build 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // Update the last time on closing the Translate UI without translation. 125 // Update the last time on closing the Translate UI without translation.
126 void UpdateLastDeniedTime(const std::string& language); 126 void UpdateLastDeniedTime(const std::string& language);
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) const;
136 136
137 // Updates the language list of the language settings. 137 // Updates the language list of the language settings.
138 void UpdateLanguageList(const std::vector<std::string>& languages); 138 void UpdateLanguageList(const std::vector<std::string>& languages);
139 139
140 bool CanTranslateLanguage(TranslateAcceptLanguages* accept_languages, 140 bool CanTranslateLanguage(TranslateAcceptLanguages* accept_languages,
141 const std::string& language); 141 const std::string& language);
142 bool ShouldAutoTranslate(const std::string& original_language, 142 bool ShouldAutoTranslate(const std::string& original_language,
143 std::string* target_language); 143 std::string* target_language);
144 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 144 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
145 static void MigrateUserPrefs(PrefService* user_prefs, 145 static void MigrateUserPrefs(PrefService* user_prefs,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 base::DictionaryValue* GetTranslationAcceptedCountDictionary() const; 185 base::DictionaryValue* GetTranslationAcceptedCountDictionary() const;
186 186
187 PrefService* prefs_; // Weak. 187 PrefService* prefs_; // Weak.
188 188
189 DISALLOW_COPY_AND_ASSIGN(TranslatePrefs); 189 DISALLOW_COPY_AND_ASSIGN(TranslatePrefs);
190 }; 190 };
191 191
192 } // namespace translate 192 } // namespace translate
193 193
194 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_ 194 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_
OLDNEW
« no previous file with comments | « components/translate/core/browser/translate_manager_unittest.cc ('k') | components/translate/core/browser/translate_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698