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

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

Issue 12732005: Most visited thumbnails and favicons need id-based urls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase with Sreeram's MV clicks change Created 7 years, 9 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 3c8658237e4703f4d7c00a289968a2930d120d9d..d9f051254898845884152a1c440e375ef2250a91 100644
--- a/chrome/browser/ui/webui/favicon_source.cc
+++ b/chrome/browser/ui/webui/favicon_source.cc
@@ -10,6 +10,8 @@
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/history/top_sites.h"
#include "chrome/browser/instant/instant_io_context.h"
+#include "chrome/browser/instant/instant_service.h"
+#include "chrome/browser/instant/instant_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
#include "grit/locale_settings.h"
@@ -80,16 +82,21 @@ std::string FaviconSource::GetSource() {
}
void FaviconSource::StartDataRequest(
- const std::string& path,
+ const std::string& raw_path,
bool is_incognito,
const content::URLDataSource::GotDataCallback& callback) {
FaviconService* favicon_service =
FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
- if (!favicon_service || path.empty()) {
+ if (!favicon_service || raw_path.empty()) {
SendDefaultResponse(callback);
return;
}
+ // Translate to regular path if |raw_path| is of the form
+ // chrome-search://favicon/<rid>, where rid is a uint64.
Evan Stade 2013/03/12 01:30:23 nit: rid no longer makes sense here
dhollowa 2013/03/12 01:48:07 Done.
+ std::string path = InstantService::MaybeTranslateInstantPathOnUI(profile_,
+ raw_path);
+
DCHECK_EQ(16, gfx::kFaviconSize);
int size_in_dip = 16;
ui::ScaleFactor scale_factor = ui::SCALE_FACTOR_100P;
@@ -219,8 +226,10 @@ bool FaviconSource::ShouldReplaceExistingSource() const {
}
bool FaviconSource::ShouldServiceRequest(const net::URLRequest* request) const {
- if (request->url().SchemeIs(chrome::kChromeSearchScheme))
- return InstantIOContext::ShouldServiceRequest(request);
+ if (request->url().SchemeIs(chrome::kChromeSearchScheme)) {
+ return InstantService::IsInstantPath(request->url()) &&
+ InstantIOContext::ShouldServiceRequest(request);
+ }
return URLDataSource::ShouldServiceRequest(request);
}

Powered by Google App Engine
This is Rietveld 408576698