OLD | NEW |
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 int GetTranslationAcceptedCount(const std::string& language); | 88 int GetTranslationAcceptedCount(const std::string& language); |
89 void IncrementTranslationAcceptedCount(const std::string& language); | 89 void IncrementTranslationAcceptedCount(const std::string& language); |
90 void ResetTranslationAcceptedCount(const std::string& language); | 90 void ResetTranslationAcceptedCount(const std::string& language); |
91 | 91 |
92 // Update the last time on closing the Translate UI without translation. | 92 // Update the last time on closing the Translate UI without translation. |
93 void UpdateLastDeniedTime(); | 93 void UpdateLastDeniedTime(); |
94 | 94 |
95 // Returns true if translation is denied too often. | 95 // Returns true if translation is denied too often. |
96 bool IsTooOftenDenied() const; | 96 bool IsTooOftenDenied() const; |
97 | 97 |
| 98 // Resets the prefs of denial state. Only used internally for diagnostics. |
| 99 void ResetDenialState(); |
| 100 |
98 // Gets the language list of the language settings. | 101 // Gets the language list of the language settings. |
99 void GetLanguageList(std::vector<std::string>* languages); | 102 void GetLanguageList(std::vector<std::string>* languages); |
100 | 103 |
101 // Updates the language list of the language settings. | 104 // Updates the language list of the language settings. |
102 void UpdateLanguageList(const std::vector<std::string>& languages); | 105 void UpdateLanguageList(const std::vector<std::string>& languages); |
103 | 106 |
104 bool CanTranslateLanguage(TranslateAcceptLanguages* accept_languages, | 107 bool CanTranslateLanguage(TranslateAcceptLanguages* accept_languages, |
105 const std::string& language); | 108 const std::string& language); |
106 bool ShouldAutoTranslate(const std::string& original_language, | 109 bool ShouldAutoTranslate(const std::string& original_language, |
107 std::string* target_language); | 110 std::string* target_language); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // Retrieves the dictionary mapping the number of times translation has been | 156 // Retrieves the dictionary mapping the number of times translation has been |
154 // accepted for a language, creating it if necessary. | 157 // accepted for a language, creating it if necessary. |
155 base::DictionaryValue* GetTranslationAcceptedCountDictionary() const; | 158 base::DictionaryValue* GetTranslationAcceptedCountDictionary() const; |
156 | 159 |
157 PrefService* prefs_; // Weak. | 160 PrefService* prefs_; // Weak. |
158 | 161 |
159 DISALLOW_COPY_AND_ASSIGN(TranslatePrefs); | 162 DISALLOW_COPY_AND_ASSIGN(TranslatePrefs); |
160 }; | 163 }; |
161 | 164 |
162 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_ | 165 #endif // COMPONENTS_TRANSLATE_CORE_BROWSER_TRANSLATE_PREFS_H_ |
OLD | NEW |