Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2048)

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 249023: Use favicon for application shortcut icon. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fixed unittests, handle null favicon Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc (revision 27368)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -535,6 +535,18 @@
return SkBitmap();
}
+bool TabContents::FavIconIsValid() const {
+ NavigationEntry* entry = controller_.GetTransientEntry();
+ if (entry)
+ return entry->favicon().is_valid();
+
+ entry = controller_.GetLastCommittedEntry();
+ if (entry)
+ return entry->favicon().is_valid();
+
+ return false;
+}
+
bool TabContents::ShouldDisplayFavIcon() {
// Always display a throbber during pending loads.
if (controller_.GetLastCommittedEntry() && controller_.pending_entry())
@@ -767,8 +779,11 @@
return;
#if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS)
+ SkBitmap bitmap;
+ if (FavIconIsValid())
+ bitmap = GetFavIcon();
CreateApplicationShortcutsDialogGtk::Show(view()->GetTopLevelNativeWindow(),
- GetURL(), GetTitle());
+ GetURL(), GetTitle(), bitmap);
#else
// We only allow one pending install request. By resetting the page id we
// effectively cancel the pending install request.
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698