diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 09fd351f4277..db4090b269a9 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -613,6 +613,22 @@ void NativeWindowViews::SetProgressBar(double progress) { #endif } +void NativeWindowViews::SetOverlayIcon(gfx::ImageSkia& overlay, std::string& description) { +#if defined(OS_WIN) + if (base::win::GetVersion() < base::win::VERSION_WIN7) + return; + + base::win::ScopedComPtr taskbar; + if (FAILED(taskbar.CreateInstance(CLSID_TaskbarList, NULL, + CLSCTX_INPROC_SERVER) || + FAILED(taskbar->HrInit()))) { + return; + } + HWND frame = views::HWNDForNativeWindow(GetNativeWindow()); + taskbar->SetOverlayIcon(frame, IconUtil::CreateHICONFromSkiaBitmap(overlay.AsBitmap()), description); +#endif +} + void NativeWindowViews::SetAutoHideMenuBar(bool auto_hide) { menu_bar_autohide_ = auto_hide; } diff --git a/atom/browser/native_window_views.h b/atom/browser/native_window_views.h index 2066d4e603d1..e5fb86328358 100644 --- a/atom/browser/native_window_views.h +++ b/atom/browser/native_window_views.h @@ -73,6 +73,7 @@ class NativeWindowViews : public NativeWindow, bool IsKiosk() override; void SetMenu(ui::MenuModel* menu_model) override; gfx::NativeWindow GetNativeWindow() override; + void SetOverlayIcon(gfx::ImageSkia& overlay, std::string& description) override; void SetProgressBar(double value) override; void SetAutoHideMenuBar(bool auto_hide) override; bool IsMenuBarAutoHide() override;