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

Unified Diff: chrome/browser/favicon/favicon_tab_helper.cc

Issue 261403003: Removes usage of NavigationEntry from favicon_handler.* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes v2. Created 6 years, 7 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
« no previous file with comments | « chrome/browser/favicon/favicon_tab_helper.h ('k') | components/favicon/core/favicon_driver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/favicon/favicon_tab_helper.cc
diff --git a/chrome/browser/favicon/favicon_tab_helper.cc b/chrome/browser/favicon/favicon_tab_helper.cc
index a6a7bb84c9411a7ebe413518e51eaf73fca916f9..f203f141962d39bed479a535e4997c698d761d14 100644
--- a/chrome/browser/favicon/favicon_tab_helper.cc
+++ b/chrome/browser/favicon/favicon_tab_helper.cc
@@ -135,10 +135,6 @@ void FaviconTabHelper::SaveFavicon() {
entry->GetURL(), favicon.url, favicon_base::FAVICON, favicon.image);
}
-NavigationEntry* FaviconTabHelper::GetActiveEntry() {
- return web_contents()->GetController().GetActiveEntry();
-}
-
int FaviconTabHelper::StartDownload(const GURL& url, int max_image_size) {
FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
profile_->GetOriginalProfile(), Profile::IMPLICIT_ACCESS);
@@ -167,6 +163,42 @@ bool FaviconTabHelper::IsOffTheRecord() {
return web_contents()->GetBrowserContext()->IsOffTheRecord();
}
+const gfx::Image FaviconTabHelper::GetActiveFaviconImage() {
+ return GetFaviconStatus().image;
+}
+
+const GURL FaviconTabHelper::GetActiveFaviconURL() {
+ return GetFaviconStatus().url;
+}
+
+bool FaviconTabHelper::GetActiveFaviconValidity() {
+ return GetFaviconStatus().valid;
+}
+
+const GURL FaviconTabHelper::GetActiveURL() {
+ NavigationEntry* entry = web_contents()->GetController().GetActiveEntry();
+ if (!entry || entry->GetURL().is_empty())
+ return GURL();
+ return entry->GetURL();
+}
+
+void FaviconTabHelper::SetActiveFaviconImage(gfx::Image image) {
+ GetFaviconStatus().image = image;
+}
+
+void FaviconTabHelper::SetActiveFaviconURL(GURL url) {
+ GetFaviconStatus().url = url;
+}
+
+void FaviconTabHelper::SetActiveFaviconValidity(bool validity) {
+ GetFaviconStatus().valid = validity;
+}
+
+content::FaviconStatus& FaviconTabHelper::GetFaviconStatus() {
+ DCHECK(web_contents()->GetController().GetActiveEntry());
+ return web_contents()->GetController().GetActiveEntry()->GetFavicon();
+}
+
void FaviconTabHelper::DidStartNavigationToPendingEntry(
const GURL& url,
NavigationController::ReloadType reload_type) {
« no previous file with comments | « chrome/browser/favicon/favicon_tab_helper.h ('k') | components/favicon/core/favicon_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698