diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 00:20:44 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 00:20:44 +0000 |
commit | f7be2197bdd73fa0249a005c72112e982a6520d5 (patch) | |
tree | 9aed6a5c6839017a1bf466914c2f97b91a180801 /chrome/browser | |
parent | c9f8a4f1c96ffa319698778e53aa08d9ea39a91d (diff) | |
download | chromium_src-f7be2197bdd73fa0249a005c72112e982a6520d5.zip chromium_src-f7be2197bdd73fa0249a005c72112e982a6520d5.tar.gz chromium_src-f7be2197bdd73fa0249a005c72112e982a6520d5.tar.bz2 |
Win: Use different icon for SxS
BUG=37119
TEST=build official exe, run with --chrome-sxs
Review URL: http://codereview.chromium.org/1727006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45388 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/aeropeek_manager.cc | 5 | ||||
-rw-r--r-- | chrome/browser/app_icon_win.cc | 22 | ||||
-rw-r--r-- | chrome/browser/app_icon_win.h | 12 | ||||
-rw-r--r-- | chrome/browser/task_manager_resource_providers.cc | 5 | ||||
-rw-r--r-- | chrome/browser/views/chrome_views_delegate.cc | 9 | ||||
-rw-r--r-- | chrome/browser/views/tab_icon_view.cc | 10 |
6 files changed, 45 insertions, 18 deletions
diff --git a/chrome/browser/aeropeek_manager.cc b/chrome/browser/aeropeek_manager.cc index f3a8e85..b93f5ad 100644 --- a/chrome/browser/aeropeek_manager.cc +++ b/chrome/browser/aeropeek_manager.cc @@ -14,7 +14,7 @@ #include "base/scoped_handle_win.h" #include "base/scoped_native_library.h" #include "base/win_util.h" -#include "chrome/app/chrome_dll_resource.h" +#include "chrome/browser/app_icon_win.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_thread.h" @@ -986,8 +986,7 @@ HICON AeroPeekWindow::OnGetIcon(UINT index) { // We save this application icon to avoid calling LoadIcon() twice or more. if (favicon_bitmap_.isNull()) { if (!frame_icon_) { - frame_icon_ = LoadIcon(GetModuleHandle(chrome::kBrowserResourcesDll), - MAKEINTRESOURCE(IDR_MAINFRAME)); + frame_icon_ = GetAppIcon(); } return frame_icon_; } diff --git a/chrome/browser/app_icon_win.cc b/chrome/browser/app_icon_win.cc new file mode 100644 index 0000000..31059d7 --- /dev/null +++ b/chrome/browser/app_icon_win.cc @@ -0,0 +1,22 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/app_icon_win.h" + +#include "chrome/app/chrome_dll_resource.h" +#include "chrome/common/chrome_constants.h" + +#if defined(GOOGLE_CHROME_BUILD) +#include "chrome/installer/util/browser_distribution.h" +#endif + +HICON GetAppIcon() { + int icon_id = IDR_MAINFRAME; +#if defined(GOOGLE_CHROME_BUILD) + if (BrowserDistribution::GetDistribution()->ShouldUseAlternateIcon()) + icon_id = IDI_SXS; +#endif + return LoadIcon(GetModuleHandle(chrome::kBrowserResourcesDll), + MAKEINTRESOURCE(icon_id)); +} diff --git a/chrome/browser/app_icon_win.h b/chrome/browser/app_icon_win.h new file mode 100644 index 0000000..5239cdf --- /dev/null +++ b/chrome/browser/app_icon_win.h @@ -0,0 +1,12 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_APP_ICON_WIN_H_ +#define CHROME_BROWSER_APP_ICON_WIN_H_ + +#include <windows.h> + +HICON GetAppIcon(); + +#endif // CHROME_BROWSER_APP_ICON_WIN_H_ diff --git a/chrome/browser/task_manager_resource_providers.cc b/chrome/browser/task_manager_resource_providers.cc index e9219a3..369a2dd 100644 --- a/chrome/browser/task_manager_resource_providers.cc +++ b/chrome/browser/task_manager_resource_providers.cc @@ -42,7 +42,7 @@ #include "skia/ext/skia_utils_mac.h" #endif #if defined(OS_WIN) -#include <atlbase.h> +#include "chrome/browser/app_icon_win.h" #include "gfx/icon_util.h" #endif // defined(OS_WIN) @@ -834,8 +834,7 @@ TaskManagerBrowserProcessResource::TaskManagerBrowserProcessResource() DCHECK(success); #if defined(OS_WIN) if (!default_icon_) { - HICON icon = LoadIcon(_AtlBaseModule.GetResourceInstance(), - MAKEINTRESOURCE(IDR_MAINFRAME)); + HICON icon = GetAppIcon(); if (icon) { ICONINFO icon_info = {0}; BITMAP bitmap_info = {0}; diff --git a/chrome/browser/views/chrome_views_delegate.cc b/chrome/browser/views/chrome_views_delegate.cc index 2e49aee..b0f8028 100644 --- a/chrome/browser/views/chrome_views_delegate.cc +++ b/chrome/browser/views/chrome_views_delegate.cc @@ -6,13 +6,15 @@ #include "app/clipboard/clipboard.h" #include "base/scoped_ptr.h" -#include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/pref_service.h" #include "chrome/browser/window_sizer.h" -#include "chrome/common/chrome_constants.h" #include "gfx/rect.h" +#if defined(OS_WIN) +#include "chrome/browser/app_icon_win.h" +#endif + /////////////////////////////////////////////////////////////////////////////// // ChromeViewsDelegate, views::ViewsDelegate implementation: @@ -77,8 +79,7 @@ bool ChromeViewsDelegate::GetSavedMaximizedState( #if defined(OS_WIN) HICON ChromeViewsDelegate::GetDefaultWindowIcon() const { - return LoadIcon(GetModuleHandle(chrome::kBrowserResourcesDll), - MAKEINTRESOURCE(IDR_MAINFRAME)); + return GetAppIcon(); } #endif diff --git a/chrome/browser/views/tab_icon_view.cc b/chrome/browser/views/tab_icon_view.cc index 7c02b14a..a43e0ac 100644 --- a/chrome/browser/views/tab_icon_view.cc +++ b/chrome/browser/views/tab_icon_view.cc @@ -12,16 +12,15 @@ #include "app/resource_bundle.h" #include "base/file_util.h" #include "base/logging.h" -#include "base/path_service.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/common/chrome_constants.h" #include "gfx/canvas.h" #include "gfx/favicon_size.h" #include "grit/app_resources.h" #include "grit/theme_resources.h" #if defined(OS_WIN) +#include "chrome/browser/app_icon_win.h" #include "gfx/icon_util.h" #endif @@ -39,12 +38,7 @@ void TabIconView::InitializeIfNeeded() { #if defined(OS_WIN) // The default window icon is the application icon, not the default // favicon. - std::wstring exe_path; - PathService::Get(base::DIR_EXE, &exe_path); - file_util::AppendToPath(&exe_path, - chrome::kBrowserProcessExecutableName); - - HICON app_icon = ExtractIcon(NULL, exe_path.c_str(), 0); + HICON app_icon = GetAppIcon(); g_default_fav_icon = IconUtil::CreateSkBitmapFromHICON(app_icon, gfx::Size(16, 16)); DestroyIcon(app_icon); |