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

Unified Diff: chrome/browser/android/most_visited_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: review2 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
« no previous file with comments | « chrome/browser/android/favicon_helper.cc ('k') | chrome/browser/android/popular_sites.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/most_visited_sites.cc
diff --git a/chrome/browser/android/most_visited_sites.cc b/chrome/browser/android/most_visited_sites.cc
index 5a808145ca76498556a03e85b886faf8d55c87d2..7c8a6ae5d827610776fd1868912f0a4c6f9dcda0 100644
--- a/chrome/browser/android/most_visited_sites.cc
+++ b/chrome/browser/android/most_visited_sites.cc
@@ -452,8 +452,21 @@ void MostVisitedSites::OnPopularSitesAvailable(bool success) {
return;
}
- if (!observer_.is_null())
- QueryMostVisitedURLs();
+ if (observer_.is_null())
+ return;
+
+ std::vector<std::string> urls;
+ std::vector<std::string> favicon_urls;
+ for (const PopularSites::Site& popular_site : popular_sites_->sites()) {
+ urls.push_back(popular_site.url.spec());
+ favicon_urls.push_back(popular_site.favicon_url.spec());
+ }
+ JNIEnv* env = AttachCurrentThread();
+ Java_MostVisitedURLsObserver_onPopularURLsAvailable(
+ env, observer_.obj(), ToJavaArrayOfStrings(env, urls).obj(),
+ ToJavaArrayOfStrings(env, favicon_urls).obj());
+
+ QueryMostVisitedURLs();
}
void MostVisitedSites::RecordUMAMetrics() {
« no previous file with comments | « chrome/browser/android/favicon_helper.cc ('k') | chrome/browser/android/popular_sites.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698