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

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

Issue 10115001: Added page score to the ntp suggestions tab. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comment Created 8 years, 8 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/ui/webui/ntp/suggestions_page_handler.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/suggestions_page_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc b/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc
index 9576930700c838c38ec0cd802afd86415f60f857..9dced91bdd0e7deff0cb669da914dde576392c82 100644
--- a/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc
+++ b/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc
@@ -182,10 +182,10 @@ void SuggestionsHandler::HandleSuggestedSitesSelected(
}
void SuggestionsHandler::SetPagesValueFromTopSites(
- const history::MostVisitedURLList& data) {
+ const history::FilteredURLList& data) {
pages_value_.reset(new ListValue());
for (size_t i = 0; i < data.size(); i++) {
- const history::MostVisitedURL& suggested_url = data[i];
+ const history::FilteredURL& suggested_url = data[i];
if (suggested_url.url.is_empty())
continue;
@@ -193,13 +193,14 @@ void SuggestionsHandler::SetPagesValueFromTopSites(
NewTabUI::SetURLTitleAndDirection(page_value,
suggested_url.title,
suggested_url.url);
+ page_value->SetDouble("score", suggested_url.score);
pages_value_->Append(page_value);
}
}
void SuggestionsHandler::OnSuggestionsURLsAvailable(
CancelableRequestProvider::Handle handle,
- history::MostVisitedURLList data) {
+ const history::FilteredURLList& data) {
SetPagesValueFromTopSites(data);
if (got_first_suggestions_request_)
SendPagesValue();
« no previous file with comments | « chrome/browser/ui/webui/ntp/suggestions_page_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698