diff options
-rw-r--r-- | chrome/app/chrome_dll.rc | 1 | ||||
-rw-r--r-- | chrome/app/chrome_dll_resource.h | 2 | ||||
-rw-r--r-- | chrome/app/chrome_exe.rc | 1 | ||||
-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 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 2 | ||||
-rw-r--r-- | chrome/installer/util/browser_distribution.cc | 4 | ||||
-rw-r--r-- | chrome/installer/util/browser_distribution.h | 2 | ||||
-rw-r--r-- | chrome/installer/util/google_chrome_sxs_distribution.cc | 4 | ||||
-rw-r--r-- | chrome/installer/util/google_chrome_sxs_distribution.h | 1 |
14 files changed, 61 insertions, 19 deletions
diff --git a/chrome/app/chrome_dll.rc b/chrome/app/chrome_dll.rc index 794bb1d..2101f7e 100644 --- a/chrome/app/chrome_dll.rc +++ b/chrome/app/chrome_dll.rc @@ -193,6 +193,7 @@ END #if defined(GOOGLE_CHROME_BUILD) IDR_MAINFRAME ICON "theme\google_chrome\chrome.ico" +IDI_SXS ICON "theme\google_chrome\chrome_sxs.ico" #else IDR_MAINFRAME ICON "theme\chromium\chromium.ico" #endif diff --git a/chrome/app/chrome_dll_resource.h b/chrome/app/chrome_dll_resource.h index 917cb01..def0110 100644 --- a/chrome/app/chrome_dll_resource.h +++ b/chrome/app/chrome_dll_resource.h @@ -37,6 +37,7 @@ #define IDI_THROBBER_22 123 #define IDI_THROBBER_23 124 #define IDI_THROBBER_24 125 +#define IDI_SXS 126 // Values around 1600 are used by installer/setup/build/ @@ -279,4 +280,3 @@ // Context menu items added by extensions. #define IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST 49000 #define IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST 50000 - diff --git a/chrome/app/chrome_exe.rc b/chrome/app/chrome_exe.rc index f84978aa..962dad1 100644 --- a/chrome/app/chrome_exe.rc +++ b/chrome/app/chrome_exe.rc @@ -66,6 +66,7 @@ IDR_MAINFRAME ICON "theme\google_chrome\chrome.ico" IDR_MAINFRAME_2 ICON "theme\google_chrome\chrome2.ico" IDR_MAINFRAME_3 ICON "theme\google_chrome\chrome3.ico" IDR_MAINFRAME_4 ICON "theme\google_chrome\chrome4.ico" +IDI_SXS ICON "theme\google_chrome\chrome_sxs.ico" #else IDR_MAINFRAME ICON "theme\chromium\chromium.ico" #endif 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); diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index d318fb7..cc86e25 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -61,6 +61,8 @@ 'browser/app_controller_cppsafe_mac.h', 'browser/app_controller_mac.h', 'browser/app_controller_mac.mm', + 'browser/app_icon_win.cc', + 'browser/app_icon_win.h', 'browser/app_menu_model.cc', 'browser/app_menu_model.h', 'browser/app_modal_dialog.cc', diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc index afce15f..210e8e1 100644 --- a/chrome/installer/util/browser_distribution.cc +++ b/chrome/installer/util/browser_distribution.cc @@ -138,6 +138,10 @@ bool BrowserDistribution::CanSetAsDefault() { return true; } +bool BrowserDistribution::ShouldUseAlternateIcon() { + return false; +} + void BrowserDistribution::UpdateDiffInstallStatus(bool system_install, bool incremental_install, installer_util::InstallStatus install_status) { } diff --git a/chrome/installer/util/browser_distribution.h b/chrome/installer/util/browser_distribution.h index b788310..66ba1e2 100644 --- a/chrome/installer/util/browser_distribution.h +++ b/chrome/installer/util/browser_distribution.h @@ -60,6 +60,8 @@ class BrowserDistribution { virtual bool CanSetAsDefault(); + virtual bool ShouldUseAlternateIcon(); + virtual void UpdateDiffInstallStatus(bool system_install, bool incremental_install, installer_util::InstallStatus install_status); diff --git a/chrome/installer/util/google_chrome_sxs_distribution.cc b/chrome/installer/util/google_chrome_sxs_distribution.cc index 8a806bc..858e35f 100644 --- a/chrome/installer/util/google_chrome_sxs_distribution.cc +++ b/chrome/installer/util/google_chrome_sxs_distribution.cc @@ -37,3 +37,7 @@ std::wstring GoogleChromeSxSDistribution::GetUninstallRegPath() { bool GoogleChromeSxSDistribution::CanSetAsDefault() { return false; } + +bool GoogleChromeSxSDistribution::ShouldUseAlternateIcon() { + return true; +} diff --git a/chrome/installer/util/google_chrome_sxs_distribution.h b/chrome/installer/util/google_chrome_sxs_distribution.h index 452a3df..9fc540d 100644 --- a/chrome/installer/util/google_chrome_sxs_distribution.h +++ b/chrome/installer/util/google_chrome_sxs_distribution.h @@ -23,6 +23,7 @@ class GoogleChromeSxSDistribution : public GoogleChromeDistribution { virtual std::wstring GetInstallSubDir(); virtual std::wstring GetUninstallRegPath(); virtual bool CanSetAsDefault(); + virtual bool ShouldUseAlternateIcon(); private: friend class BrowserDistribution; |