Merge lp:~zaspire/oxide/navigator-language into lp:~oxide-developers/oxide/oxide.trunk

Proposed by Maxim Ermilov
Status: Merged
Merged at revision: 1016
Proposed branch: lp:~zaspire/oxide/navigator-language
Merge into: lp:~oxide-developers/oxide/oxide.trunk
Diff against target: 66 lines (+14/-0)
5 files modified
qt/core/browser/oxide_qt_browser_platform_integration.cc (+5/-0)
qt/core/browser/oxide_qt_browser_platform_integration.h (+1/-0)
shared/browser/oxide_browser_platform_integration.h (+2/-0)
shared/browser/oxide_content_browser_client.cc (+5/-0)
shared/browser/oxide_content_browser_client.h (+1/-0)
To merge this branch: bzr merge lp:~zaspire/oxide/navigator-language
Reviewer Review Type Date Requested Status
Chris Coulson Approve
Review via email: mp+253314@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Thanks, this looks fine.

I believe there might also be a second bug - in oxide::ContentMainDelegate::PreSandboxStartup we call ui::ResourceBundle::InitSharedInstanceWithLocale with an empty locale to rely on Chromium to select the correct locale (and load the right resource file, which is needed to get the correct Accept-Language header). But this only works when Chromium is built with the glib bits turned on, which I don't think we do anymore. If that's the case, we also need to pass the application locale to InitSharedInstanceWithLocale (it would mean adding a second method - PlatformDelegate::GetApplicationLocale - in addition to the one added in this merge).

Would you mind taking a look at that too?

review: Approve
Revision history for this message
Maxim Ermilov (zaspire) wrote :

> Would you mind taking a look at that too?

I will look at it

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qt/core/browser/oxide_qt_browser_platform_integration.cc'
2--- qt/core/browser/oxide_qt_browser_platform_integration.cc 2015-01-16 23:04:18 +0000
3+++ qt/core/browser/oxide_qt_browser_platform_integration.cc 2015-03-18 08:27:26 +0000
4@@ -140,6 +140,11 @@
5 }
6 }
7
8+std::string
9+BrowserPlatformIntegration::GetApplicationLocale() {
10+ return QLocale::system().name().toStdString();
11+}
12+
13 QThread* GetIOQThread() {
14 return g_io_thread.Get();
15 }
16
17=== modified file 'qt/core/browser/oxide_qt_browser_platform_integration.h'
18--- qt/core/browser/oxide_qt_browser_platform_integration.h 2014-11-14 14:36:14 +0000
19+++ qt/core/browser/oxide_qt_browser_platform_integration.h 2015-03-18 08:27:26 +0000
20@@ -56,6 +56,7 @@
21 void BrowserThreadInit(content::BrowserThread::ID id) final;
22 content::LocationProvider* CreateLocationProvider() final;
23 ApplicationState GetApplicationState() final;
24+ std::string GetApplicationLocale() final;
25
26 scoped_refptr<GLContextAdopted> gl_share_context_;
27
28
29=== modified file 'shared/browser/oxide_browser_platform_integration.h'
30--- shared/browser/oxide_browser_platform_integration.h 2014-11-14 14:31:59 +0000
31+++ shared/browser/oxide_browser_platform_integration.h 2015-03-18 08:27:26 +0000
32@@ -71,6 +71,8 @@
33
34 virtual ApplicationState GetApplicationState();
35
36+ virtual std::string GetApplicationLocale() = 0;
37+
38 protected:
39 BrowserPlatformIntegration();
40
41
42=== modified file 'shared/browser/oxide_content_browser_client.cc'
43--- shared/browser/oxide_content_browser_client.cc 2015-03-05 11:39:38 +0000
44+++ shared/browser/oxide_content_browser_client.cc 2015-03-18 08:27:26 +0000
45@@ -388,4 +388,9 @@
46 return gpu::GpuControlList::kOsAndroid;
47 }
48
49+std::string
50+ContentBrowserClient::GetApplicationLocale() {
51+ return platform_integration_->GetApplicationLocale();
52+}
53+
54 } // namespace oxide
55
56=== modified file 'shared/browser/oxide_content_browser_client.h'
57--- shared/browser/oxide_content_browser_client.h 2015-03-05 11:39:38 +0000
58+++ shared/browser/oxide_content_browser_client.h 2015-03-18 08:27:26 +0000
59@@ -55,6 +55,7 @@
60 void SetPlatformIntegration(BrowserPlatformIntegration* integration);
61
62 // content::ContentBrowserClient implementation
63+ std::string GetApplicationLocale() final;
64 content::BrowserMainParts* CreateBrowserMainParts(
65 const content::MainFunctionParams& parameters) final;
66 void RenderProcessWillLaunch(content::RenderProcessHost* host) final;

Subscribers

People subscribed via source and target branches