| Index: chrome/browser/history/top_sites_extension_api.cc
|
| diff --git a/chrome/browser/history/top_sites_extension_api.cc b/chrome/browser/history/top_sites_extension_api.cc
|
| index 6a8c4b2f69deb44f3b4a843a9f4b7d12b42fae7d..a016440ef71613253fc3231e0542dadfcfb39b1d 100644
|
| --- a/chrome/browser/history/top_sites_extension_api.cc
|
| +++ b/chrome/browser/history/top_sites_extension_api.cc
|
| @@ -29,24 +29,19 @@ bool GetTopSitesFunction::RunImpl() {
|
|
|
| void GetTopSitesFunction::OnMostVisitedURLsAvailable(
|
| const history::MostVisitedURLList& data) {
|
| - // Code is a direct rip from most_visited_handler.cc TODO(estade): unfork.
|
| scoped_ptr<base::ListValue> pages_value(new ListValue);
|
| for (size_t i = 0; i < data.size(); i++) {
|
| const history::MostVisitedURL& url = data[i];
|
| DictionaryValue* page_value = new DictionaryValue();
|
| - if (url.url.is_empty()) {
|
| - page_value->SetBoolean("filler", true);
|
| + if (!url.url.is_empty()) {
|
| + page_value->SetString("url", url.url.spec());
|
| + if (url.title.empty())
|
| + page_value->SetString("title", url.url.spec());
|
| + else
|
| + page_value->SetString("title", url.title);
|
| pages_value->Append(page_value);
|
| - continue;
|
| }
|
| -
|
| - NewTabUI::SetURLTitleAndDirection(page_value,
|
| - url.title,
|
| - url.url);
|
| -
|
| - pages_value->Append(page_value);
|
| }
|
| - // End copied code. ----------------------------------------------------------
|
|
|
| result_.reset(pages_value.release());
|
| SendResponse(true);
|
|
|