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

Unified Diff: chrome/browser/history/top_sites_extension_api.cc

Issue 9721013: Move topSites API out of experimental (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge Created 8 years, 9 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/history/top_sites_extension_api.h ('k') | chrome/common/common_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « chrome/browser/history/top_sites_extension_api.h ('k') | chrome/common/common_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698