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

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: fix style 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..084f9e93fd836510374f02e01d7d4b962e6cd0f3 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"
sky 2011/03/28 15:02:58 Is this include needed?
michaelbai 2011/03/29 00:00:50 Done.
#include "webkit/glue/password_form.h"
#include "webkit/glue/webpreferences.h"
@@ -389,7 +390,12 @@ 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) {
sky 2011/03/28 15:02:58 no {}
michaelbai 2011/03/29 00:00:50 Done.
+ 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 +445,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 +1677,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 +1986,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