diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-24 18:25:11 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-24 18:25:11 +0000 |
commit | a0e073f2fb72c20c64326ce47ba5f2149007d26d (patch) | |
tree | 4e63d1b3d11678d0d1d73e72a8bf1a1ea44fed67 /chrome/browser/views/tab_icon_view.cc | |
parent | 9052745343f2a8a231150977cfad3afec687daf1 (diff) | |
download | chromium_src-a0e073f2fb72c20c64326ce47ba5f2149007d26d.zip chromium_src-a0e073f2fb72c20c64326ce47ba5f2149007d26d.tar.gz chromium_src-a0e073f2fb72c20c64326ce47ba5f2149007d26d.tar.bz2 |
Make the window icon the app icon by default for popups and app windows unless the page specifies a favicon. This ensures that we don't show the default favicon for the window icon. (This is only appropriate for tab icons).
Also make sure popup windows opened from app windows are themselves app windows (and don't show the URL bar)
B=1031854
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1293 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tab_icon_view.cc')
-rw-r--r-- | chrome/browser/views/tab_icon_view.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/chrome/browser/views/tab_icon_view.cc b/chrome/browser/views/tab_icon_view.cc index 40424c9..d410fc6 100644 --- a/chrome/browser/views/tab_icon_view.cc +++ b/chrome/browser/views/tab_icon_view.cc @@ -2,13 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/views/tab_icon_view.h" + +#include "base/file_util.h" +#include "base/path_service.h" #include "chrome/app/theme/theme_resources.h" #include "chrome/common/gfx/chrome_canvas.h" #include "chrome/common/gfx/favicon_size.h" #include "chrome/common/gfx/icon_util.h" #include "chrome/common/resource_bundle.h" #include "chrome/browser/tab_contents.h" -#include "chrome/browser/views/tab_icon_view.h" #include "chrome/app/chrome_dll_resource.h" static bool g_initialized = false; @@ -21,7 +24,17 @@ static int g_throbber_frame_count; void TabIconView::InitializeIfNeeded() { if (!g_initialized) { ResourceBundle &rb = ResourceBundle::GetSharedInstance(); - g_default_fav_icon = rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); + + // 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, L"chrome.exe"); + HICON app_icon = ExtractIcon(NULL, exe_path.c_str(), 0); + g_default_fav_icon = + IconUtil::CreateSkBitmapFromHICON(app_icon, gfx::Size(16, 16)); + DestroyIcon(app_icon); + g_throbber_frames = rb.GetBitmapNamed(IDR_THROBBER); g_throbber_frames_light = rb.GetBitmapNamed(IDR_THROBBER_LIGHT); g_throbber_frame_count = g_throbber_frames->width() / |