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

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 comments. 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
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 ee86fd525eaeab4960362048f160166177cc6031..d8509ebf85b946d3141fd18db0c176dd6a67fc36 100644
--- a/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc
+++ b/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc
@@ -207,10 +207,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;
@@ -218,13 +218,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();

Powered by Google App Engine
This is Rietveld 408576698