diff --git a/browser/atom_browser_client.cc b/browser/atom_browser_client.cc index ffe81f14d45d..1942479a96f9 100644 --- a/browser/atom_browser_client.cc +++ b/browser/atom_browser_client.cc @@ -4,13 +4,11 @@ #include "browser/atom_browser_client.h" -#include "base/command_line.h" #include "browser/atom_browser_context.h" #include "browser/atom_browser_main_parts.h" #include "browser/native_window.h" #include "browser/net/atom_url_request_context_getter.h" #include "browser/window_list.h" -#include "common/options_switches.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/site_instance.h" #include "content/public/browser/web_contents.h" @@ -105,10 +103,8 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches( window = *iter; } - // Append --node-integration to renderer process. if (window != NULL) - command_line->AppendSwitchASCII(switches::kNodeIntegration, - window->node_integration()); + window->AppendExtraCommandLineSwitches(command_line, child_process_id); dying_render_process_ = NULL; } diff --git a/browser/native_window.cc b/browser/native_window.cc index 83777397a958..f6172334ff8a 100644 --- a/browser/native_window.cc +++ b/browser/native_window.cc @@ -6,6 +6,7 @@ #include +#include "base/command_line.h" #include "base/file_util.h" #include "base/prefs/pref_service.h" #include "base/message_loop/message_loop.h" @@ -311,6 +312,13 @@ content::WebContents* NativeWindow::GetDevToolsWebContents() const { return inspectable_web_contents()->devtools_web_contents(); } +void NativeWindow::AppendExtraCommandLineSwitches(CommandLine* command_line, + int child_process_id) { + // Append --node-integration to renderer process. + command_line->AppendSwitchASCII(switches::kNodeIntegration, + node_integration_); +} + void NativeWindow::NotifyWindowClosed() { if (is_closed_) return; diff --git a/browser/native_window.h b/browser/native_window.h index af763ddb51e4..efd319cd7cad 100644 --- a/browser/native_window.h +++ b/browser/native_window.h @@ -19,6 +19,8 @@ #include "vendor/brightray/browser/inspectable_web_contents_delegate.h" #include "vendor/brightray/browser/inspectable_web_contents_impl.h" +class CommandLine; + namespace base { class DictionaryValue; class ListValue; @@ -160,6 +162,10 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate, content::WebContents* GetWebContents() const; content::WebContents* GetDevToolsWebContents() const; + // Called when renderer process is going to be started. + void AppendExtraCommandLineSwitches(CommandLine* command_line, + int child_process_id); + void AddObserver(NativeWindowObserver* obs) { observers_.AddObserver(obs); } @@ -169,7 +175,6 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate, } bool has_frame() const { return has_frame_; } - std::string node_integration() const { return node_integration_; } void set_has_dialog_attached(bool has_dialog_attached) { has_dialog_attached_ = has_dialog_attached;