First hack at setting the window icon overlay
authorPaul Betts <paul@paulbetts.org>
Fri, 6 Feb 2015 23:58:49 +0000 (15:58 -0800)
committerPaul Betts <paul@paulbetts.org>
Fri, 6 Feb 2015 23:58:49 +0000 (15:58 -0800)
atom/browser/native_window_views.cc
atom/browser/native_window_views.h

index 09fd351..db4090b 100644 (file)
@@ -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<ITaskbarList3> 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;
 }
index 2066d4e..e5fb863 100644 (file)
@@ -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;