summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/window/window_delegate.cc5
-rw-r--r--views/window/window_delegate.h4
-rw-r--r--views/window/window_win.cc7
3 files changed, 15 insertions, 1 deletions
diff --git a/views/window/window_delegate.cc b/views/window/window_delegate.cc
index 4ac4d80..c909739 100644
--- a/views/window/window_delegate.cc
+++ b/views/window/window_delegate.cc
@@ -17,6 +17,11 @@ WindowDelegate::~WindowDelegate() {
ReleaseWindow();
}
+SkBitmap WindowDelegate::GetWindowAppIcon() {
+ // Use the window icon as app icon by default.
+ return GetWindowIcon();
+}
+
// Returns the icon to be displayed in the window.
SkBitmap WindowDelegate::GetWindowIcon() {
return SkBitmap();
diff --git a/views/window/window_delegate.h b/views/window/window_delegate.h
index 7521b27..a5a3e24 100644
--- a/views/window/window_delegate.h
+++ b/views/window/window_delegate.h
@@ -68,6 +68,10 @@ class WindowDelegate {
return true;
}
+ // Returns the app icon for the window. On Windows, this is the ICON_BIG used
+ // in Alt-Tab list and Win7's taskbar.
+ virtual SkBitmap GetWindowAppIcon();
+
// Returns the icon to be displayed in the window.
virtual SkBitmap GetWindowIcon();
diff --git a/views/window/window_win.cc b/views/window/window_win.cc
index 40781a8..635aedb 100644
--- a/views/window/window_win.cc
+++ b/views/window/window_win.cc
@@ -427,7 +427,12 @@ void WindowWin::UpdateWindowIcon() {
reinterpret_cast<LPARAM>(windows_icon)));
if (old_icon)
DestroyIcon(old_icon);
- old_icon = reinterpret_cast<HICON>(
+ }
+
+ icon = window_delegate_->GetWindowAppIcon();
+ if (!icon.isNull()) {
+ HICON windows_icon = IconUtil::CreateHICONFromSkBitmap(icon);
+ HICON old_icon = reinterpret_cast<HICON>(
SendMessage(GetNativeView(), WM_SETICON, ICON_BIG,
reinterpret_cast<LPARAM>(windows_icon)));
if (old_icon)