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

Unified Diff: chrome/browser/android/popular_sites.cc

Issue 1272883004: Popular sites on the NTP: Favicons! (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enable_popular_sites
Patch Set: . Created 5 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/android/popular_sites.cc
diff --git a/chrome/browser/android/popular_sites.cc b/chrome/browser/android/popular_sites.cc
index ef7f26c46333d79b6f43c11310ba16debf2ff0eb..b3793ca40158f4282f309c1374fbd8ebfe9ac1d8 100644
--- a/chrome/browser/android/popular_sites.cc
+++ b/chrome/browser/android/popular_sites.cc
@@ -21,7 +21,7 @@ namespace {
const char kPopularSitesFilename[] = "ntp-popular-sites.json";
const char kPopularSitesURL[] =
- "https://www.gstatic.com/chrome/ntp/suggested_sites_IN_0.json";
+ "https://www.gstatic.com/chrome/ntp/suggested_sites_IN_1.json";
base::FilePath GetPopularSitesPath() {
base::FilePath dir;
@@ -55,7 +55,9 @@ scoped_ptr<std::vector<PopularSites::Site>> ReadAndParseJsonFile(
std::string url;
if (!item->GetString("title", &title) || !item->GetString("url", &url))
continue;
- sites->push_back(PopularSites::Site(title, GURL(url)));
+ std::string favicon_url;
+ item->GetString("favicon_url", &favicon_url);
+ sites->push_back(PopularSites::Site(title, GURL(url), GURL(favicon_url)));
}
return sites.Pass();
@@ -63,8 +65,10 @@ scoped_ptr<std::vector<PopularSites::Site>> ReadAndParseJsonFile(
} // namespace
-PopularSites::Site::Site(const base::string16& title, const GURL& url)
- : title(title), url(url) {}
+PopularSites::Site::Site(const base::string16& title,
+ const GURL& url,
+ const GURL& favicon_url)
+ : title(title), url(url), favicon_url(favicon_url) {}
PopularSites::PopularSites(net::URLRequestContextGetter* request_context,
const FinishedCallback& callback)
« chrome/browser/android/most_visited_sites.cc ('K') | « chrome/browser/android/popular_sites.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698