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 | |
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')
-rw-r--r-- | chrome/browser/browser.cc | 7 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view2.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/tab_icon_view.cc | 17 |
3 files changed, 22 insertions, 10 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index cfb7250..2cc725d 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -1632,6 +1632,7 @@ void Browser::OpenURLOffTheRecord(Profile* profile, const GURL& url) { // static std::wstring Browser::ComputePopupTitle(const GURL& url, const std::wstring& title) { + DCHECK(!g_browser_process->IsUsingNewFrames()); std::wstring result(title); FormatTitleForDisplay(&result); return result; @@ -1655,8 +1656,10 @@ void Browser::ConvertToTabbedBrowser() { void Browser::BuildPopupWindow(TabContents* source, TabContents* new_contents, const gfx::Rect& initial_pos) { - Browser* browser = new Browser(initial_pos, SW_SHOWNORMAL, profile_, - BrowserType::BROWSER, std::wstring()); + BrowserType::Type type = + type_ == BrowserType::APPLICATION ? type_ : BrowserType::BROWSER; + Browser* browser = new Browser(initial_pos, SW_SHOWNORMAL, profile_, type, + std::wstring()); browser->AddNewContents(source, new_contents, NEW_FOREGROUND_TAB, gfx::Rect(), true); diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc index cc1e2c5..3d4d1ed 100644 --- a/chrome/browser/views/frame/browser_view2.cc +++ b/chrome/browser/views/frame/browser_view2.cc @@ -519,12 +519,8 @@ bool BrowserView2::ShouldShowWindowTitle() const { } SkBitmap BrowserView2::GetWindowIcon() { - if (browser_->GetType() == BrowserType::APPLICATION) { - SkBitmap favicon = browser_->GetCurrentPageIcon(); - if (favicon.isNull()) - return default_favicon_; - return favicon; - } + if (browser_->GetType() == BrowserType::APPLICATION) + return browser_->GetCurrentPageIcon(); return SkBitmap(); } 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() / |