2020
2121#include " content/nw/src/shell_content_browser_client.h"
2222
23+ #include " base/command_line.h"
2324#include " base/file_path.h"
2425#include " base/file_util.h"
2526#include " base/threading/thread_restrictions.h"
2627#include " content/public/browser/browser_url_handler.h"
2728#include " content/public/browser/render_process_host.h"
2829#include " content/public/browser/resource_dispatcher_host.h"
30+ #include " content/nw/src/common/shell_switches.h"
2931#include " content/nw/src/browser/shell_devtools_delegate.h"
3032#include " content/nw/src/browser/shell_resource_dispatcher_host_delegate.h"
3133#include " content/nw/src/media/media_internals.h"
34+ #include " content/nw/src/nw_package.h"
3235#include " content/nw/src/shell.h"
3336#include " content/nw/src/shell_browser_context.h"
3437#include " content/nw/src/shell_browser_main_parts.h"
3538#include " geolocation/shell_access_token_store.h"
3639#include " googleurl/src/gurl.h"
3740#include " webkit/glue/webpreferences.h"
41+ #include " ui/base/l10n/l10n_util.h"
3842
3943namespace content {
4044
@@ -57,6 +61,23 @@ void ShellContentBrowserClient::RenderProcessHostCreated(
5761 render_process_id_ = host->GetID ();
5862}
5963
64+ std::string ShellContentBrowserClient::GetApplicationLocale () {
65+ return l10n_util::GetApplicationLocale (" en-US" );
66+ }
67+
68+ void ShellContentBrowserClient::AppendExtraCommandLineSwitches (
69+ CommandLine* command_line,
70+ int child_process_id) {
71+ if (nw::GetManifest () && nw::GetUseNode ()) {
72+ // Allow node.js
73+ command_line->AppendSwitch (switches::kmNodejs);
74+
75+ // Set cwd
76+ command_line->AppendSwitchPath (switches::kWorkingDirectory ,
77+ nw::GetPackageRoot ());
78+ }
79+ }
80+
6081void ShellContentBrowserClient::ResourceDispatcherHostCreated () {
6182 resource_dispatcher_host_delegate_.reset (
6283 new ShellResourceDispatcherHostDelegate ());
0 commit comments