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

Unified Diff: components/favicon/content/content_favicon_driver.cc

Issue 2691933004: Avoid cyclic dependency FaviconHandler<-->FaviconDriverImpl (Closed)
Patch Set: Addressed more comments. Created 3 years, 10 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 | « components/favicon/content/content_favicon_driver.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: components/favicon/content/content_favicon_driver.cc
diff --git a/components/favicon/content/content_favicon_driver.cc b/components/favicon/content/content_favicon_driver.cc
index a6e5259847c538dd0a7497d8d52f3c70eef1a88a..cf9bba46bd0e8602c7267d70d0bfda0dce657bcf 100644
--- a/components/favicon/content/content_favicon_driver.cc
+++ b/components/favicon/content/content_favicon_driver.cc
@@ -88,26 +88,6 @@ bool ContentFaviconDriver::FaviconIsValid() const {
return false;
}
-int ContentFaviconDriver::StartDownload(const GURL& url, int max_image_size) {
- if (WasUnableToDownloadFavicon(url)) {
- DVLOG(1) << "Skip Failed FavIcon: " << url;
- return 0;
- }
-
- bool bypass_cache = (bypass_cache_page_url_ == GetActiveURL());
- bypass_cache_page_url_ = GURL();
-
- return web_contents()->DownloadImage(
- url, true, max_image_size, bypass_cache,
- base::Bind(&FaviconDriverImpl::DidDownloadFavicon,
- base::Unretained(this)));
-}
-
-bool ContentFaviconDriver::IsOffTheRecord() {
- DCHECK(web_contents());
- return web_contents()->GetBrowserContext()->IsOffTheRecord();
-}
-
GURL ContentFaviconDriver::GetActiveURL() {
content::NavigationEntry* entry =
web_contents()->GetController().GetLastCommittedEntry();
@@ -126,6 +106,26 @@ ContentFaviconDriver::ContentFaviconDriver(
ContentFaviconDriver::~ContentFaviconDriver() {
}
+int ContentFaviconDriver::DownloadImage(const GURL& url,
+ int max_image_size,
+ ImageDownloadCallback callback) {
+ if (WasUnableToDownloadFavicon(url)) {
+ DVLOG(1) << "Skip Failed FavIcon: " << url;
+ return 0;
+ }
+
+ bool bypass_cache = (bypass_cache_page_url_ == GetActiveURL());
+ bypass_cache_page_url_ = GURL();
+
+ return web_contents()->DownloadImage(url, true, max_image_size, bypass_cache,
+ callback);
+}
+
+bool ContentFaviconDriver::IsOffTheRecord() {
+ DCHECK(web_contents());
+ return web_contents()->GetBrowserContext()->IsOffTheRecord();
+}
+
void ContentFaviconDriver::OnFaviconUpdated(
const GURL& page_url,
FaviconDriverObserver::NotificationIconType notification_icon_type,
« no previous file with comments | « components/favicon/content/content_favicon_driver.h ('k') | components/favicon/core/favicon_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698