[email protected] | 4b7a2aa | 2011-12-06 03:46:22 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | f7be2197b | 2010-04-23 00:20:44 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "chrome/browser/app_icon_win.h" | ||||
6 | |||||
7 | #include "chrome/app/chrome_dll_resource.h" | ||||
8 | #include "chrome/common/chrome_constants.h" | ||||
9 | |||||
10 | #if defined(GOOGLE_CHROME_BUILD) | ||||
[email protected] | 4b7a2aa | 2011-12-06 03:46:22 | [diff] [blame] | 11 | #include "chrome/installer/util/install_util.h" |
[email protected] | f7be2197b | 2010-04-23 00:20:44 | [diff] [blame] | 12 | #endif |
13 | |||||
14 | HICON GetAppIcon() { | ||||
15 | int icon_id = IDR_MAINFRAME; | ||||
16 | #if defined(GOOGLE_CHROME_BUILD) | ||||
[email protected] | 4b7a2aa | 2011-12-06 03:46:22 | [diff] [blame] | 17 | if (InstallUtil::IsChromeSxSProcess()) |
[email protected] | fc8a93c | 2010-05-03 17:55:11 | [diff] [blame] | 18 | icon_id = IDR_SXS; |
[email protected] | f7be2197b | 2010-04-23 00:20:44 | [diff] [blame] | 19 | #endif |
20 | return LoadIcon(GetModuleHandle(chrome::kBrowserResourcesDll), | ||||
21 | MAKEINTRESOURCE(icon_id)); | ||||
22 | } | ||||
[email protected] | 4b7a2aa | 2011-12-06 03:46:22 | [diff] [blame] | 23 | |
24 | HICON GetAppIconForSize(int size) { | ||||
25 | int icon_id = IDR_MAINFRAME; | ||||
26 | #if defined(GOOGLE_CHROME_BUILD) | ||||
27 | if (InstallUtil::IsChromeSxSProcess()) | ||||
28 | icon_id = IDR_SXS; | ||||
29 | #endif | ||||
30 | return static_cast<HICON>( | ||||
31 | LoadImage(GetModuleHandle(chrome::kBrowserResourcesDll), | ||||
32 | MAKEINTRESOURCE(icon_id), | ||||
33 | IMAGE_ICON, | ||||
34 | size, | ||||
35 | size, | ||||
36 | LR_DEFAULTCOLOR | LR_DEFAULTSIZE)); | ||||
37 | } |