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

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

Issue 2638423008: Convert ContentFaviconDriver to use the new navigation callbacks. (Closed)
Patch Set: add comment Created 3 years, 11 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: 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 dfc40d4e1ba75caf75c19cf0614131ea9f78cc6e..199eadab27a3182901d003c8e048100be1292aad 100644
--- a/components/favicon/content/content_favicon_driver.cc
+++ b/components/favicon/content/content_favicon_driver.cc
@@ -14,6 +14,7 @@
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/common/favicon_url.h"
#include "ui/gfx/image/image.h"
@@ -162,20 +163,29 @@ void ContentFaviconDriver::DidUpdateFaviconURL(
FaviconURLsFromContentFaviconURLs(candidates));
}
-void ContentFaviconDriver::DidStartNavigationToPendingEntry(
- const GURL& url,
- content::ReloadType reload_type) {
+void ContentFaviconDriver::DidStartNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->IsInMainFrame())
+ return;
+
+ content::ReloadType reload_type = navigation_handle->GetReloadType();
if (reload_type == content::ReloadType::NONE || IsOffTheRecord())
return;
- bypass_cache_page_url_ = url;
+ bypass_cache_page_url_ = navigation_handle->GetURL();
SetFaviconOutOfDateForPage(
- url, reload_type == content::ReloadType::BYPASSING_CACHE);
+ navigation_handle->GetURL(),
+ reload_type == content::ReloadType::BYPASSING_CACHE);
}
-void ContentFaviconDriver::DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
+void ContentFaviconDriver::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->IsInMainFrame() ||
+ !navigation_handle->HasCommitted() ||
+ navigation_handle->IsErrorPage()) {
+ return;
+ }
+
favicon_urls_.clear();
// Wait till the user navigates to a new URL to start checking the cache
@@ -185,7 +195,7 @@ void ContentFaviconDriver::DidNavigateMainFrame(
// favicon. In particular, a page may do an in-page navigation before
// FaviconHandler has the time to determine that the favicon needs to be
// redownloaded.
- GURL url = details.entry->GetURL();
+ GURL url = navigation_handle->GetURL();
if (url != bypass_cache_page_url_)
bypass_cache_page_url_ = GURL();
« no previous file with comments | « components/favicon/content/content_favicon_driver.h ('k') | content/browser/frame_host/navigation_handle_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698