| Index: chrome/browser/history/most_visited_urls_provider.cc
|
| diff --git a/chrome/browser/history/most_visited_urls_provider.cc b/chrome/browser/history/most_visited_urls_provider.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7d50961798b7adaf821002c2ad5ee4ac22ccaf74
|
| --- /dev/null
|
| +++ b/chrome/browser/history/most_visited_urls_provider.cc
|
| @@ -0,0 +1,41 @@
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/history/most_visited_urls_provider.h"
|
| +
|
| +#include <list>
|
| +
|
| +#include "base/bind.h"
|
| +#include "chrome/browser/history/history_types.h"
|
| +#include "chrome/browser/history/top_sites.h"
|
| +#include "url/gurl.h"
|
| +
|
| +namespace history {
|
| +
|
| +namespace {
|
| +
|
| +void OnMostVisitedURLsReceived(
|
| + precache::URLListProvider::GetURLsCallback callback,
|
| + const MostVisitedURLList& most_visited_urls) {
|
| + std::list<GURL> urls;
|
| + for (MostVisitedURLList::const_iterator it = most_visited_urls.begin();
|
| + it != most_visited_urls.end(); ++it) {
|
| + urls.push_back(it->url);
|
| + }
|
| + callback.Run(urls);
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| +MostVisitedURLsProvider::MostVisitedURLsProvider(TopSites* top_sites)
|
| + : top_sites_(top_sites) {}
|
| +
|
| +MostVisitedURLsProvider::~MostVisitedURLsProvider() {}
|
| +
|
| +void MostVisitedURLsProvider::GetURLs(const GetURLsCallback& callback) {
|
| + top_sites_->GetMostVisitedURLs(
|
| + base::Bind(&OnMostVisitedURLsReceived, callback));
|
| +}
|
| +
|
| +} // namespace history
|
|
|