diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-08 22:14:12 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-08 22:14:12 +0000 |
commit | 47cde19eb5b6cba3f3ffeb6239a989b16a845777 (patch) | |
tree | 6521030379e58fba88be73ff9f002f77f3bdaeb6 | |
parent | f462899015bbd03c10cabfa791acd4811db7d2b8 (diff) | |
download | chromium_src-47cde19eb5b6cba3f3ffeb6239a989b16a845777.zip chromium_src-47cde19eb5b6cba3f3ffeb6239a989b16a845777.tar.gz chromium_src-47cde19eb5b6cba3f3ffeb6239a989b16a845777.tar.bz2 |
Make sure the window icon is set to at least the app icon as the window is created, so it shows up in places like Alt+Tab, etc.
http://crbug.com/3100
Review URL: http://codereview.chromium.org/6358
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3066 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/views/hwnd_view_container.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/chrome/views/hwnd_view_container.cc b/chrome/views/hwnd_view_container.cc index b1b56bb..41a47f4 100644 --- a/chrome/views/hwnd_view_container.cc +++ b/chrome/views/hwnd_view_container.cc @@ -7,6 +7,7 @@ #include "base/gfx/native_theme.h" #include "base/string_util.h" #include "base/win_util.h" +#include "chrome/app/chrome_dll_resource.h" #include "chrome/common/gfx/chrome_canvas.h" #include "chrome/common/win_util.h" #include "chrome/views/aero_tooltip_manager.h" @@ -73,20 +74,15 @@ const wchar_t* const HWNDViewContainer::kBaseClassName = // Window class information used for registering unique windows. struct ClassInfo { UINT style; - HICON icon; - HICON small_icon; HBRUSH background; explicit ClassInfo(int style) : style(style), - icon(NULL), - small_icon(NULL), background(NULL) {} // Compares two ClassInfos. Returns true if all members match. bool Equals(const ClassInfo& other) { - return (other.style == style && other.icon == icon && - other.small_icon == icon && other.background == background); + return (other.style == style && other.background == background); } }; @@ -884,12 +880,13 @@ std::wstring HWNDViewContainer::GetWindowClassName() { class_ex.cbClsExtra = 0; class_ex.cbWndExtra = 0; class_ex.hInstance = NULL; - class_ex.hIcon = class_info.icon; + class_ex.hIcon = LoadIcon(GetModuleHandle(L"chrome.dll"), + MAKEINTRESOURCE(IDR_MAINFRAME)); class_ex.hCursor = LoadCursor(NULL, IDC_ARROW); class_ex.hbrBackground = reinterpret_cast<HBRUSH>(class_info.background + 1); class_ex.lpszMenuName = NULL; class_ex.lpszClassName = name.c_str(); - class_ex.hIconSm = class_info.small_icon; + class_ex.hIconSm = class_ex.hIcon; ATOM atom = RegisterClassEx(&class_ex); DCHECK(atom); RegisteredClass registered_class(class_info, name, atom); |