chrome: Support configuration of accept language (see issue #2969)

This change adds support for CEF settings configuration of accept_language_list.
If specified, this value will take precedence over the "intl.accept_languages"
preference which is controlled by chrome://settings/languages.
This commit is contained in:
Marshall Greenblatt
2021-04-28 13:12:06 -04:00
parent c03a6f4386
commit 3ab91a45c9
7 changed files with 81 additions and 48 deletions

View File

@@ -11,6 +11,8 @@ namespace base {
class FilePath;
}
class CefBrowserContext;
class CefBrowserHostBase;
class PrefRegistrySimple;
class PrefService;
class Profile;
@@ -29,8 +31,12 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
const base::FilePath& cache_path,
bool persist_user_preferences);
// Set language preferences on |profile|.
void SetLanguagePrefs(Profile* profile);
// Returns the value for populating the accept-language HTTP request header.
// |browser_context| and/or |browser| may be nullptr. If |expand| is true then
// base languages and Q values may be added.
std::string GetAcceptLanguageList(CefBrowserContext* browser_context,
CefBrowserHostBase* browser,
bool expand);
} // namespace browser_prefs