diff --git a/atom/browser/atom_browser_main_parts.cc b/atom/browser/atom_browser_main_parts.cc index 24c4c7b31c27..8cccac09931f 100644 --- a/atom/browser/atom_browser_main_parts.cc +++ b/atom/browser/atom_browser_main_parts.cc @@ -37,6 +37,8 @@ #if defined(OS_MACOSX) #include "atom/browser/ui/cocoa/views_delegate_mac.h" +#else +#include "brightray/browser/views/views_delegate.h" #endif // Must be included after all other headers. @@ -181,6 +183,8 @@ void AtomBrowserMainParts::ToolkitInitialized() { brightray::BrowserMainParts::ToolkitInitialized(); #if defined(OS_MACOSX) views_delegate_.reset(new ViewsDelegateMac); +#else + views_delegate_.reset(new brightray::ViewsDelegate); #endif } diff --git a/atom/browser/atom_browser_main_parts.h b/atom/browser/atom_browser_main_parts.h index ff81a7c3b5cd..129ad2d86876 100644 --- a/atom/browser/atom_browser_main_parts.h +++ b/atom/browser/atom_browser_main_parts.h @@ -15,6 +15,12 @@ class BrowserProcess; +#if defined(TOOLKIT_VIEWS) +namespace brightray { +class ViewsDelegate; +} +#endif + namespace atom { class AtomBindings; @@ -76,6 +82,8 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts { #if defined(OS_MACOSX) std::unique_ptr views_delegate_; +#else + std::unique_ptr views_delegate_; #endif // A fake BrowserProcess object that used to feed the source code from chrome. diff --git a/brightray/browser/browser_main_parts.cc b/brightray/browser/browser_main_parts.cc index 4006d96c9f04..4705abc98666 100644 --- a/brightray/browser/browser_main_parts.cc +++ b/brightray/browser/browser_main_parts.cc @@ -43,10 +43,6 @@ #include "ui/wm/core/wm_state.h" #endif -#if defined(TOOLKIT_VIEWS) -#include "brightray/browser/views/views_delegate.h" -#endif - #if defined(USE_X11) #include "base/environment.h" #include "base/nix/xdg_util.h" @@ -209,10 +205,6 @@ void BrowserMainParts::ToolkitInitialized() { wm_state_.reset(new wm::WMState); #endif -#if defined(TOOLKIT_VIEWS) - views_delegate_.reset(new ViewsDelegate); -#endif - #if defined(OS_WIN) gfx::PlatformFontWin::adjust_font_callback = &AdjustUIFont; gfx::PlatformFontWin::get_minimum_font_size_callback = &GetMinimumFontSize; diff --git a/brightray/browser/browser_main_parts.h b/brightray/browser/browser_main_parts.h index 2a31027431b9..217333985364 100644 --- a/brightray/browser/browser_main_parts.h +++ b/brightray/browser/browser_main_parts.h @@ -16,12 +16,6 @@ #include "content/public/browser/browser_main_parts.h" #include "ui/views/layout/layout_provider.h" -#if defined(TOOLKIT_VIEWS) -namespace brightray { -class ViewsDelegate; -} -#endif - #if defined(USE_AURA) namespace wm { class WMState; @@ -56,10 +50,6 @@ class BrowserMainParts : public content::BrowserMainParts { std::unique_ptr io_thread_; -#if defined(TOOLKIT_VIEWS) - std::unique_ptr views_delegate_; -#endif - #if defined(USE_AURA) std::unique_ptr wm_state_; #endif