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

Unified Diff: chrome/browser/ui/webui/ntp/thumbnail_list_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/thumbnails/thumbnail_service_impl.cc ('k') | chrome/browser/ui/webui/ntp/thumbnail_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/thumbnail_list_source.cc
diff --git a/chrome/browser/ui/webui/ntp/thumbnail_list_source.cc b/chrome/browser/ui/webui/ntp/thumbnail_list_source.cc
index ee5a86292aaee376878f00786ed528701686b604..f4be12d3f1a3ba26f9d3e8b54e29487cefdaefdb 100644
--- a/chrome/browser/ui/webui/ntp/thumbnail_list_source.cc
+++ b/chrome/browser/ui/webui/ntp/thumbnail_list_source.cc
@@ -39,9 +39,17 @@ void RenderMostVisitedURLList(
bool want_thumbnails,
std::vector<std::string>* out) {
DCHECK_EQ(mvurl_list.size(), base64_encoded_pngs.size());
- out->push_back("<div><ul>\n");
+ bool doing_forced_urls = true;
+ out->push_back("<div><b>Forced URLs:</b></div>\n"
+ "<div><ul>\n");
for (size_t i = 0; i < mvurl_list.size(); ++i) {
const history::MostVisitedURL& mvurl = mvurl_list[i];
+ if (doing_forced_urls && mvurl.last_forced_time.is_null()) {
+ out->push_back("</ul></div>\n"
+ "<div><b>Non-forced URLs:</b></div>\n"
+ "<div><ul>\n");
+ doing_forced_urls = false;
+ }
bool has_thumbnail = !base64_encoded_pngs[i].empty();
if (has_thumbnail == want_thumbnails) {
out->push_back("<li>\n");
@@ -89,7 +97,7 @@ void ThumbnailListSource::StartDataRequest(
profile_->GetTopSites()->GetMostVisitedURLs(
base::Bind(&ThumbnailListSource::OnMostVisitedURLsAvailable,
weak_ptr_factory_.GetWeakPtr(),
- callback), false);
+ callback), true);
}
std::string ThumbnailListSource::GetMimeType(const std::string& path) const {
« no previous file with comments | « chrome/browser/thumbnails/thumbnail_service_impl.cc ('k') | chrome/browser/ui/webui/ntp/thumbnail_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698