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

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

Issue 227153007: Remove dependency on Profile's IsOffTheRecord in favicon_handler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@FAVICON_create_core_dir
Patch Set: Review fixes. Created 6 years, 8 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: chrome/browser/favicon/favicon_handler.cc
diff --git a/chrome/browser/favicon/favicon_handler.cc b/chrome/browser/favicon/favicon_handler.cc
index 31013911fe514b931ddab90a7b90dbc44c00922a..9c4f2a9d7989f515959a0d66e47a99c071239d36 100644
--- a/chrome/browser/favicon/favicon_handler.cc
+++ b/chrome/browser/favicon/favicon_handler.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/favicon/favicon_util.h"
#include "chrome/browser/history/select_favicon_frames.h"
#include "chrome/browser/profiles/profile.h"
+#include "components/favicon/content/favicon_driver.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/navigation_entry.h"
#include "skia/ext/image_operations.h"
@@ -210,15 +211,19 @@ FaviconHandler::FaviconCandidate::FaviconCandidate(
////////////////////////////////////////////////////////////////////////////////
FaviconHandler::FaviconHandler(Profile* profile,
+ FaviconDriver* driver,
FaviconHandlerDelegate* delegate,
Type icon_type)
: got_favicon_from_history_(false),
favicon_expired_or_incomplete_(false),
- icon_types_(icon_type == FAVICON ? chrome::FAVICON :
- chrome::TOUCH_ICON | chrome::TOUCH_PRECOMPOSED_ICON),
+ icon_types_(icon_type == FAVICON
+ ? chrome::FAVICON
+ : chrome::TOUCH_ICON | chrome::TOUCH_PRECOMPOSED_ICON),
profile_(profile),
+ driver_(driver),
delegate_(delegate) {
DCHECK(profile_);
+ DCHECK(driver_);
DCHECK(delegate_);
}
@@ -472,7 +477,7 @@ void FaviconHandler::SetHistoryFavicons(const GURL& page_url,
}
bool FaviconHandler::ShouldSaveFavicon(const GURL& url) {
- if (!profile_->IsOffTheRecord())
+ if (!driver_->IsOffTheRecord())
return true;
// Otherwise store the favicon if the page is bookmarked.
@@ -549,7 +554,7 @@ void FaviconHandler::DownloadFaviconOrAskFaviconService(
// We don't know the favicon, but we may have previously downloaded the
// favicon for another page that shares the same favicon. Ask for the
// favicon given the favicon URL.
- if (profile_->IsOffTheRecord()) {
+ if (driver_->IsOffTheRecord()) {
GetFaviconFromFaviconService(
icon_url, icon_type,
base::Bind(&FaviconHandler::OnFaviconData, base::Unretained(this)),

Powered by Google App Engine
This is Rietveld 408576698