diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-31 20:22:14 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-31 20:22:14 +0000 |
commit | bb5e0001628e91fccba24c07d5767e3faa0c8c43 (patch) | |
tree | 82e770800105aaae8a4a1bf41cdb9edd9a5b2e7b /chrome/browser/prerender/prerender_manager.cc | |
parent | 529444786da3986862f39d3c5401711a956b6f1a (diff) | |
download | chromium_src-bb5e0001628e91fccba24c07d5767e3faa0c8c43.zip chromium_src-bb5e0001628e91fccba24c07d5767e3faa0c8c43.tar.gz chromium_src-bb5e0001628e91fccba24c07d5767e3faa0c8c43.tar.bz2 |
Remove Prerender.PageviewEvents histogram.
This also removes the top sites related classes that are no longer needed.
BUG=136376
Review URL: https://chromiumcodereview.appspot.com/10407038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139853 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prerender/prerender_manager.cc')
-rw-r--r-- | chrome/browser/prerender/prerender_manager.cc | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc index 2e738773..2e6759b 100644 --- a/chrome/browser/prerender/prerender_manager.cc +++ b/chrome/browser/prerender/prerender_manager.cc @@ -20,7 +20,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/cancelable_request.h" #include "chrome/browser/favicon/favicon_tab_helper.h" -#include "chrome/browser/history/top_sites.h" #include "chrome/browser/prerender/prerender_condition.h" #include "chrome/browser/prerender/prerender_contents.h" #include "chrome/browser/prerender/prerender_field_trial.h" @@ -195,60 +194,6 @@ struct PrerenderManager::NavigationRecord { } }; -class PrerenderManager::MostVisitedSites - : public content::NotificationObserver { - public: - explicit MostVisitedSites(Profile* profile) : - profile_(profile) { - history::TopSites* top_sites = GetTopSites(); - if (top_sites) { - registrar_.Add(this, chrome::NOTIFICATION_TOP_SITES_CHANGED, - content::Source<history::TopSites>(top_sites)); - } - - UpdateMostVisited(); - } - - void UpdateMostVisited() { - history::TopSites* top_sites = GetTopSites(); - if (top_sites) { - top_sites->GetMostVisitedURLs( - &topsites_consumer_, - base::Bind(&prerender::PrerenderManager::MostVisitedSites:: - OnMostVisitedURLsAvailable, base::Unretained(this))); - } - } - - void OnMostVisitedURLsAvailable(const history::MostVisitedURLList& data) { - urls_.clear(); - for (int i = 0; i < static_cast<int>(data.size()); i++) - urls_.insert(data[i].url); - } - - void Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) { - DCHECK_EQ(type, chrome::NOTIFICATION_TOP_SITES_CHANGED); - UpdateMostVisited(); - } - - bool IsTopSite(const GURL& url) const { - return (urls_.count(url) > 0); - } - - private: - history::TopSites* GetTopSites() const { - if (profile_) - return profile_->GetTopSites(); - return NULL; - } - - CancelableRequestConsumer topsites_consumer_; - Profile* profile_; - content::NotificationRegistrar registrar_; - std::set<GURL> urls_; -}; - PrerenderManager::PrerenderManager(Profile* profile, PrerenderTracker* prerender_tracker) : enabled_(true), @@ -825,12 +770,6 @@ void PrerenderManager::AddCondition(const PrerenderCondition* condition) { prerender_conditions_.push_back(condition); } -bool PrerenderManager::IsTopSite(const GURL& url) { - if (!most_visited_.get()) - most_visited_.reset(new MostVisitedSites(profile_)); - return most_visited_->IsTopSite(url); -} - bool PrerenderManager::IsPendingEntry(const GURL& url) const { DCHECK(CalledOnValidThread()); for (PrerenderContentsDataList::const_iterator it = prerender_list_.begin(); |