Index: content/browser/tab_contents/tab_contents.cc |
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc |
index be64ae1013117b21ab7025607fe7c0cf59c0337d..c7223a38e59d1f474bc3a33598a839fafaf9015d 100644 |
--- a/content/browser/tab_contents/tab_contents.cc |
+++ b/content/browser/tab_contents/tab_contents.cc |
@@ -93,6 +93,7 @@ |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
#include "ui/base/resource/resource_bundle.h" |
#include "ui/gfx/codec/png_codec.h" |
+#include "ui/gfx/favicon_size.h" |
#include "webkit/glue/password_form.h" |
#include "webkit/glue/webpreferences.h" |
@@ -389,7 +390,14 @@ TabContents::~TabContents() { |
void TabContents::AddObservers() { |
printing_.reset(new printing::PrintViewManager(this)); |
print_preview_.reset(new printing::PrintPreviewMessageHandler(this)); |
- favicon_helper_.reset(new FaviconHelper(this)); |
+ favicon_helper_.reset(new FaviconHelper(this, history::FAVICON, |
+ kFaviconSize)); |
+ |
+ if (browser_defaults::enable_touch_icon) { |
+ touch_icon_helper_.reset(new FaviconHelper(this, |
+ history::TOUCH_ICON | history::TOUCH_PRECOMPOSED_ICON, 0)); |
+ } |
+ |
autofill_manager_.reset(new AutofillManager(this)); |
autocomplete_history_manager_.reset(new AutocompleteHistoryManager(this)); |
desktop_notification_handler_.reset( |
@@ -439,6 +447,7 @@ bool TabContents::OnMessageReceived(const IPC::Message& message) { |
IPC_MESSAGE_HANDLER(ViewHostMsg_SetSuggestions, OnSetSuggestions) |
IPC_MESSAGE_HANDLER(ViewHostMsg_InstantSupportDetermined, |
OnInstantSupportDetermined) |
+ IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) |
IPC_MESSAGE_UNHANDLED(handled = false) |
IPC_END_MESSAGE_MAP_EX() |
@@ -1670,6 +1679,9 @@ void TabContents::DidNavigateMainFramePostCommit( |
// Get the favicon, either from history or request it from the net. |
favicon_helper_->FetchFavicon(details.entry->url()); |
+ if (touch_icon_helper_.get()) |
+ touch_icon_helper_->FetchFavicon(details.entry->url()); |
+ |
// Clear all page actions, blocked content notifications and browser actions |
// for this tab, unless this is an in-page navigation. |
if (!details.is_in_page) { |
@@ -1976,6 +1988,15 @@ void TabContents::OnInstantSupportDetermined(int32 page_id, bool result) { |
delegate()->OnInstantSupportDetermined(page_id, result); |
} |
+void TabContents::OnUpdateFaviconURL( |
+ int32 page_id, |
+ std::vector<FaviconURL> candidates) { |
+ favicon_helper().OnUpdateFaviconURL(page_id, candidates); |
+ if (touch_icon_helper_.get()) { |
sky
2011/03/22 19:48:48
no parens
michaelbai
2011/03/22 23:59:03
Done.
|
+ touch_icon_helper_->OnUpdateFaviconURL(page_id, candidates); |
+ } |
+} |
+ |
void TabContents::OnContentSettingsAccessed(bool content_was_blocked) { |
if (delegate_) |
delegate_->OnContentSettingsChange(this); |