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

Unified Diff: chrome/browser/dom_ui/dom_ui_favicon_source.cc

Issue 3236001: Add the collapsed 'miniview' to the apps and most visisted sections. (Closed)
Patch Set: more unnecessary changes Created 10 years, 4 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/dom_ui/dom_ui_favicon_source.cc
diff --git a/chrome/browser/dom_ui/dom_ui_favicon_source.cc b/chrome/browser/dom_ui/dom_ui_favicon_source.cc
index 5a52346a664cf956396931fb37010f3e3f38d366..55818a3040d4bb1e1ed667e1675c45bbf5ab5de9 100644
--- a/chrome/browser/dom_ui/dom_ui_favicon_source.cc
+++ b/chrome/browser/dom_ui/dom_ui_favicon_source.cc
@@ -26,6 +26,11 @@ void DOMUIFavIconSource::StartDataRequest(const std::string& path,
profile_->GetFaviconService(Profile::EXPLICIT_ACCESS);
if (favicon_service) {
FaviconService::Handle handle;
+ if (path.empty()) {
+ SendDefaultResponse(request_id);
+ return;
+ }
+
if (path.size() > 8 && path.substr(0, 8) == "iconurl/") {
handle = favicon_service->GetFavicon(
GURL(path.substr(8)),
@@ -65,12 +70,16 @@ void DOMUIFavIconSource::OnFavIconDataAvailable(
// Forward the data along to the networking system.
SendResponse(request_id, data);
} else {
- if (!default_favicon_.get()) {
- default_favicon_ =
- ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- IDR_DEFAULT_FAVICON);
- }
+ SendDefaultResponse(request_id);
+ }
+}
- SendResponse(request_id, default_favicon_);
+void DOMUIFavIconSource::SendDefaultResponse(int request_id) {
+ if (!default_favicon_.get()) {
+ default_favicon_ =
+ ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
+ IDR_DEFAULT_FAVICON);
}
+
+ SendResponse(request_id, default_favicon_);
}

Powered by Google App Engine
This is Rietveld 408576698