First hack at setting the window icon overlay

This commit is contained in:
Paul Betts 2015-02-06 15:58:49 -08:00
parent b75bfe0e92
commit 66f2d18d8b
2 changed files with 17 additions and 0 deletions

View 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;
}

View 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;