From 83b36ce40b6dc85f54a917af3193a1ab11523c19 Mon Sep 17 00:00:00 2001 From: Eran Tiktin Date: Sat, 16 Jan 2016 06:27:44 +0200 Subject: [PATCH] Add API for checking if AeroGlass/DWM is enabled Resolves #1020 --- atom/browser/api/atom_api_app.cc | 8 ++++++++ atom/browser/api/atom_api_app.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 256ecff53..b0c87064e 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -37,6 +37,7 @@ #if defined(OS_WIN) #include "base/strings/utf_string_conversions.h" +#include "ui/base/win/shell.h" #endif using atom::Browser; @@ -318,6 +319,12 @@ std::string App::GetLocale() { return l10n_util::GetApplicationLocale(""); } +#if defined(OS_WIN) +bool App::IsAeroGlassEnabled() { + return ui::win::IsAeroGlassEnabled(); +} +#endif + bool App::MakeSingleInstance( const ProcessSingleton::NotificationCallback& callback) { if (process_singleton_.get()) @@ -361,6 +368,7 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder( #if defined(OS_WIN) .SetMethod("setUserTasks", base::Bind(&Browser::SetUserTasks, browser)) + .SetMethod("isAeroGlassEnabled", &App::IsAeroGlassEnabled) #endif .SetMethod("setPath", &App::SetPath) .SetMethod("getPath", &App::GetPath) diff --git a/atom/browser/api/atom_api_app.h b/atom/browser/api/atom_api_app.h index a6f99d65e..c59b9154d 100644 --- a/atom/browser/api/atom_api_app.h +++ b/atom/browser/api/atom_api_app.h @@ -88,6 +88,10 @@ class App : public AtomBrowserClient::Delegate, const ProcessSingleton::NotificationCallback& callback); std::string GetLocale(); +#if defined(OS_WIN) + bool IsAeroGlassEnabled(); +#endif + scoped_ptr process_singleton_; DISALLOW_COPY_AND_ASSIGN(App);