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

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: Only update the FAVICON data to the NavigationEntry. 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 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.
« chrome/renderer/render_view.cc ('K') | « content/browser/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698