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

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

Issue 6672065: Support touch icon in FaviconHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address the comments Created 9 years, 9 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
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..c7649dd58110318692f5c0d48163195509eb5acf 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -389,7 +389,11 @@ 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, FaviconHelper::FAVICON));
+
+ if (browser_defaults::kEnableTouchIcon)
+ touch_icon_helper_.reset(new FaviconHelper(this, FaviconHelper::TOUCH));
+
autofill_manager_.reset(new AutofillManager(this));
autocomplete_history_manager_.reset(new AutocompleteHistoryManager(this));
desktop_notification_handler_.reset(
@@ -439,6 +443,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 +1675,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 +1984,14 @@ void TabContents::OnInstantSupportDetermined(int32 page_id, bool result) {
delegate()->OnInstantSupportDetermined(page_id, result);
}
+void TabContents::OnUpdateFaviconURL(
+ int32 page_id,
+ const std::vector<FaviconURL>& candidates) {
+ favicon_helper().OnUpdateFaviconURL(page_id, candidates);
+ if (touch_icon_helper_.get())
+ touch_icon_helper_->OnUpdateFaviconURL(page_id, candidates);
+}
+
void TabContents::OnContentSettingsAccessed(bool content_was_blocked) {
if (delegate_)
delegate_->OnContentSettingsChange(this);

Powered by Google App Engine
This is Rietveld 408576698