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

Side by Side Diff: chrome/browser/history/most_visited_urls_provider.cc

Issue 27047003: Precache tracking database (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@precache
Patch Set: General fixes, added tests, and moved PrecacheManager into component Created 7 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
bengr 2013/10/23 19:03:36 2012 -> 2013. Remove the '(c)' too.
sclittle 2013/10/24 22:11:38 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/history/most_visited_urls_provider.h"
6
7 #include "base/bind.h"
8 #include "chrome/browser/history/top_sites.h"
9
10 namespace history {
11
12 MostVisitedURLsProvider::MostVisitedURLsProvider(TopSites* top_sites)
bengr 2013/10/23 19:03:36 Can this be a const reference?
sclittle 2013/10/24 22:11:38 Unfortunately, no. We need a non-const TopSites in
13 : top_sites_(top_sites) {}
14 MostVisitedURLsProvider::~MostVisitedURLsProvider() {}
15
16 void MostVisitedURLsProvider::GetInterestingURLs(
17 const base::Callback<void(const std::list<GURL>&)>& callback) {
18 top_sites_->GetMostVisitedURLs(
19 base::Bind(&MostVisitedURLsProvider::OnMostVisitedURLsReceived,
20 AsWeakPtr(), callback));
21 }
22
23 void MostVisitedURLsProvider::OnMostVisitedURLsReceived(
24 base::Callback<void(const std::list<GURL>&)> callback,
bengr 2013/10/23 19:03:36 typedef this in the interface.
sclittle 2013/10/24 22:11:38 Done.
25 const MostVisitedURLList& most_visited_urls) {
26 std::list<GURL> urls;
27 for (MostVisitedURLList::const_iterator it = most_visited_urls.begin();
28 it != most_visited_urls.end(); ++it) {
29 urls.push_back(it->url);
30 }
31 callback.Run(urls);
32 }
33
34 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698