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

Unified Diff: chrome/browser/ui/webui/favicon_source.cc

Issue 11762004: Make favicons for about:history and about:bookmarks switch from lodpi to hidpi when dragging browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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/ui/webui/favicon_source.cc
diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui/favicon_source.cc
index 07bae9a4a40b4619e5d8ebce93979c3d646286c4..c53b439bb1b8400b4dbe56fdff51550c769ad241 100644
--- a/chrome/browser/ui/webui/favicon_source.cc
+++ b/chrome/browser/ui/webui/favicon_source.cc
@@ -47,7 +47,10 @@ void FaviconSource::StartDataRequest(const std::string& path,
FaviconService* favicon_service =
FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
if (!favicon_service || path.empty()) {
- SendDefaultResponse(IconRequest(request_id, 16, ui::SCALE_FACTOR_100P));
+ SendDefaultResponse(IconRequest(request_id,
+ "",
+ 16,
+ ui::SCALE_FACTOR_100P));
return;
}
@@ -73,7 +76,10 @@ void FaviconSource::StartDataRequest(const std::string& path,
scale_factor,
base::Bind(&FaviconSource::OnFaviconDataAvailable,
base::Unretained(this),
- IconRequest(request_id, size_in_dip, scale_factor)),
+ IconRequest(request_id,
+ path.substr(prefix_length),
+ size_in_dip,
+ scale_factor)),
&cancelable_task_tracker_);
} else {
GURL url;
@@ -131,7 +137,10 @@ void FaviconSource::StartDataRequest(const std::string& path,
scale_factor,
base::Bind(&FaviconSource::OnFaviconDataAvailable,
base::Unretained(this),
- IconRequest(request_id, size_in_dip, scale_factor)),
+ IconRequest(request_id,
+ url.spec(),
+ size_in_dip,
+ scale_factor)),
&cancelable_task_tracker_);
}
}
@@ -148,13 +157,19 @@ bool FaviconSource::ShouldReplaceExistingSource() const {
return false;
}
+bool FaviconSource::HandleMissingResource(const IconRequest& request) {
+ // No additional checks to locate the favicon resource in the base
+ // implementation.
+ return false;
+}
+
void FaviconSource::OnFaviconDataAvailable(
const IconRequest& request,
const history::FaviconBitmapResult& bitmap_result) {
if (bitmap_result.is_valid()) {
// Forward the data along to the networking system.
SendResponse(request.request_id, bitmap_result.bitmap_data);
- } else {
+ } else if (!HandleMissingResource(request)) {
SendDefaultResponse(request);
}
}

Powered by Google App Engine
This is Rietveld 408576698