Chromium Code Reviews| 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..497b3853e183c7f32248a98a90b126a675914a38 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() { |
| + CHECK(web_contents()->GetController().GetActiveEntry()); |
|
blundell
2014/05/09 14:30:34
s/CHECK/DCHECK
jif
2014/05/11 13:41:22
Done.
|
| + return web_contents()->GetController().GetActiveEntry()->GetFavicon(); |
| +} |
| + |
| void FaviconTabHelper::DidStartNavigationToPendingEntry( |
| const GURL& url, |
| NavigationController::ReloadType reload_type) { |