Chromium Code Reviews| Index: android_webview/browser/aw_content_browser_client.cc |
| diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc |
| index 1c4d632809046c9076e1376f1f5da88316c23bb1..aa0e36b2d1157fffa36527782cb8eade7e5d6caf 100644 |
| --- a/android_webview/browser/aw_content_browser_client.cc |
| +++ b/android_webview/browser/aw_content_browser_client.cc |
| @@ -9,6 +9,7 @@ |
| #include "android_webview/browser/aw_contents_client_bridge_base.h" |
| #include "android_webview/browser/aw_contents_io_thread_client.h" |
| #include "android_webview/browser/aw_cookie_access_policy.h" |
| +#include "android_webview/browser/aw_locale_manager.h" |
| #include "android_webview/browser/aw_printing_message_filter.h" |
| #include "android_webview/browser/aw_quota_permission_context.h" |
| #include "android_webview/browser/aw_web_preferences_populater.h" |
| @@ -138,11 +139,14 @@ class AwAccessTokenStore : public content::AccessTokenStore { |
| DISALLOW_COPY_AND_ASSIGN(AwAccessTokenStore); |
| }; |
| +AwLocaleManager* g_locale_manager = NULL; |
|
Torne
2015/07/17 13:33:18
This should be a scoped_ptr belonging to AwContent
ctserng
2015/07/17 16:51:14
Ok, the reason its global is to access it through
|
| + |
| } // anonymous namespace |
| +// static |
| std::string AwContentBrowserClient::GetAcceptLangsImpl() { |
| - // Start with the currnet locale. |
| - std::string langs = base::android::GetDefaultLocale(); |
| + // Start with the current locale. |
| + std::string langs = g_locale_manager->GetLocale(); |
| // If we're not en-US, add in en-US which will be |
| // used with a lower q-value. |
| @@ -152,6 +156,7 @@ std::string AwContentBrowserClient::GetAcceptLangsImpl() { |
| return langs; |
| } |
| +// static |
| AwBrowserContext* AwContentBrowserClient::GetAwBrowserContext() { |
| return AwBrowserContext::GetDefault(); |
| } |
| @@ -165,9 +170,12 @@ AwContentBrowserClient::AwContentBrowserClient( |
| } |
| browser_context_.reset( |
| new AwBrowserContext(user_data_dir, native_factory_)); |
| + g_locale_manager = native_factory->CreateAwLocaleManager(); |
| } |
| AwContentBrowserClient::~AwContentBrowserClient() { |
| + delete g_locale_manager; |
| + g_locale_manager = NULL; |
| } |
| void AwContentBrowserClient::AddCertificate(net::CertificateMimeType cert_type, |