Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Brave News]: Implement basic version of new Feed Building logic #19664

Merged
merged 19 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions components/brave_news/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ static_library("browser") {
"publishers_controller.h",
"publishers_parsing.cc",
"publishers_parsing.h",
"signal_calculator.cc",
"signal_calculator.h",
"suggestions_controller.cc",
"suggestions_controller.h",
"unsupported_publisher_migrator.cc",
Expand Down
4 changes: 3 additions & 1 deletion components/brave_news/browser/brave_news_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ BraveNewsController::BraveNewsController(
api_request_helper_(GetNetworkTrafficAnnotationTag(), url_loader_factory),
private_cdn_request_helper_(GetNetworkTrafficAnnotationTag(),
url_loader_factory),
history_service_(history_service),
url_loader_factory_(url_loader_factory),
direct_feed_controller_(prefs_, url_loader_factory),
unsupported_publisher_migrator_(prefs_,
Expand Down Expand Up @@ -183,7 +184,8 @@ void BraveNewsController::GetFeedV2(GetFeedV2Callback callback) {

if (!feed_v2_builder_) {
feed_v2_builder_ = std::make_unique<FeedV2Builder>(
publishers_controller_, channels_controller_, url_loader_factory_);
publishers_controller_, channels_controller_, suggestions_controller_,
*prefs_.get(), *history_service_.get(), url_loader_factory_);
}

feed_v2_builder_->Build(std::move(callback));
Expand Down
1 change: 1 addition & 0 deletions components/brave_news/browser/brave_news_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class BraveNewsController : public KeyedService,
raw_ptr<brave_ads::AdsService> ads_service_ = nullptr;
api_request_helper::APIRequestHelper api_request_helper_;
brave_private_cdn::PrivateCDNRequestHelper private_cdn_request_helper_;
raw_ptr<history::HistoryService> history_service_;
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;

DirectFeedController direct_feed_controller_;
Expand Down
1 change: 1 addition & 0 deletions components/brave_news/browser/channels_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ using Channels = base::flat_map<std::string, mojom::ChannelPtr>;
using ChannelsCallback = base::OnceCallback<void(Channels)>;

constexpr char kTopSourcesChannel[] = "Top Sources";
constexpr char kTopNewsChannel[] = "Top News";

class ChannelsController : public PublishersController::Observer {
public:
Expand Down
Loading