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

Unified Diff: chrome/browser/extensions/favicon_downloader.cc

Issue 2662443005: Convert FaviconDownloader to use the new navigation callbacks. (Closed)
Patch Set: 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
« no previous file with comments | « chrome/browser/extensions/favicon_downloader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/favicon_downloader.cc
diff --git a/chrome/browser/extensions/favicon_downloader.cc b/chrome/browser/extensions/favicon_downloader.cc
index 39ac3dd6f2b898456181510138f2a95d67e0addc..334fb78df93c94dab5a88103326374f50b5677db 100644
--- a/chrome/browser/extensions/favicon_downloader.cc
+++ b/chrome/browser/extensions/favicon_downloader.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "components/favicon/content/content_favicon_driver.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/favicon_url.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -100,7 +101,7 @@ void FaviconDownloader::DidDownloadFavicon(
const GURL& image_url,
const std::vector<SkBitmap>& bitmaps,
const std::vector<gfx::Size>& original_bitmap_sizes) {
- // Request may have been canceled by DidNavigateMainFrame().
+ // Request may have been canceled by DidFinishNavigation().
if (in_progress_requests_.erase(id) == 0)
return;
@@ -112,9 +113,11 @@ void FaviconDownloader::DidDownloadFavicon(
}
// content::WebContentsObserver overrides:
-void FaviconDownloader::DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
+void FaviconDownloader::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted())
Devlin 2017/01/27 21:51:51 I realize that this is the conversion that would l
jam 2017/01/27 23:04:25 DidStartNavigation might not commit though, i.e. b
Devlin 2017/01/28 02:24:23 Interesting, okay. And there's no way to know tha
jam 2017/01/28 04:35:00 Right, at the start is before the network request
+ return;
+
// Clear all pending requests.
in_progress_requests_.clear();
favicon_map_.clear();
« no previous file with comments | « chrome/browser/extensions/favicon_downloader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698