Commit 96c03256 authored by sfiera's avatar sfiera Committed by Commit bot

Pass PopularSites ownership to MostVisitedSites.

Nothing outside of MostVisitedSites needs to use it.

Review-Url: https://codereview.chromium.org/2337893003
Cr-Commit-Position: refs/heads/master@{#418625}
parent 2a2a1fcd
......@@ -12,6 +12,7 @@
#include "base/android/scoped_java_ref.h"
#include "base/bind.h"
#include "base/callback.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/android/ntp/popular_sites.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/history/top_sites_factory.h"
......@@ -158,17 +159,17 @@ void MostVisitedSitesBridge::JavaObserver::OnPopularURLsAvailable(
MostVisitedSitesBridge::MostVisitedSitesBridge(Profile* profile)
: supervisor_(profile),
popular_sites_(BrowserThread::GetBlockingPool(),
profile->GetPrefs(),
TemplateURLServiceFactory::GetForProfile(profile),
g_browser_process->variations_service(),
profile->GetRequestContext(),
ChromePopularSites::GetDirectory(),
base::Bind(safe_json::SafeJsonParser::Parse)),
most_visited_(profile->GetPrefs(),
TopSitesFactory::GetForProfile(profile),
SuggestionsServiceFactory::GetForProfile(profile),
&popular_sites_,
base::MakeUnique<ntp_tiles::PopularSites>(
BrowserThread::GetBlockingPool(),
profile->GetPrefs(),
TemplateURLServiceFactory::GetForProfile(profile),
g_browser_process->variations_service(),
profile->GetRequestContext(),
ChromePopularSites::GetDirectory(),
base::Bind(safe_json::SafeJsonParser::Parse)),
&supervisor_) {
// Register the thumbnails debugging page.
// TODO(sfiera): find thumbnails a home. They don't belong here.
......
......@@ -83,7 +83,6 @@ class MostVisitedSitesBridge {
};
SupervisorBridge supervisor_;
ntp_tiles::PopularSites popular_sites_;
ntp_tiles::MostVisitedSites most_visited_;
DISALLOW_COPY_AND_ASSIGN(MostVisitedSitesBridge);
......
......@@ -143,12 +143,12 @@ std::string GetSourceHistogramName(int source) {
MostVisitedSites::MostVisitedSites(PrefService* prefs,
scoped_refptr<history::TopSites> top_sites,
SuggestionsService* suggestions,
PopularSites* popular_sites,
std::unique_ptr<PopularSites> popular_sites,
MostVisitedSitesSupervisor* supervisor)
: prefs_(prefs),
top_sites_(top_sites),
suggestions_service_(suggestions),
popular_sites_(popular_sites),
popular_sites_(std::move(popular_sites)),
supervisor_(supervisor),
observer_(nullptr),
num_sites_(0),
......
......@@ -119,7 +119,7 @@ class MostVisitedSites : public history::TopSitesObserver,
MostVisitedSites(PrefService* prefs,
scoped_refptr<history::TopSites> top_sites,
suggestions::SuggestionsService* suggestions,
PopularSites* popular_sites,
std::unique_ptr<PopularSites> popular_sites,
MostVisitedSitesSupervisor* supervisor);
~MostVisitedSites() override;
......@@ -195,7 +195,7 @@ class MostVisitedSites : public history::TopSitesObserver,
PrefService* prefs_;
scoped_refptr<history::TopSites> top_sites_;
suggestions::SuggestionsService* suggestions_service_;
PopularSites* const popular_sites_;
std::unique_ptr<PopularSites> const popular_sites_;
MostVisitedSitesSupervisor* supervisor_;
Observer* observer_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment