Chromium Code Reviews| 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 4285b9522314dbbed274621ff3242511e29d7d6a..e2a0c79cac0023043ac80b9d2389a8baf3e5d35a 100644 |
| --- a/content/browser/tab_contents/tab_contents.cc |
| +++ b/content/browser/tab_contents/tab_contents.cc |
| @@ -30,6 +30,7 @@ |
| #include "chrome/browser/download/download_request_limiter.h" |
| #include "chrome/browser/extensions/extension_service.h" |
| #include "chrome/browser/external_protocol_handler.h" |
| +#include "chrome/browser/favicon_delegate.h" |
| #include "chrome/browser/favicon_service.h" |
| #include "chrome/browser/google/google_util.h" |
| #include "chrome/browser/history/history.h" |
| @@ -389,7 +390,10 @@ 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, |
| + new FaviconDelegate(this))); |
| + touch_icon_helper_.reset(new FaviconHelper(this, |
|
sky
2011/03/18 17:33:37
You'll want to define a constant in chrome/browser
michaelbai
2011/03/22 18:14:13
Done.
|
| + history::TOUCH_ICON | history::TOUCH_PRECOMPOSED_ICON, NULL)); |
| autofill_manager_.reset(new AutofillManager(this)); |
| autocomplete_history_manager_.reset(new AutocompleteHistoryManager(this)); |
| desktop_notification_handler_.reset( |
| @@ -580,22 +584,22 @@ SkBitmap TabContents::GetFavicon() const { |
| // entry rather than a pending navigation entry. |
| NavigationEntry* entry = controller_.GetTransientEntry(); |
| if (entry) |
| - return entry->favicon().bitmap(); |
| + return entry->GetFavicon(history::FAVICON).bitmap(); |
| entry = controller_.GetLastCommittedEntry(); |
| if (entry) |
| - return entry->favicon().bitmap(); |
| + return entry->GetFavicon(history::FAVICON).bitmap(); |
| return SkBitmap(); |
| } |
| bool TabContents::FaviconIsValid() const { |
| NavigationEntry* entry = controller_.GetTransientEntry(); |
| if (entry) |
| - return entry->favicon().is_valid(); |
| + return entry->GetFavicon(history::FAVICON).is_valid(); |
| entry = controller_.GetLastCommittedEntry(); |
| if (entry) |
| - return entry->favicon().is_valid(); |
| + return entry->GetFavicon(history::FAVICON).is_valid(); |
| return false; |
| } |
| @@ -839,7 +843,8 @@ void TabContents::SaveFavicon() { |
| Profile::IMPLICIT_ACCESS); |
| if (!service) |
| return; |
| - const NavigationEntry::FaviconStatus& favicon(entry->favicon()); |
| + const NavigationEntry::FaviconStatus& favicon( |
| + entry->GetFavicon(history::FAVICON)); |
| if (!favicon.is_valid() || favicon.url().is_empty() || |
| favicon.bitmap().empty()) { |
| return; |
| @@ -1668,7 +1673,12 @@ void TabContents::DidNavigateMainFramePostCommit( |
| received_page_title_ = false; |
| // Get the favicon, either from history or request it from the net. |
| - favicon_helper_->FetchFavicon(details.entry->url()); |
| + favicon_helper_->FetchFavicon(details.entry->url(), history::FAVICON); |
| + |
| + // We might totally disable fetching touch icon by using |
| + // '#if define(SUPPORT_TOUCH_ICON)' |
| + touch_icon_helper_->FetchFavicon(details.entry->url(), |
| + history::TOUCH_ICON | history::TOUCH_PRECOMPOSED_ICON); |
| // Clear all page actions, blocked content notifications and browser actions |
| // for this tab, unless this is an in-page navigation. |