Commit 959f98b1 authored by srvasude@chromium.org's avatar srvasude@chromium.org

Moved Discovery out of the Suggested Page


BUG=none
TEST=none


Review URL: https://chromiumcodereview.appspot.com/10825020

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148564 0039d316-1c4b-4281-b951-d872f2087c98
parent a9386651
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "chrome/browser/ui/webui/ntp/suggestions_page_handler.h" #include "chrome/browser/ui/webui/ntp/suggestions_page_handler.h"
#include "chrome/browser/ui/webui/ntp/suggestions_source.h" #include "chrome/browser/ui/webui/ntp/suggestions_source.h"
#include "chrome/browser/ui/webui/ntp/suggestions_source_discovery.h" #include "chrome/browser/ui/webui/ntp/suggestions_source_discovery.h"
#include "chrome/browser/ui/webui/ntp/suggestions_source_top_sites.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
namespace { namespace {
...@@ -80,8 +79,6 @@ void SuggestionsCombiner::SetSuggestionsCount(size_t suggestions_count) { ...@@ -80,8 +79,6 @@ void SuggestionsCombiner::SetSuggestionsCount(size_t suggestions_count) {
SuggestionsCombiner* SuggestionsCombiner::Create( SuggestionsCombiner* SuggestionsCombiner::Create(
SuggestionsCombiner::Delegate* delegate, Profile* profile) { SuggestionsCombiner::Delegate* delegate, Profile* profile) {
SuggestionsCombiner* combiner = new SuggestionsCombiner(delegate, profile); SuggestionsCombiner* combiner = new SuggestionsCombiner(delegate, profile);
combiner->AddSource(new SuggestionsSourceTopSites());
extensions::SuggestedLinksRegistry* registry = extensions::SuggestedLinksRegistry* registry =
extensions::SuggestedLinksRegistryFactory::GetForProfile(profile); extensions::SuggestedLinksRegistryFactory::GetForProfile(profile);
scoped_ptr<std::vector<std::string> > list = registry->GetExtensionIds(); scoped_ptr<std::vector<std::string> > list = registry->GetExtensionIds();
......
...@@ -37,6 +37,9 @@ class SuggestionsCombiner { ...@@ -37,6 +37,9 @@ class SuggestionsCombiner {
virtual ~SuggestionsCombiner(); virtual ~SuggestionsCombiner();
explicit SuggestionsCombiner(SuggestionsCombiner::Delegate* delegate,
Profile* profile);
// Add a new source. The SuggestionsCombiner takes ownership of |source|. // Add a new source. The SuggestionsCombiner takes ownership of |source|.
void AddSource(SuggestionsSource* source); void AddSource(SuggestionsSource* source);
...@@ -65,9 +68,6 @@ class SuggestionsCombiner { ...@@ -65,9 +68,6 @@ class SuggestionsCombiner {
private: private:
friend class SuggestionsCombinerTest; friend class SuggestionsCombinerTest;
explicit SuggestionsCombiner(SuggestionsCombiner::Delegate* delegate,
Profile* profile);
// Fill the page values from the suggestion sources so they can be sent to // Fill the page values from the suggestion sources so they can be sent to
// the JavaScript side. This should only be called when all the suggestion // the JavaScript side. This should only be called when all the suggestion
// sources have items ready. // sources have items ready.
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "chrome/browser/ui/webui/favicon_source.h" #include "chrome/browser/ui/webui/favicon_source.h"
#include "chrome/browser/ui/webui/ntp/suggestions_combiner.h" #include "chrome/browser/ui/webui/ntp/suggestions_combiner.h"
#include "chrome/browser/ui/webui/ntp/ntp_stats.h" #include "chrome/browser/ui/webui/ntp/ntp_stats.h"
#include "chrome/browser/ui/webui/ntp/suggestions_source_top_sites.h"
#include "chrome/browser/ui/webui/ntp/thumbnail_source.h" #include "chrome/browser/ui/webui/ntp/thumbnail_source.h"
#include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_notification_types.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
...@@ -82,7 +83,9 @@ void SuggestionsHandler::RegisterMessages() { ...@@ -82,7 +83,9 @@ void SuggestionsHandler::RegisterMessages() {
} }
// Setup the suggestions sources. // Setup the suggestions sources.
suggestions_combiner_.reset(SuggestionsCombiner::Create(this, profile)); SuggestionsCombiner* combiner = new SuggestionsCombiner(this, profile);
combiner->AddSource(new SuggestionsSourceTopSites());
suggestions_combiner_.reset(combiner);
// We pre-emptively make a fetch for suggestions so we have the results // We pre-emptively make a fetch for suggestions so we have the results
// sooner. // sooner.
......
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