summaryrefslogtreecommitdiffstats
path: root/views/window
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-08 23:28:35 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-08 23:28:35 +0000
commitf45d2a74d471efbe10c8f4e7ea044dbb0a351156 (patch)
tree76718b30e905d966d550471f7264c94cb1a112d2 /views/window
parentb9911c28e52d7d269adc2542b6198c21252bac98 (diff)
downloadchromium_src-f45d2a74d471efbe10c8f4e7ea044dbb0a351156.zip
chromium_src-f45d2a74d471efbe10c8f4e7ea044dbb0a351156.tar.gz
chromium_src-f45d2a74d471efbe10c8f4e7ea044dbb0a351156.tar.bz2
Use web app icon as ICON_BIG for Windows
- Add a WindowDelegate::GetWindowAppIcon for BrowserView to expose an icon to use as ICON_BIG; - Add an app_icon_ memeber and accessor functions to TabContents; - Update/Set the app_icon_ of TabContents when web app icon is downloaded for converting a tab to app or for chrome web app shortcuts update (this happens when chrome is opened as an app; - Use the app icon as ICON_BIG in WindowWin::UpdateWindowIcon; BUG=32039 TEST=Verify fix for issue 32039 and also Alt-Tab list on XP/Vista uses big icon. Review URL: http://codereview.chromium.org/668265 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40962 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/window')
-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)