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

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: Addressed comments Created 7 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
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 <list>
8
9 #include "base/bind.h"
10 #include "chrome/browser/history/history_types.h"
11 #include "chrome/browser/history/top_sites.h"
12 #include "url/gurl.h"
13
14 namespace history {
15
16 namespace {
17
18 void OnMostVisitedURLsReceived(
19 precache::URLListProvider::GetURLsCallback callback,
20 const MostVisitedURLList& most_visited_urls) {
21 std::list<GURL> urls;
22 for (MostVisitedURLList::const_iterator it = most_visited_urls.begin();
23 it != most_visited_urls.end(); ++it) {
24 urls.push_back(it->url);
25 }
26 callback.Run(urls);
27 }
28
29 } // namespace
30
31 MostVisitedURLsProvider::MostVisitedURLsProvider(TopSites* top_sites)
32 : top_sites_(top_sites) {}
33
34 MostVisitedURLsProvider::~MostVisitedURLsProvider() {}
35
36 void MostVisitedURLsProvider::GetURLs(const GetURLsCallback& callback) {
37 top_sites_->GetMostVisitedURLs(
38 base::Bind(&OnMostVisitedURLsReceived, callback));
39 }
40
41 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698