linux: Add "dark-theme" option for BrowserWindow, fixes #352.

This commit is contained in:
Cheng Zhao 2014-08-21 12:24:55 +08:00
parent a32669ac0d
commit 058d0bbe19
4 changed files with 19 additions and 0 deletions

View file

@ -150,6 +150,19 @@ NativeWindowViews::NativeWindowViews(content::WebContents* web_contents,
window_->Init(params);
#if defined(USE_X11)
bool use_dark_theme = false;
if (options.Get(switches::kDarkTheme, &use_dark_theme) && use_dark_theme) {
XDisplay* xdisplay = gfx::GetXDisplay();
XChangeProperty(xdisplay, GetAcceleratedWidget(),
XInternAtom(xdisplay, "_GTK_THEME_VARIANT", False),
XInternAtom(xdisplay, "UTF8_STRING", False),
8, PropModeReplace,
reinterpret_cast<const unsigned char*>("dark"),
4);
}
#endif
// Add web view.
SetLayoutManager(new MenuLayout(kMenuBarHeight));
set_background(views::Background::CreateStandardPanelBackground());