Only init WMState on Linux.

This commit is contained in:
Cheng Zhao 2014-07-09 20:05:02 +08:00
parent a0ee4a9bf1
commit 739b352de6
2 changed files with 7 additions and 2 deletions

View file

@ -17,11 +17,11 @@
#if defined(USE_AURA) && defined(USE_X11)
#include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
#include "ui/views/linux_ui/linux_ui.h"
#include "ui/wm/core/wm_state.h"
#endif
#if defined(TOOLKIT_VIEWS)
#include "browser/views/views_delegate.h"
#include "ui/wm/core/wm_state.h"
#endif
namespace brightray {
@ -45,11 +45,11 @@ void BrowserMainParts::PreEarlyInitialization() {
void BrowserMainParts::ToolkitInitialized() {
#if defined(USE_AURA) && defined(USE_X11)
views::LinuxUI::instance()->Initialize();
wm_state_.reset(new wm::WMState);
#endif
#if defined(TOOLKIT_VIEWS)
views_delegate_.reset(new ViewsDelegate);
wm_state_.reset(new wm::WMState);
#endif
}

View file

@ -13,7 +13,9 @@
namespace brightray {
class ViewsDelegate;
}
#endif
#if defined(USE_AURA) && defined(USE_X11)
namespace wm {
class WMState;
}
@ -58,6 +60,9 @@ class BrowserMainParts : public content::BrowserMainParts {
#if defined(TOOLKIT_VIEWS)
scoped_ptr<ViewsDelegate> views_delegate_;
#endif
#if defined(USE_AURA) && defined(USE_X11)
scoped_ptr<wm::WMState> wm_state_;
#endif