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

Unified Diff: chrome/browser/ui/webui/ntp/thumbnail_source.cc

Issue 59903010: Ensure using chrome://thumb2/... adds the URL as a forced URL in TopSites so that a thumbnail is ca… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Take 2. Created 7 years, 1 month 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/ui/webui/ntp/thumbnail_source.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/thumbnail_source.cc
diff --git a/chrome/browser/ui/webui/ntp/thumbnail_source.cc b/chrome/browser/ui/webui/ntp/thumbnail_source.cc
index a14239f57937830d2d94e0f65a5baf0d554bdeed..f3a1c6d93073f2ee4b2be95fe1cc9c536789eea6 100644
--- a/chrome/browser/ui/webui/ntp/thumbnail_source.cc
+++ b/chrome/browser/ui/webui/ntp/thumbnail_source.cc
@@ -20,17 +20,17 @@
using content::BrowserThread;
// Set ThumbnailService now as Profile isn't thread safe.
-ThumbnailSource::ThumbnailSource(Profile* profile, bool prefix_match)
+ThumbnailSource::ThumbnailSource(Profile* profile, bool capture_thumbnails)
: thumbnail_service_(ThumbnailServiceFactory::GetForProfile(profile)),
profile_(profile),
- prefix_match_(prefix_match) {
+ capture_thumbnails_(capture_thumbnails) {
}
ThumbnailSource::~ThumbnailSource() {
}
std::string ThumbnailSource::GetSource() const {
- return prefix_match_ ?
+ return capture_thumbnails_ ?
chrome::kChromeUIThumbnailHost2 : chrome::kChromeUIThumbnailHost;
}
@@ -40,12 +40,15 @@ void ThumbnailSource::StartDataRequest(
int render_view_id,
const content::URLDataSource::GotDataCallback& callback) {
scoped_refptr<base::RefCountedMemory> data;
- if (thumbnail_service_->GetPageThumbnail(GURL(path), prefix_match_, &data)) {
+ if (thumbnail_service_->GetPageThumbnail(GURL(path), capture_thumbnails_,
+ &data)) {
// We have the thumbnail.
callback.Run(data.get());
} else {
callback.Run(default_thumbnail_.get());
}
+ if (capture_thumbnails_)
+ thumbnail_service_->AddForcedURL(GURL(path));
}
std::string ThumbnailSource::GetMimeType(const std::string&) const {
« no previous file with comments | « chrome/browser/ui/webui/ntp/thumbnail_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698