Skip to content

Commit

Permalink
Reconfigure Rewards component folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
zenparsing committed Jan 17, 2025
1 parent 9aee54d commit be5d45a
Show file tree
Hide file tree
Showing 717 changed files with 3,863 additions and 3,951 deletions.
8 changes: 4 additions & 4 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ browser/ui/webui/brave_rewards_ui.cc @brave/rewards-client
browser/ui/webui/brave_rewards_ui.h @brave/rewards-client
components/brave_rewards/ @brave/rewards-client
components/services/bat_rewards/ @brave/rewards-client
components/brave_rewards/core/common/signer.cc @brave/sec-team
components/brave_rewards/core/common/signer.h @brave/sec-team
components/brave_rewards/core/common/request_signer.cc @brave/sec-team
components/brave_rewards/core/common/request_signer.h @brave/sec-team
components/brave_rewards/core/internal/common/signer.cc @brave/sec-team
components/brave_rewards/core/internal/common/signer.h @brave/sec-team
components/brave_rewards/core/internal/common/request_signer.cc @brave/sec-team
components/brave_rewards/core/internal/common/request_signer.h @brave/sec-team

# Ads
browser/brave_ads/**/*.cc @brave/ads-client
Expand Down
2 changes: 1 addition & 1 deletion .storybook/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ group("storybook") {
"//brave/components/ai_chat/core/common/mojom:mojom_js",
"//brave/components/brave_new_tab_ui:mojom_js",
"//brave/components/brave_news/common:mojom_js",
"//brave/components/brave_rewards/common/mojom:mojom_js",
"//brave/components/brave_rewards/core/mojom:mojom_js",
"//brave/components/brave_shields/core/common:mojom_js",
"//brave/components/brave_vpn/common/mojom:mojom_js",
"//brave/components/brave_wallet/common:mojom_js",
Expand Down
38 changes: 19 additions & 19 deletions android/android_browser_tests.gni
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@
# Tests that do not run on Android
android_test_exception_sources = [
"//brave/browser/brave_content_browser_client_browsertest.cc",
"//brave/browser/brave_rewards/test/rewards_browsertest.cc",
"//brave/browser/brave_rewards/test/rewards_contribution_browsertest.cc",
"//brave/browser/brave_rewards/test/rewards_flag_browsertest.cc",
"//brave/browser/brave_rewards/test/rewards_notification_browsertest.cc",
"//brave/browser/brave_rewards/test/rewards_p3a_browsertest.cc",
"//brave/browser/brave_rewards/test/rewards_publisher_browsertest.cc",
"//brave/browser/brave_rewards/test/rewards_state_browsertest.cc",
"//brave/browser/brave_rewards/test/util/rewards_browsertest_context_helper.cc",
"//brave/browser/brave_rewards/test/util/rewards_browsertest_context_helper.h",
"//brave/browser/brave_rewards/test/util/rewards_browsertest_context_util.cc",
"//brave/browser/brave_rewards/test/util/rewards_browsertest_context_util.h",
"//brave/browser/brave_rewards/test/util/rewards_browsertest_contribution.cc",
"//brave/browser/brave_rewards/test/util/rewards_browsertest_contribution.h",
"//brave/browser/brave_rewards/test/util/rewards_browsertest_network_util.cc",
"//brave/browser/brave_rewards/test/util/rewards_browsertest_network_util.h",
"//brave/browser/brave_rewards/test/util/rewards_browsertest_response.cc",
"//brave/browser/brave_rewards/test/util/rewards_browsertest_response.h",
"//brave/browser/brave_rewards/test/util/rewards_browsertest_util.cc",
"//brave/browser/brave_rewards/test/util/rewards_browsertest_util.h",
"//brave/browser/brave_scheme_load_browsertest.cc",
"//brave/browser/brave_search/brave_search_browsertest.cc",
"//brave/browser/brave_shields/brave_shields_web_contents_observer_browsertest.cc",
Expand Down Expand Up @@ -57,25 +76,6 @@ android_test_exception_sources = [
"//brave/chromium_src/chrome/browser/ui/views/location_bar/location_bar_view_browsertest.cc",
"//brave/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_browsertest.cc",
"//brave/components/brave_perf_predictor/browser/perf_predictor_tab_helper_browsertest.cc",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.cc",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.h",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.cc",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.h",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_contribution.cc",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_contribution.h",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.cc",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.h",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_response.cc",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_response.h",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.cc",
"//brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.h",
"//brave/components/brave_rewards/browser/test/rewards_browsertest.cc",
"//brave/components/brave_rewards/browser/test/rewards_contribution_browsertest.cc",
"//brave/components/brave_rewards/browser/test/rewards_flag_browsertest.cc",
"//brave/components/brave_rewards/browser/test/rewards_notification_browsertest.cc",
"//brave/components/brave_rewards/browser/test/rewards_p3a_browsertest.cc",
"//brave/components/brave_rewards/browser/test/rewards_publisher_browsertest.cc",
"//brave/components/brave_rewards/browser/test/rewards_state_browsertest.cc",
"//brave/components/content_settings/renderer/brave_content_settings_agent_impl_browsertest.cc",
"//brave/third_party/blink/renderer/modules/brave/navigator_browsertest.cc",
"//chrome/browser/extensions/browsertest_util.cc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class BraveRewardsBalance {

/**
* matching consts in
* src/brave/components/brave_rewards/browser/balance.h
* src/brave/components/brave_rewards/content/balance.h
*/
public static final String JSON_TOTAL = "total";
public static final String JSON_WALLETS = "wallets";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class BraveRewardsNativeWorker {
public interface PublisherObserver { void onFrontTabPublisherChanged(boolean verified); }

// Rewards notifications
// Taken from components/brave_rewards/browser/rewards_notification_service.h
// Taken from components/brave_rewards/content/rewards_notification_service.h
public static final int REWARDS_NOTIFICATION_INVALID = 0;
public static final int REWARDS_NOTIFICATION_AUTO_CONTRIBUTE = 1;
public static final int REWARDS_NOTIFICATION_FAILED_CONTRIBUTION = 4;
Expand Down
4 changes: 2 additions & 2 deletions browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ group("browser") {
visibility = [
"//brave:browser_dependencies",
"//brave/browser/*",
"//brave/components/brave_rewards/core:headers",
"//brave/components/brave_rewards/core/internal:headers",
"//brave/test:*",

# these are layering violation and need to be fixed
"//brave/components/brave_rewards/browser:testutil",
"//brave/components/brave_rewards/content:testutil",
"//brave/components/brave_rewards/test:brave_rewards_unit_tests",
]

Expand Down
4 changes: 2 additions & 2 deletions browser/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ include_rules += [
"+brave/components/brave_component_updater/browser",
"+brave/components/brave_news/browser",
"+brave/components/brave_news/common",
"+brave/components/brave_rewards/browser",
"+brave/components/brave_rewards/common",
"+brave/components/brave_rewards/content",
"+brave/components/brave_rewards/core",
"+brave/components/brave_shields/content/browser",
"+brave/components/brave_shields/core/common",
"+brave/components/brave_wallet/browser",
Expand Down
4 changes: 2 additions & 2 deletions browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include "brave/components/brave_ads/core/public/ads_feature.h"
#include "brave/components/brave_component_updater/browser/features.h"
#include "brave/components/brave_news/common/features.h"
#include "brave/components/brave_rewards/common/buildflags/buildflags.h"
#include "brave/components/brave_rewards/common/features.h"
#include "brave/components/brave_rewards/core/buildflags/buildflags.h"
#include "brave/components/brave_rewards/core/features.h"
#include "brave/components/brave_shields/core/common/features.h"
#include "brave/components/brave_vpn/common/buildflags/buildflags.h"
#include "brave/components/brave_wallet/common/features.h"
Expand Down
4 changes: 2 additions & 2 deletions browser/android/preferences/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ source_set("preferences") {
"//brave/components/brave_news/common",
"//brave/components/brave_perf_predictor/common",
"//brave/components/brave_referrals/common",
"//brave/components/brave_rewards/common",
"//brave/components/brave_rewards/core",
"//brave/components/brave_shields/content/browser",
"//brave/components/brave_sync:prefs",
"//brave/components/constants",
Expand All @@ -36,7 +36,7 @@ java_cpp_strings("java_pref_names_srcjar") {
sources = [
"//brave/components/ai_chat/core/common/pref_names.h",
"//brave/components/brave_adaptive_captcha/pref_names.h",
"//brave/components/brave_rewards/common/pref_names.h",
"//brave/components/brave_rewards/core/pref_names.h",
"//brave/components/brave_shields/core/common/pref_names.h",
"//brave/components/brave_vpn/common/pref_names.h",
"//brave/components/constants/pref_names.h",
Expand Down
2 changes: 1 addition & 1 deletion browser/android/preferences/brave_pref_service_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "brave/build/android/jni_headers/BravePrefServiceBridge_jni.h"
#include "brave/components/brave_news/common/pref_names.h"
#include "brave/components/brave_perf_predictor/common/pref_names.h"
#include "brave/components/brave_rewards/common/pref_names.h"
#include "brave/components/brave_rewards/core/pref_names.h"
#include "brave/components/brave_shields/content/browser/brave_shields_util.h"
#include "brave/components/brave_sync/brave_sync_prefs.h"
#include "brave/components/constants/pref_names.h"
Expand Down
4 changes: 2 additions & 2 deletions browser/brave_ads/creatives/search_result_ad/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ source_set("search_result_ad") {
"//brave/components/brave_ads/browser",
"//brave/components/brave_ads/content/browser",
"//brave/components/brave_ads/core",
"//brave/components/brave_rewards/common",
"//brave/components/brave_rewards/core",
"//brave/components/brave_search/common",
"//brave/components/vector_icons",
"//chrome/browser:browser_public_dependencies",
Expand Down Expand Up @@ -52,7 +52,7 @@ source_set("browser_tests") {
"//brave/components/brave_ads/core/mojom",
"//brave/components/brave_ads/core/mojom",
"//brave/components/brave_ads/core/public:headers",
"//brave/components/brave_rewards/common",
"//brave/components/brave_rewards/core",
"//chrome/browser/ui",
"//net:test_support",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "brave/components/brave_ads/core/browser/service/ads_service.h"
#include "brave/components/brave_ads/core/mojom/brave_ads.mojom.h"
#include "brave/components/brave_ads/core/public/ads_feature.h"
#include "brave/components/brave_rewards/common/pref_names.h"
#include "brave/components/brave_rewards/core/pref_names.h"
#include "brave/components/brave_search/common/brave_search_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_isolated_world_ids.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "brave/components/brave_ads/core/browser/service/ads_service.h"
#include "brave/components/brave_ads/core/mojom/brave_ads.mojom-forward.h"
#include "brave/components/brave_ads/core/public/ads_feature.h"
#include "brave/components/brave_rewards/common/pref_names.h"
#include "brave/components/brave_rewards/core/pref_names.h"
#include "brave/components/constants/brave_paths.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ssl/cert_verifier_browser_test.h"
Expand Down
4 changes: 2 additions & 2 deletions browser/brave_ads/tabs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ source_set("tabs") {
"//brave/browser/brave_ads",
"//brave/components/brave_ads/browser",
"//brave/components/brave_ads/core/public:headers",
"//brave/components/brave_rewards/common",
"//brave/components/brave_rewards/core",
"//chrome/browser/profiles:profile",
"//chrome/browser/ui",
"//chrome/common",
Expand All @@ -43,7 +43,7 @@ source_set("browser_tests") {
"//brave/browser/brave_ads",
"//brave/components/brave_ads/browser:test_support",
"//brave/components/brave_ads/core/public:headers",
"//brave/components/brave_rewards/common",
"//brave/components/brave_rewards/core",
"//chrome/browser/ui",
"//chrome/test:test_support",
"//chrome/test:test_support_ui",
Expand Down
2 changes: 1 addition & 1 deletion browser/brave_ads/tabs/ads_tab_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "brave/browser/brave_ads/ads_service_factory.h"
#include "brave/components/brave_ads/core/browser/service/ads_service.h"
#include "brave/components/brave_ads/core/public/prefs/pref_names.h"
#include "brave/components/brave_rewards/common/pref_names.h"
#include "brave/components/brave_rewards/core/pref_names.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_isolated_world_ids.h"
#include "components/prefs/pref_service.h"
Expand Down
2 changes: 1 addition & 1 deletion browser/brave_ads/tabs/ads_tab_helper_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "brave/browser/brave_ads/ads_service_factory.h"
#include "brave/components/brave_ads/browser/ads_service_mock.h"
#include "brave/components/brave_ads/core/public/prefs/pref_names.h"
#include "brave/components/brave_rewards/common/pref_names.h"
#include "brave/components/brave_rewards/core/pref_names.h"
#include "brave/components/constants/brave_paths.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
Expand Down
4 changes: 2 additions & 2 deletions browser/brave_browser_main_parts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "brave/browser/browsing_data/brave_clear_browsing_data.h"
#include "brave/browser/ethereum_remote_client/buildflags/buildflags.h"
#include "brave/components/brave_component_updater/browser/brave_on_demand_updater.h"
#include "brave/components/brave_rewards/common/rewards_flags.h"
#include "brave/components/brave_rewards/common/rewards_util.h"
#include "brave/components/brave_rewards/core/rewards_flags.h"
#include "brave/components/brave_rewards/core/rewards_util.h"
#include "brave/components/brave_sync/features.h"
#include "brave/components/constants/brave_constants.h"
#include "brave/components/constants/pref_names.h"
Expand Down
8 changes: 4 additions & 4 deletions browser/brave_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#include "brave/components/ai_rewriter/common/buildflags/buildflags.h"
#include "brave/components/body_sniffer/body_sniffer_throttle.h"
#include "brave/components/brave_federated/features.h"
#include "brave/components/brave_rewards/browser/rewards_protocol_navigation_throttle.h"
#include "brave/components/brave_rewards/content/rewards_protocol_navigation_throttle.h"
#include "brave/components/brave_search/browser/brave_search_default_host.h"
#include "brave/components/brave_search/browser/brave_search_default_host_private.h"
#include "brave/components/brave_search/browser/brave_search_fallback_host.h"
Expand Down Expand Up @@ -244,9 +244,9 @@ using extensions::ChromeContentBrowserClientExtensionsPart;
#include "brave/components/brave_news/common/brave_news.mojom.h"
#include "brave/components/brave_news/common/features.h"
#include "brave/components/brave_private_new_tab_ui/common/brave_private_new_tab.mojom.h"
#include "brave/components/brave_rewards/common/features.h"
#include "brave/components/brave_rewards/common/mojom/rewards_panel.mojom.h"
#include "brave/components/brave_rewards/common/mojom/rewards_tip_panel.mojom.h"
#include "brave/components/brave_rewards/core/features.h"
#include "brave/components/brave_rewards/core/mojom/rewards_panel.mojom.h"
#include "brave/components/brave_rewards/core/mojom/rewards_tip_panel.mojom.h"
#include "brave/components/brave_shields/core/common/brave_shields_panel.mojom.h"
#include "brave/components/brave_shields/core/common/cookie_list_opt_in.mojom.h"
#include "brave/components/commands/common/commands.mojom.h"
Expand Down
2 changes: 1 addition & 1 deletion browser/brave_news/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ source_set("browser_tests") {
]

deps = [
"//brave/components//brave_rewards/browser",
"//brave/components/brave_news/browser",
"//brave/components/brave_news/common:common",
"//brave/components/brave_news/common:mojom",
"//brave/components/brave_rewards/content",
"//brave/components/constants",
"//chrome/browser",
"//chrome/browser:browser_process",
Expand Down
2 changes: 1 addition & 1 deletion browser/brave_prefs_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "base/feature_list.h"
#include "brave/browser/ethereum_remote_client/buildflags/buildflags.h"
#include "brave/browser/metrics/buildflags/buildflags.h"
#include "brave/components/brave_rewards/common/pref_names.h"
#include "brave/components/brave_rewards/core/pref_names.h"
#include "brave/components/brave_shields/core/common/features.h"
#include "brave/components/brave_shields/core/common/pref_names.h"
#include "brave/components/brave_vpn/common/buildflags/buildflags.h"
Expand Down
4 changes: 2 additions & 2 deletions browser/brave_profile_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include "brave/components/brave_news/common/pref_names.h"
#include "brave/components/brave_perf_predictor/browser/p3a_bandwidth_savings_tracker.h"
#include "brave/components/brave_perf_predictor/browser/perf_predictor_tab_helper.h"
#include "brave/components/brave_rewards/common/pref_names.h"
#include "brave/components/brave_rewards/common/pref_registry.h"
#include "brave/components/brave_rewards/core/pref_names.h"
#include "brave/components/brave_rewards/core/pref_registry.h"
#include "brave/components/brave_search/browser/brave_search_default_host.h"
#include "brave/components/brave_search/common/brave_search_utils.h"
#include "brave/components/brave_search_conversion/utils.h"
Expand Down
12 changes: 6 additions & 6 deletions browser/brave_rewards/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2022 The Brave Authors. All rights reserved.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/. */
# You can obtain one at https://mozilla.org/MPL/2.0/. */

import("//extensions/buildflags/buildflags.gni")
import("//testing/test.gni")
Expand All @@ -15,7 +15,7 @@ source_set("brave_rewards") {

deps = [
"//base",
"//brave/components/brave_rewards/browser",
"//brave/components/brave_rewards/content",
"//brave/components/script_injector/common/mojom",
"//chrome/browser/profiles",
"//components/keyed_service/content",
Expand All @@ -40,9 +40,9 @@ source_set("brave_rewards_impl") {
"//base",
"//brave/browser/brave_wallet",
"//brave/browser/ui:brave_rewards_source",
"//brave/components/brave_rewards/browser",
"//brave/components/brave_rewards/common",
"//brave/components/brave_rewards/common:features",
"//brave/components/brave_rewards/content",
"//brave/components/brave_rewards/core",
"//brave/components/brave_rewards/core:features",
"//brave/components/brave_rewards/resources/creator_detection:creator_detection_generated_grit",
"//chrome/browser/bitmap_fetcher",
"//chrome/browser/favicon",
Expand Down Expand Up @@ -77,7 +77,7 @@ source_set("util") {
]

deps = [
"//brave/components/brave_rewards/common",
"//brave/components/brave_rewards/core",
"//chrome/browser/profiles:profile",
"//components/prefs",
]
Expand Down
2 changes: 1 addition & 1 deletion browser/brave_rewards/DEPS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include_rules = [
"+brave/components/brave_rewards/core",
"+brave/components/brave_rewards/core/internal",
"+brave/components/brave_rewards/resources",
"+brave/components/script_injector/common",
]
14 changes: 7 additions & 7 deletions browser/brave_rewards/android/brave_rewards_native_worker.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
* You can obtain one at https://mozilla.org/MPL/2.0/. */

#include "brave/browser/brave_rewards/android/brave_rewards_native_worker.h"

Expand All @@ -22,12 +22,12 @@
#include "brave/components/brave_adaptive_captcha/server_util.h"
#include "brave/components/brave_ads/core/browser/service/ads_service.h"
#include "brave/components/brave_ads/core/public/prefs/pref_names.h"
#include "brave/components/brave_rewards/browser/rewards_p3a.h"
#include "brave/components/brave_rewards/browser/rewards_service.h"
#include "brave/components/brave_rewards/common/features.h"
#include "brave/components/brave_rewards/common/pref_names.h"
#include "brave/components/brave_rewards/common/rewards_util.h"
#include "brave/components/brave_rewards/core/global_constants.h"
#include "brave/components/brave_rewards/content/rewards_p3a.h"
#include "brave/components/brave_rewards/content/rewards_service.h"
#include "brave/components/brave_rewards/core/features.h"
#include "brave/components/brave_rewards/core/internal/global_constants.h"
#include "brave/components/brave_rewards/core/pref_names.h"
#include "brave/components/brave_rewards/core/rewards_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "components/prefs/pref_service.h"
Expand Down
Loading

0 comments on commit be5d45a

Please sign in to comment.