From be5d45a9ba35bd06d463347dc18cfd583b2709e8 Mon Sep 17 00:00:00 2001 From: zenparsing Date: Thu, 16 Jan 2025 14:05:22 -0500 Subject: [PATCH] Reconfigure Rewards component folder structure --- .github/CODEOWNERS | 8 +- .storybook/BUILD.gn | 2 +- android/android_browser_tests.gni | 38 +- .../chrome/browser/BraveRewardsBalance.java | 2 +- .../browser/BraveRewardsNativeWorker.java | 2 +- browser/BUILD.gn | 4 +- browser/DEPS | 4 +- browser/about_flags.cc | 4 +- browser/android/preferences/BUILD.gn | 4 +- .../preferences/brave_pref_service_bridge.cc | 2 +- .../creatives/search_result_ad/BUILD.gn | 4 +- .../creative_search_result_ad_tab_helper.cc | 2 +- ...search_result_ad_tab_helper_browsertest.cc | 2 +- browser/brave_ads/tabs/BUILD.gn | 4 +- browser/brave_ads/tabs/ads_tab_helper.cc | 2 +- .../tabs/ads_tab_helper_browsertest.cc | 2 +- browser/brave_browser_main_parts.cc | 4 +- browser/brave_content_browser_client.cc | 8 +- browser/brave_news/BUILD.gn | 2 +- browser/brave_prefs_browsertest.cc | 2 +- browser/brave_profile_prefs.cc | 4 +- browser/brave_rewards/BUILD.gn | 12 +- browser/brave_rewards/DEPS | 2 +- .../android/brave_rewards_native_worker.cc | 14 +- .../android/brave_rewards_native_worker.h | 8 +- .../creator_detection_script_injector.cc | 6 +- ...n_rewards_notification_service_observer.cc | 2 +- ...on_rewards_notification_service_observer.h | 4 +- .../extension_rewards_service_observer.cc | 6 +- .../extension_rewards_service_observer.h | 6 +- browser/brave_rewards/rewards_prefs_util.cc | 4 +- browser/brave_rewards/rewards_prefs_util.h | 2 +- .../brave_rewards/rewards_service_factory.cc | 10 +- .../brave_rewards/rewards_service_factory.h | 4 +- browser/brave_rewards/rewards_tab_helper.cc | 6 +- browser/brave_rewards/rewards_tab_helper.h | 2 +- browser/brave_rewards/rewards_util.cc | 4 +- browser/brave_rewards/rewards_util.h | 4 +- browser/brave_rewards/test/BUILD.gn | 37 +- browser/brave_rewards/test/DEPS | 3 + .../test/creator_detection_browsertest.cc | 6 +- .../test/rewards_browsertest.cc | 54 +- .../test/rewards_contribution_browsertest.cc | 44 +- .../test/rewards_flag_browsertest.cc | 35 +- .../test/rewards_notification_browsertest.cc | 44 +- .../test/rewards_ofac_browsertest.cc | 6 +- .../test/rewards_p3a_browsertest.cc | 21 +- .../test/rewards_page_browsertest.cc | 6 +- .../test/rewards_policy_browsertest.cc | 8 +- .../test/rewards_publisher_browsertest.cc | 41 +- .../test/rewards_state_browsertest.cc | 89 ++-- .../brave_rewards/test/util}/DEPS | 0 .../rewards_browsertest_context_helper.cc | 12 +- .../rewards_browsertest_context_helper.h | 8 +- .../util}/rewards_browsertest_context_util.cc | 176 +++--- .../util/rewards_browsertest_context_util.h | 56 ++ .../util}/rewards_browsertest_contribution.cc | 27 +- .../util}/rewards_browsertest_contribution.h | 23 +- .../util}/rewards_browsertest_network_util.cc | 31 +- .../util}/rewards_browsertest_network_util.h | 17 +- .../util}/rewards_browsertest_response.cc | 114 ++-- .../test/util}/rewards_browsertest_response.h | 23 +- .../test/util}/rewards_browsertest_util.cc | 29 +- .../test/util}/rewards_browsertest_util.h | 26 +- .../brave_search/brave_search_browsertest.cc | 2 +- .../brave_stats_updater_unittest.cc | 2 +- browser/extensions/BUILD.gn | 8 +- browser/extensions/api/BUILD.gn | 2 +- browser/extensions/api/brave_rewards_api.cc | 8 +- browser/extensions/api/brave_rewards_api.h | 2 +- .../api/rewards_notifications_api.cc | 4 +- .../api/settings_private/brave_prefs_util.cc | 2 +- browser/net/BUILD.gn | 4 +- .../net/brave_network_audit_browsertest.cc | 2 +- ...arch_ads_header_network_delegate_helper.cc | 2 +- ...header_network_delegate_helper_unittest.cc | 6 +- browser/net/sources.gni | 2 +- browser/ntp_background/BUILD.gn | 4 +- browser/ntp_background/ntp_p3a_helper_impl.cc | 2 +- .../ntp_p3a_helper_impl_unittest.cc | 4 +- browser/perf/brave_perf_features_processor.cc | 2 +- ...ave_perf_features_processor_browsertest.cc | 4 +- browser/perf/sources.gni | 2 +- browser/policy/brave_simple_policy_map.h | 2 +- browser/sources.gni | 10 +- browser/ui/BUILD.gn | 14 +- .../ui/brave_browser_command_controller.cc | 2 +- browser/ui/brave_rewards/BUILD.gn | 2 +- .../brave_rewards/rewards_panel_coordinator.h | 2 +- .../ui/brave_rewards/tip_panel_coordinator.cc | 2 +- .../ui/brave_rewards/tip_panel_coordinator.h | 2 +- .../brave_actions/brave_actions_container.cc | 2 +- .../brave_actions_container_browsertest.cc | 5 +- .../brave_rewards_action_view.cc | 8 +- .../brave_actions/brave_rewards_action_view.h | 8 +- browser/ui/webui/ads_internals/BUILD.gn | 2 +- .../brave_rewards/rewards_page_data_source.cc | 2 +- .../brave_rewards/rewards_page_handler.cc | 10 +- .../brave_rewards/rewards_page_handler.h | 2 +- .../webui/brave_rewards/rewards_page_top_ui.h | 2 +- .../ui/webui/brave_rewards/rewards_page_ui.h | 2 +- .../brave_rewards/rewards_panel_handler.cc | 2 +- .../brave_rewards/rewards_panel_handler.h | 2 +- .../ui/webui/brave_rewards/rewards_panel_ui.h | 2 +- .../webui/brave_rewards/tip_panel_handler.cc | 2 +- .../webui/brave_rewards/tip_panel_handler.h | 2 +- browser/ui/webui/brave_rewards/tip_panel_ui.h | 2 +- .../ui/webui/brave_rewards_internals_ui.cc | 6 +- browser/ui/webui/brave_rewards_page_ui.cc | 12 +- .../webui/brave_web_ui_controller_factory.cc | 2 +- .../brave_clear_browsing_data_handler.cc | 2 +- ...ave_settings_localized_strings_provider.cc | 2 +- build/android/config.gni | 2 +- chromium_presubmit_config.json5 | 3 +- .../chrome/browser/flags/android/DEPS | 2 +- .../flags/android/chrome_feature_list.cc | 2 +- .../chrome/browser/shared/model/prefs/DEPS | 2 +- .../shared/model/prefs/browser_prefs.mm | 2 +- .../browser/shared/model/prefs/sources.gni | 2 +- components/brave_adaptive_captcha/BUILD.gn | 6 +- .../brave_adaptive_captcha_service.h | 4 +- .../brave_adaptive_captcha/server_util.cc | 4 +- components/brave_ads/browser/BUILD.gn | 4 +- .../brave_ads/browser/ads_service_impl.cc | 6 +- .../brave_ads/browser/ads_service_impl.h | 2 +- .../brave_ads/core/browser/internals/BUILD.gn | 2 +- .../internals/ads_internals_handler.cc | 2 +- components/brave_ads/core/internal/BUILD.gn | 2 +- .../country_code/country_code_unittest.cc | 2 +- .../subdivision/subdivision_unittest.cc | 2 +- .../command_line_switch_test_util_internal.cc | 2 +- .../common/test/pref_registry_test_util.cc | 2 +- .../debug_command_line_switch_parser_util.cc | 2 +- ...ronment_command_line_switch_parser_util.cc | 2 +- .../core/internal/prefs/pref_path_util.cc | 2 +- .../core/internal/settings/settings.cc | 2 +- .../internal/settings/settings_test_util.cc | 2 +- components/brave_ads/core/test/BUILD.gn | 3 +- components/brave_news/browser/BUILD.gn | 2 +- .../brave_news/browser/brave_news_p3a.cc | 2 +- .../browser/brave_news_p3a_unittest.cc | 2 +- components/brave_news/browser/test/BUILD.gn | 2 +- .../brave_rewards/browser/android_util.h | 17 - components/brave_rewards/browser/logging.h | 21 - components/brave_rewards/browser/test/DEPS | 3 - .../common/rewards_browsertest_context_util.h | 64 --- components/brave_rewards/browser/test_util.h | 21 - components/brave_rewards/common/BUILD.gn | 39 -- .../brave_rewards/common/buildflags/BUILD.gn | 7 - .../common/buildflags/buildflags.gni | 3 - .../{browser => content}/BUILD.gn | 44 +- .../{browser => content}/CHANGELOG.md | 0 .../brave_rewards/{browser => content}/DEPS | 0 .../{browser => content}/android_util.cc | 6 +- .../brave_rewards/content/android_util.h | 17 + .../{browser => content}/diagnostic_log.cc | 4 +- .../{browser => content}/diagnostic_log.h | 8 +- components/brave_rewards/content/logging.h | 22 + .../rewards_notification_service.cc | 11 +- .../rewards_notification_service.h | 8 +- .../rewards_notification_service_impl.cc | 47 +- .../rewards_notification_service_impl.h | 18 +- .../rewards_notification_service_observer.h | 13 +- .../{browser => content}/rewards_p3a.cc | 4 +- .../{browser => content}/rewards_p3a.h | 6 +- .../rewards_protocol_navigation_throttle.cc | 4 +- .../rewards_protocol_navigation_throttle.h | 6 +- ...s_protocol_navigation_throttle_unittest.cc | 0 .../{browser => content}/rewards_service.cc | 6 +- .../{browser => content}/rewards_service.h | 61 +-- .../rewards_service_impl.cc | 107 ++-- .../rewards_service_impl.h | 55 +- .../rewards_service_impl_jp_unittest.cc | 15 +- .../rewards_service_impl_unittest.cc | 19 +- .../rewards_service_observer.h | 20 +- .../service_sandbox_type.h | 6 +- .../{browser => content}/test_util.cc | 2 +- components/brave_rewards/content/test_util.h | 21 + components/brave_rewards/core/BUILD.gn | 500 ++---------------- .../brave_rewards/core/buildflags/BUILD.gn | 12 + .../core/buildflags/buildflags.gni | 8 + .../{common => core}/features.cc | 4 +- .../brave_rewards/{common => core}/features.h | 10 +- .../brave_rewards/core/internal/BUILD.gn | 489 +++++++++++++++++ .../brave_rewards/core/{ => internal}/DEPS | 0 .../core/{ => internal}/bitflyer/bitflyer.cc | 16 +- .../core/{ => internal}/bitflyer/bitflyer.h | 12 +- .../core/{ => internal}/common/DEPS | 0 .../core/{ => internal}/common/brotli_util.cc | 2 +- .../core/{ => internal}/common/brotli_util.h | 6 +- .../common/brotli_util_unittest.cc | 2 +- .../{ => internal}/common/callback_helpers.h | 6 +- .../common/environment_config.cc | 4 +- .../common/environment_config.h | 10 +- .../core/{ => internal}/common/random_util.cc | 4 +- .../core/{ => internal}/common/random_util.h | 6 +- .../{ => internal}/common/request_signer.cc | 2 +- .../{ => internal}/common/request_signer.h | 10 +- .../common/request_signer_unittest.cc | 2 +- .../core/{ => internal}/common/signer.cc | 3 +- .../core/{ => internal}/common/signer.h | 6 +- .../{ => internal}/common/signer_unittest.cc | 2 +- .../core/{ => internal}/common/time_util.cc | 2 +- .../core/{ => internal}/common/time_util.h | 8 +- .../core/{ => internal}/common/url_helpers.h | 6 +- .../core/{ => internal}/common/url_loader.cc | 14 +- .../core/{ => internal}/common/url_loader.h | 10 +- .../common/url_loader_unittest.cc | 5 +- .../core/{ => internal}/config.gni | 0 .../core/{ => internal}/constants.h | 6 +- .../contribution/contribution.cc | 26 +- .../contribution/contribution.h | 18 +- .../contribution_external_wallet.cc | 19 +- .../contribution_external_wallet.h | 8 +- .../contribution/contribution_monthly.cc | 29 +- .../contribution/contribution_monthly.h | 8 +- .../contribution/contribution_tip.cc | 10 +- .../contribution/contribution_tip.h | 8 +- .../contribution/contribution_util.cc | 7 +- .../contribution/contribution_util.h | 8 +- .../contribution_util_unittest.cc | 7 +- .../{ => internal}/credentials/credentials.h | 14 +- .../credentials/credentials_common.cc | 9 +- .../credentials/credentials_common.h | 12 +- .../credentials/credentials_redeem.cc | 2 +- .../credentials/credentials_redeem.h | 10 +- .../credentials/credentials_trigger.cc | 2 +- .../credentials/credentials_trigger.h | 8 +- .../credentials/credentials_util.cc | 4 +- .../credentials/credentials_util.h | 10 +- .../credentials/credentials_util_unittest.cc | 5 +- .../core/{ => internal}/database/DEPS | 0 .../core/{ => internal}/database/database.cc | 8 +- .../core/{ => internal}/database/database.h | 42 +- .../database/database_activity_info.cc | 14 +- .../database/database_activity_info.h | 8 +- .../database/database_balance_report.cc | 9 +- .../database/database_balance_report.h | 8 +- .../database/database_contribution_info.cc | 12 +- .../database/database_contribution_info.h | 10 +- .../database_contribution_info_publishers.cc | 7 +- .../database_contribution_info_publishers.h | 8 +- .../database/database_contribution_queue.cc | 9 +- .../database/database_contribution_queue.h | 10 +- .../database_contribution_queue_publishers.cc | 9 +- .../database_contribution_queue_publishers.h | 8 +- .../database/database_creds_batch.cc | 7 +- .../database/database_creds_batch.h | 8 +- .../database/database_event_log.cc | 9 +- .../database/database_event_log.h | 8 +- .../database_external_transactions.cc | 7 +- .../database/database_external_transactions.h | 8 +- .../database/database_initialize.cc | 9 +- .../database/database_initialize.h | 10 +- .../database/database_media_publisher_info.cc | 7 +- .../database/database_media_publisher_info.h | 8 +- .../database/database_migration.cc | 91 ++-- .../database/database_migration.h | 8 +- .../database/database_migration_unittest.cc | 17 +- .../{ => internal}/database/database_mock.cc | 2 +- .../{ => internal}/database/database_mock.h | 10 +- .../database/database_publisher_info.cc | 13 +- .../database/database_publisher_info.h | 8 +- .../database_publisher_prefix_list.cc | 8 +- .../database/database_publisher_prefix_list.h | 10 +- ...database_publisher_prefix_list_unittest.cc | 6 +- .../database/database_recurring_tip.cc | 10 +- .../database/database_recurring_tip.h | 8 +- .../database_server_publisher_banner.cc | 7 +- .../database_server_publisher_banner.h | 10 +- .../database_server_publisher_info.cc | 9 +- .../database/database_server_publisher_info.h | 10 +- .../database_server_publisher_links.cc | 7 +- .../database_server_publisher_links.h | 8 +- .../database/database_sku_order.cc | 7 +- .../database/database_sku_order.h | 10 +- .../database/database_sku_order_items.cc | 7 +- .../database/database_sku_order_items.h | 8 +- .../database/database_sku_transaction.cc | 7 +- .../database/database_sku_transaction.h | 8 +- .../{ => internal}/database/database_table.cc | 5 +- .../{ => internal}/database/database_table.h | 14 +- .../database/database_unblinded_token.cc | 12 +- .../database/database_unblinded_token.h | 8 +- .../{ => internal}/database/database_util.cc | 3 +- .../{ => internal}/database/database_util.h | 12 +- .../database/database_util_unittest.cc | 3 +- .../database/migration/migration_v1.h | 6 +- .../database/migration/migration_v10.h | 6 +- .../database/migration/migration_v11.h | 6 +- .../database/migration/migration_v12.h | 6 +- .../database/migration/migration_v13.h | 6 +- .../database/migration/migration_v14.h | 6 +- .../database/migration/migration_v15.h | 6 +- .../database/migration/migration_v16.h | 6 +- .../database/migration/migration_v17.h | 6 +- .../database/migration/migration_v18.h | 6 +- .../database/migration/migration_v19.h | 6 +- .../database/migration/migration_v2.h | 6 +- .../database/migration/migration_v20.h | 6 +- .../database/migration/migration_v21.h | 6 +- .../database/migration/migration_v22.h | 6 +- .../database/migration/migration_v23.h | 6 +- .../database/migration/migration_v24.h | 6 +- .../database/migration/migration_v25.h | 6 +- .../database/migration/migration_v26.h | 6 +- .../database/migration/migration_v27.h | 6 +- .../database/migration/migration_v28.h | 6 +- .../database/migration/migration_v29.h | 6 +- .../database/migration/migration_v3.h | 6 +- .../database/migration/migration_v30.h | 6 +- .../database/migration/migration_v31.h | 6 +- .../database/migration/migration_v32.h | 6 +- .../database/migration/migration_v33.h | 6 +- .../database/migration/migration_v34.h | 6 +- .../database/migration/migration_v35.h | 6 +- .../database/migration/migration_v36.h | 6 +- .../database/migration/migration_v37.h | 6 +- .../database/migration/migration_v38.h | 6 +- .../database/migration/migration_v39.h | 6 +- .../database/migration/migration_v4.h | 6 +- .../database/migration/migration_v40.h | 6 +- .../database/migration/migration_v5.h | 6 +- .../database/migration/migration_v6.h | 6 +- .../database/migration/migration_v7.h | 6 +- .../database/migration/migration_v8.h | 6 +- .../database/migration/migration_v9.h | 6 +- .../endpoint/bitflyer/bitflyer_server.cc | 4 +- .../endpoint/bitflyer/bitflyer_server.h | 10 +- .../get_balance/get_balance_bitflyer.cc | 8 +- .../get_balance/get_balance_bitflyer.h | 8 +- .../get_balance_bitflyer_unittest.cc | 6 +- .../post_oauth/post_oauth_bitflyer.cc | 8 +- .../bitflyer/post_oauth/post_oauth_bitflyer.h | 8 +- .../post_oauth_bitflyer_unittest.cc | 6 +- .../endpoint/gemini/gemini_server.cc | 4 +- .../endpoint/gemini/gemini_server.h | 14 +- .../post_account/post_account_gemini.cc | 8 +- .../gemini/post_account/post_account_gemini.h | 8 +- .../post_account_gemini_unittest.cc | 6 +- .../post_balance/post_balance_gemini.cc | 8 +- .../gemini/post_balance/post_balance_gemini.h | 8 +- .../post_balance_gemini_unittest.cc | 6 +- .../gemini/post_oauth/post_oauth_gemini.cc | 8 +- .../gemini/post_oauth/post_oauth_gemini.h | 8 +- .../post_oauth/post_oauth_gemini_unittest.cc | 6 +- .../post_recipient_id_gemini.cc | 8 +- .../post_recipient_id_gemini.h | 8 +- .../post_recipient_id_gemini_unittest.cc | 6 +- .../get_credentials/get_credentials.cc | 8 +- .../payment/get_credentials/get_credentials.h | 10 +- .../get_credentials_unittest.cc | 6 +- .../endpoint/payment/payment_server.cc | 4 +- .../endpoint/payment/payment_server.h | 18 +- .../post_credentials/post_credentials.cc | 8 +- .../post_credentials/post_credentials.h | 8 +- .../post_credentials_unittest.cc | 6 +- .../endpoint/payment/post_order/post_order.cc | 8 +- .../endpoint/payment/post_order/post_order.h | 10 +- .../payment/post_order/post_order_unittest.cc | 6 +- .../post_transaction_sku_gemini.cc | 8 +- .../post_transaction_sku_gemini.h | 10 +- .../post_transaction_sku_gemini_unittest.cc | 6 +- .../post_transaction_uphold.cc | 8 +- .../post_transaction_uphold.h | 10 +- .../post_transaction_uphold_unittest.cc | 6 +- .../endpoint/payment/post_votes/post_votes.cc | 10 +- .../endpoint/payment/post_votes/post_votes.h | 10 +- .../payment/post_votes/post_votes_unittest.cc | 6 +- .../get_publisher/get_publisher.cc | 14 +- .../private_cdn/get_publisher/get_publisher.h | 10 +- .../get_publisher/get_publisher_unittest.cc | 8 +- .../private_cdn/private_cdn_server.cc | 4 +- .../endpoint/private_cdn/private_cdn_server.h | 8 +- .../get_prefix_list/get_prefix_list.cc | 8 +- .../rewards/get_prefix_list/get_prefix_list.h | 8 +- .../get_prefix_list_unittest.cc | 6 +- .../endpoint/rewards/rewards_server.cc | 4 +- .../endpoint/rewards/rewards_server.h | 8 +- .../get_capabilities/get_capabilities.cc | 8 +- .../get_capabilities/get_capabilities.h | 10 +- .../get_capabilities_unittest.cc | 8 +- .../endpoint/uphold/get_card/get_card.cc | 10 +- .../endpoint/uphold/get_card/get_card.h | 8 +- .../uphold/get_card/get_card_unittest.cc | 6 +- .../endpoint/uphold/get_cards/get_cards.cc | 10 +- .../endpoint/uphold/get_cards/get_cards.h | 8 +- .../uphold/get_cards/get_cards_unittest.cc | 6 +- .../endpoint/uphold/get_me/get_me.cc | 8 +- .../endpoint/uphold/get_me/get_me.h | 10 +- .../endpoint/uphold/get_me/get_me_unittest.cc | 6 +- .../endpoint/uphold/patch_card/patch_card.cc | 8 +- .../endpoint/uphold/patch_card/patch_card.h | 8 +- .../uphold/patch_card/patch_card_unittest.cc | 6 +- .../endpoint/uphold/post_cards/post_cards.cc | 10 +- .../endpoint/uphold/post_cards/post_cards.h | 8 +- .../uphold/post_cards/post_cards_unittest.cc | 6 +- .../endpoint/uphold/uphold_server.cc | 4 +- .../endpoint/uphold/uphold_server.h | 18 +- .../post_commit_transaction_bitflyer.cc | 6 +- .../post_commit_transaction_bitflyer.h | 12 +- ...st_commit_transaction_bitflyer_unittest.cc | 21 +- .../endpoints/brave/get_parameters.cc | 6 +- .../endpoints/brave/get_parameters.h | 16 +- .../brave/get_parameters_unittest.cc | 10 +- .../endpoints/brave/get_ui_cards.cc | 6 +- .../endpoints/brave/get_ui_cards.h | 10 +- .../endpoints/brave/get_wallet.cc | 10 +- .../endpoints/brave/get_wallet.h | 16 +- .../endpoints/brave/get_wallet_unittest.cc | 13 +- .../endpoints/brave/patch_wallets.cc | 10 +- .../endpoints/brave/patch_wallets.h | 16 +- .../endpoints/brave/patch_wallets_unittest.cc | 23 +- .../endpoints/brave/post_challenges.cc | 12 +- .../endpoints/brave/post_challenges.h | 12 +- .../brave/post_challenges_unittest.cc | 9 +- .../endpoints/brave/post_connect_bitflyer.cc | 4 +- .../endpoints/brave/post_connect_bitflyer.h | 8 +- .../endpoints/brave/post_connect_gemini.cc | 4 +- .../endpoints/brave/post_connect_gemini.h | 8 +- .../endpoints/brave/post_connect_uphold.cc | 8 +- .../endpoints/brave/post_connect_uphold.h | 8 +- .../endpoints/brave/post_connect_zebpay.cc | 4 +- .../endpoints/brave/post_connect_zebpay.h | 8 +- .../endpoints/brave/post_wallets.cc | 10 +- .../endpoints/brave/post_wallets.h | 16 +- .../endpoints/brave/post_wallets_unittest.cc | 23 +- .../common/get_transaction_status.cc | 2 +- .../endpoints/common/get_transaction_status.h | 8 +- .../common/post_commit_transaction.cc | 2 +- .../common/post_commit_transaction.h | 10 +- .../endpoints/common/post_connect.cc | 10 +- .../endpoints/common/post_connect.h | 16 +- .../endpoints/common/post_connect_unittest.cc | 22 +- .../common/post_create_transaction.cc | 2 +- .../common/post_create_transaction.h | 10 +- .../gemini/get_recipient_id_gemini.cc | 8 +- .../gemini/get_recipient_id_gemini.h | 14 +- .../get_recipient_id_gemini_unittest.cc | 21 +- .../gemini/post_commit_transaction_gemini.cc | 6 +- .../gemini/post_commit_transaction_gemini.h | 12 +- ...post_commit_transaction_gemini_unittest.cc | 21 +- .../endpoints/request_builder.cc | 2 +- .../endpoints/request_builder.h | 8 +- .../{ => internal}/endpoints/request_for.h | 14 +- .../endpoints/response_handler.h | 12 +- .../{ => internal}/endpoints/result_for.h | 6 +- .../uphold/get_transaction_status_uphold.cc | 6 +- .../uphold/get_transaction_status_uphold.h | 12 +- .../get_transaction_status_uphold_unittest.cc | 21 +- .../uphold/post_commit_transaction_uphold.cc | 8 +- .../uphold/post_commit_transaction_uphold.h | 12 +- ...post_commit_transaction_uphold_unittest.cc | 21 +- .../uphold/post_create_transaction_uphold.cc | 8 +- .../uphold/post_create_transaction_uphold.h | 12 +- ...post_create_transaction_uphold_unittest.cc | 21 +- .../endpoints/uphold/post_oauth_uphold.cc | 8 +- .../endpoints/uphold/post_oauth_uphold.h | 14 +- .../uphold/post_oauth_uphold_unittest.cc | 21 +- .../endpoints/zebpay/get_balance_zebpay.cc | 6 +- .../endpoints/zebpay/get_balance_zebpay.h | 14 +- .../zebpay/get_balance_zebpay_unittest.cc | 21 +- .../endpoints/zebpay/post_oauth_zebpay.cc | 6 +- .../endpoints/zebpay/post_oauth_zebpay.h | 14 +- .../zebpay/post_oauth_zebpay_unittest.cc | 21 +- .../core/{ => internal}/gemini/gemini.cc | 14 +- .../core/{ => internal}/gemini/gemini.h | 12 +- .../core/{ => internal}/global_constants.h | 6 +- .../{ => internal}/initialization_manager.cc | 16 +- .../{ => internal}/initialization_manager.h | 8 +- .../core/{ => internal}/legacy/DEPS | 0 .../core/{ => internal}/legacy/bat_state.cc | 14 +- .../core/{ => internal}/legacy/bat_state.h | 12 +- .../core/{ => internal}/legacy/bat_util.cc | 3 +- .../core/{ => internal}/legacy/bat_util.h | 6 +- .../legacy/bat_util_unittest.cc | 3 +- .../legacy/client_properties.cc | 4 +- .../{ => internal}/legacy/client_properties.h | 11 +- .../legacy/client_state_unittest.cc | 2 +- .../legacy/publisher_settings_properties.cc | 4 +- .../legacy/publisher_settings_properties.h | 9 +- .../publisher_settings_state_unittest.cc | 4 +- .../{ => internal}/legacy/publisher_state.cc | 7 +- .../{ => internal}/legacy/publisher_state.h | 10 +- .../legacy/report_balance_properties.cc | 4 +- .../legacy/report_balance_properties.h | 6 +- .../legacy/report_balance_state_unittest.cc | 2 +- .../core/{ => internal}/legacy/state_writer.h | 6 +- .../{ => internal}/legacy/static_values.h | 6 +- .../legacy/wallet_info_properties.cc | 2 +- .../legacy/wallet_info_properties.h | 7 +- .../legacy/wallet_info_state_unittest.cc | 2 +- .../{ => internal}/logging/event_log_keys.h | 6 +- .../{ => internal}/logging/event_log_util.cc | 5 +- .../{ => internal}/logging/event_log_util.h | 8 +- .../notifications/notification_keys.h | 6 +- .../parameters/rewards_parameters_provider.cc | 10 +- .../parameters/rewards_parameters_provider.h | 10 +- .../rewards_parameters_provider_unittest.cc | 8 +- .../{ => internal}/publisher/media/helper.cc | 2 +- .../{ => internal}/publisher/media/helper.h | 6 +- .../publisher/media/helper_unittest.cc | 5 +- .../{ => internal}/publisher/media/media.cc | 10 +- .../{ => internal}/publisher/media/media.h | 10 +- .../{ => internal}/publisher/media/youtube.cc | 17 +- .../{ => internal}/publisher/media/youtube.h | 10 +- .../publisher/media/youtube_unittest.cc | 18 +- .../publisher/prefix_iterator.h | 6 +- .../publisher/prefix_list_reader.cc | 8 +- .../publisher/prefix_list_reader.h | 8 +- .../publisher/prefix_list_reader_unittest.cc | 5 +- .../{ => internal}/publisher/prefix_util.cc | 2 +- .../{ => internal}/publisher/prefix_util.h | 6 +- .../publisher/protos/channel_response.proto | 0 .../protos/publisher_prefix_list.proto | 0 .../{ => internal}/publisher/publisher.cc | 26 +- .../core/{ => internal}/publisher/publisher.h | 14 +- .../publisher_prefix_list_updater.cc | 12 +- .../publisher/publisher_prefix_list_updater.h | 10 +- .../publisher/publisher_status_helper.cc | 8 +- .../publisher/publisher_status_helper.h | 8 +- .../publisher/publisher_unittest.cc | 11 +- .../publisher/server_publisher_fetcher.cc | 12 +- .../publisher/server_publisher_fetcher.h | 12 +- .../core/{ => internal}/rewards_callbacks.h | 12 +- .../core/{ => internal}/rewards_database.cc | 2 +- .../core/{ => internal}/rewards_database.h | 8 +- .../core/{ => internal}/rewards_engine.cc | 120 ++--- .../core/{ => internal}/rewards_engine.h | 12 +- .../{ => internal}/rewards_engine_helper.cc | 2 +- .../{ => internal}/rewards_engine_helper.h | 12 +- .../core/{ => internal}/rewards_log_stream.cc | 2 +- .../core/{ => internal}/rewards_log_stream.h | 8 +- .../core/{ => internal}/state/state.cc | 35 +- .../core/{ => internal}/state/state.h | 8 +- .../core/{ => internal}/state/state_keys.h | 6 +- .../{ => internal}/state/state_migration.cc | 7 +- .../core/internal/state/state_migration.h | 65 +++ .../state/state_migration_v1.cc | 11 +- .../{ => internal}/state/state_migration_v1.h | 10 +- .../state/state_migration_v10.cc | 10 +- .../state/state_migration_v10.h | 10 +- .../state/state_migration_v11.cc | 8 +- .../state/state_migration_v11.h | 8 +- .../state/state_migration_v12.cc | 8 +- .../state/state_migration_v12.h | 8 +- .../state/state_migration_v13.cc | 8 +- .../state/state_migration_v13.h | 8 +- .../state/state_migration_v14.cc | 10 +- .../state/state_migration_v14.h | 8 +- .../state/state_migration_v2.cc | 7 +- .../{ => internal}/state/state_migration_v2.h | 10 +- .../state/state_migration_v3.cc | 2 +- .../{ => internal}/state/state_migration_v3.h | 8 +- .../state/state_migration_v4.cc | 4 +- .../{ => internal}/state/state_migration_v4.h | 8 +- .../state/state_migration_v5.cc | 20 +- .../{ => internal}/state/state_migration_v5.h | 8 +- .../state/state_migration_v6.cc | 6 +- .../{ => internal}/state/state_migration_v6.h | 8 +- .../state/state_migration_v7.cc | 8 +- .../{ => internal}/state/state_migration_v7.h | 8 +- .../state/state_migration_v8.cc | 6 +- .../{ => internal}/state/state_migration_v8.h | 8 +- .../state/state_migration_v9.cc | 2 +- .../{ => internal}/state/state_migration_v9.h | 8 +- .../brave_rewards/core/internal/test/BUILD.gn | 99 ++++ .../test/data/publisher_info_db_v1.sql | 0 .../test/data/publisher_info_db_v10.sql | 0 .../test/data/publisher_info_db_v11.sql | 0 .../test/data/publisher_info_db_v12.sql | 0 .../test/data/publisher_info_db_v13.sql | 0 .../test/data/publisher_info_db_v14.sql | 0 .../test/data/publisher_info_db_v15.sql | 0 .../test/data/publisher_info_db_v16.sql | 0 .../test/data/publisher_info_db_v17.sql | 0 .../test/data/publisher_info_db_v18.sql | 0 .../test/data/publisher_info_db_v19.sql | 0 .../test/data/publisher_info_db_v20.sql | 0 .../test/data/publisher_info_db_v21.sql | 0 .../test/data/publisher_info_db_v22.sql | 0 .../test/data/publisher_info_db_v23.sql | 0 .../test/data/publisher_info_db_v24.sql | 0 .../test/data/publisher_info_db_v25.sql | 0 .../test/data/publisher_info_db_v26.sql | 0 .../test/data/publisher_info_db_v27.sql | 0 .../test/data/publisher_info_db_v29.sql | 0 .../test/data/publisher_info_db_v3.sql | 0 .../test/data/publisher_info_db_v30.sql | 0 .../test/data/publisher_info_db_v32.sql | 0 .../test/data/publisher_info_db_v33.sql | 0 .../test/data/publisher_info_db_v34.sql | 0 .../test/data/publisher_info_db_v35.sql | 0 .../test/data/publisher_info_db_v36.sql | 0 .../test/data/publisher_info_db_v37.sql | 0 .../test/data/publisher_info_db_v38.sql | 0 .../test/data/publisher_info_db_v39.sql | 0 .../test/data/publisher_info_db_v4.sql | 0 .../test/data/publisher_info_db_v5.sql | 0 .../test/data/publisher_info_db_v6.sql | 0 .../test/data/publisher_info_db_v7.sql | 0 .../test/data/publisher_info_db_v8.sql | 0 .../test/data/publisher_info_db_v9.sql | 0 .../data/publisher_info_schema_current.txt | 0 .../test/rewards_engine_test.cc | 4 +- .../{ => internal}/test/rewards_engine_test.h | 10 +- .../test/test_rewards_engine_client.cc | 6 +- .../test/test_rewards_engine_client.h | 12 +- .../test_rewards_engine_client_unittest.cc | 5 +- .../core/{ => internal}/uphold/uphold.cc | 14 +- .../core/{ => internal}/uphold/uphold.h | 12 +- .../uphold/uphold_capabilities.h | 6 +- .../core/{ => internal}/uphold/uphold_card.cc | 6 +- .../core/{ => internal}/uphold/uphold_card.h | 10 +- .../core/{ => internal}/uphold/uphold_user.cc | 2 +- .../core/{ => internal}/uphold/uphold_user.h | 6 +- .../core/{ => internal}/wallet/wallet.cc | 19 +- .../core/{ => internal}/wallet/wallet.h | 12 +- .../{ => internal}/wallet/wallet_balance.cc | 16 +- .../{ => internal}/wallet/wallet_balance.h | 10 +- .../{ => internal}/wallet/wallet_create.cc | 24 +- .../{ => internal}/wallet/wallet_create.h | 8 +- .../{ => internal}/wallet/wallet_unittest.cc | 12 +- .../core/{ => internal}/wallet/wallet_util.cc | 20 +- .../core/{ => internal}/wallet/wallet_util.h | 8 +- .../wallet/wallet_utils_unittest.cc | 10 +- .../bitflyer/bitflyer_transfer.cc | 10 +- .../bitflyer/bitflyer_transfer.h | 10 +- .../bitflyer/connect_bitflyer_wallet.cc | 24 +- .../bitflyer/connect_bitflyer_wallet.h | 12 +- .../connect_bitflyer_wallet_unittest.cc | 8 +- .../connect_external_wallet.cc | 16 +- .../wallet_provider/connect_external_wallet.h | 10 +- .../connect_external_wallet_unittest.cc | 22 +- .../gemini/connect_gemini_wallet.cc | 26 +- .../gemini/connect_gemini_wallet.h | 14 +- .../gemini/connect_gemini_wallet_unittest.cc | 6 +- .../wallet_provider/gemini/gemini_transfer.cc | 10 +- .../wallet_provider/gemini/gemini_transfer.h | 10 +- .../wallet_provider/linkage_checker.cc | 16 +- .../wallet_provider/linkage_checker.h | 10 +- .../linkage_checker_unittest.cc | 9 +- .../solana/solana_wallet_provider.cc | 20 +- .../solana/solana_wallet_provider.h | 12 +- .../solana/solana_wallet_provider_unittest.cc | 9 +- .../wallet_provider/transfer.cc | 6 +- .../{ => internal}/wallet_provider/transfer.h | 10 +- .../uphold/connect_uphold_wallet.cc | 22 +- .../uphold/connect_uphold_wallet.h | 20 +- .../uphold/connect_uphold_wallet_unittest.cc | 6 +- .../wallet_provider/uphold/uphold_transfer.cc | 10 +- .../wallet_provider/uphold/uphold_transfer.h | 14 +- .../wallet_provider/wallet_provider.cc | 10 +- .../wallet_provider/wallet_provider.h | 12 +- .../zebpay/connect_zebpay_wallet.cc | 16 +- .../zebpay/connect_zebpay_wallet.h | 12 +- .../zebpay/connect_zebpay_wallet_unittest.cc | 6 +- .../core/{ => internal}/zebpay/zebpay.cc | 14 +- .../core/{ => internal}/zebpay/zebpay.h | 12 +- .../{common => core}/mojom/BUILD.gn | 0 .../{common => core}/mojom/rewards.mojom | 0 .../{common => core}/mojom/rewards_core.mojom | 2 +- .../mojom/rewards_database.mojom | 0 .../mojom/rewards_engine.mojom | 4 +- .../{common => core}/mojom/rewards_page.mojom | 2 +- .../mojom/rewards_panel.mojom | 0 .../mojom/rewards_tip_panel.mojom | 2 +- .../{common => core}/pref_names.h | 10 +- .../{common => core}/pref_registry.cc | 4 +- .../{common => core}/pref_registry.h | 6 +- .../{common => core}/publisher_utils.cc | 2 +- .../{common => core}/publisher_utils.h | 6 +- .../publisher_utils_unittest.cc | 2 +- .../{common => core}/rewards_flags.cc | 4 +- .../{common => core}/rewards_flags.h | 9 +- .../{common => core}/rewards_util.cc | 8 +- .../{common => core}/rewards_util.h | 8 +- .../core/state/state_migration.h | 65 --- components/brave_rewards/core/test/BUILD.gn | 99 ---- .../resources/internals/BUILD.gn | 2 +- .../brave_rewards/resources/page/BUILD.gn | 2 +- .../brave_rewards/resources/page/lib/types.ts | 2 +- .../resources/rewards_page/BUILD.gn | 2 +- .../resources/rewards_page/webui/mojom.ts | 4 +- .../resources/rewards_panel/BUILD.gn | 4 +- .../rewards_panel/lib/extension_host.ts | 2 +- .../rewards_panel/lib/rewards_panel_proxy.ts | 2 +- .../resources/shared/lib/mojom.ts | 2 +- .../resources/tip_panel/BUILD.gn | 2 +- .../tip_panel/lib/tip_panel_proxy.ts | 2 +- .../resources/tip_panel/lib/webui_model.ts | 2 +- components/brave_rewards/test/BUILD.gn | 41 -- components/definitions/rewardsExtensions.d.ts | 2 +- components/definitions/rewardsInternals.d.ts | 6 +- .../ntp_background_images/browser/BUILD.gn | 2 +- .../browser/view_counter_service.cc | 2 +- .../browser/view_counter_service_unittest.cc | 4 +- components/services/bat_rewards/BUILD.gn | 2 +- .../bat_rewards/public/interfaces/BUILD.gn | 2 +- .../interfaces/rewards_engine_factory.mojom | 4 +- .../bat_rewards/rewards_engine_factory.cc | 2 +- ios/browser/api/ads/BUILD.gn | 2 +- ios/browser/api/ads/DEPS | 2 +- ios/browser/api/ads/brave_ads.mm | 6 +- ios/browser/api/brave_rewards/BUILD.gn | 6 +- ios/browser/api/brave_rewards/DEPS | 2 +- .../api/brave_rewards/brave_rewards_api.mm | 8 +- .../api/brave_rewards/rewards_client_bridge.h | 4 +- .../api/brave_rewards/rewards_client_ios.h | 4 +- .../api/brave_rewards/rewards_client_ios.mm | 4 +- ios/browser/api/features/BUILD.gn | 2 +- ios/browser/api/features/DEPS | 2 +- ios/browser/api/features/features.mm | 2 +- ios/browser/flags/DEPS | 2 +- ios/browser/flags/about_flags.mm | 2 +- ios/browser/flags/sources.gni | 4 +- test/BUILD.gn | 40 +- 717 files changed, 3863 insertions(+), 3951 deletions(-) create mode 100644 browser/brave_rewards/test/DEPS rename {components/brave_rewards/browser => browser/brave_rewards}/test/rewards_browsertest.cc (84%) rename {components/brave_rewards/browser => browser/brave_rewards}/test/rewards_contribution_browsertest.cc (89%) rename {components/brave_rewards/browser => browser/brave_rewards}/test/rewards_flag_browsertest.cc (90%) rename {components/brave_rewards/browser => browser/brave_rewards}/test/rewards_notification_browsertest.cc (82%) rename {components/brave_rewards/browser => browser/brave_rewards}/test/rewards_p3a_browsertest.cc (90%) rename {components/brave_rewards/browser => browser/brave_rewards}/test/rewards_publisher_browsertest.cc (78%) rename {components/brave_rewards/browser => browser/brave_rewards}/test/rewards_state_browsertest.cc (94%) rename {components/brave_rewards/browser/test/common => browser/brave_rewards/test/util}/DEPS (100%) rename {components/brave_rewards/browser/test/common => browser/brave_rewards/test/util}/rewards_browsertest_context_helper.cc (91%) rename {components/brave_rewards/browser/test/common => browser/brave_rewards/test/util}/rewards_browsertest_context_helper.h (77%) rename {components/brave_rewards/browser/test/common => browser/brave_rewards/test/util}/rewards_browsertest_context_util.cc (75%) create mode 100644 browser/brave_rewards/test/util/rewards_browsertest_context_util.h rename {components/brave_rewards/browser/test/common => browser/brave_rewards/test/util}/rewards_browsertest_contribution.cc (93%) rename {components/brave_rewards/browser/test/common => browser/brave_rewards/test/util}/rewards_browsertest_contribution.h (82%) rename {components/brave_rewards/browser/test/common => browser/brave_rewards/test/util}/rewards_browsertest_network_util.cc (87%) rename {components/brave_rewards/browser/test/common => browser/brave_rewards/test/util}/rewards_browsertest_network_util.h (54%) rename {components/brave_rewards/browser/test/common => browser/brave_rewards/test/util}/rewards_browsertest_response.cc (70%) rename {components/brave_rewards/browser/test/common => browser/brave_rewards/test/util}/rewards_browsertest_response.h (67%) rename {components/brave_rewards/browser/test/common => browser/brave_rewards/test/util}/rewards_browsertest_util.cc (90%) rename {components/brave_rewards/browser/test/common => browser/brave_rewards/test/util}/rewards_browsertest_util.h (68%) delete mode 100644 components/brave_rewards/browser/android_util.h delete mode 100644 components/brave_rewards/browser/logging.h delete mode 100644 components/brave_rewards/browser/test/DEPS delete mode 100644 components/brave_rewards/browser/test/common/rewards_browsertest_context_util.h delete mode 100644 components/brave_rewards/browser/test_util.h delete mode 100644 components/brave_rewards/common/BUILD.gn delete mode 100644 components/brave_rewards/common/buildflags/BUILD.gn delete mode 100644 components/brave_rewards/common/buildflags/buildflags.gni rename components/brave_rewards/{browser => content}/BUILD.gn (69%) rename components/brave_rewards/{browser => content}/CHANGELOG.md (100%) rename components/brave_rewards/{browser => content}/DEPS (100%) rename components/brave_rewards/{browser => content}/android_util.cc (79%) create mode 100644 components/brave_rewards/content/android_util.h rename components/brave_rewards/{browser => content}/diagnostic_log.cc (98%) rename components/brave_rewards/{browser => content}/diagnostic_log.h (89%) create mode 100644 components/brave_rewards/content/logging.h rename components/brave_rewards/{browser => content}/rewards_notification_service.cc (85%) rename components/brave_rewards/{browser => content}/rewards_notification_service.h (91%) rename components/brave_rewards/{browser => content}/rewards_notification_service_impl.cc (93%) rename components/brave_rewards/{browser => content}/rewards_notification_service_impl.h (85%) rename components/brave_rewards/{browser => content}/rewards_notification_service_observer.h (70%) rename components/brave_rewards/{browser => content}/rewards_p3a.cc (97%) rename components/brave_rewards/{browser => content}/rewards_p3a.h (94%) rename components/brave_rewards/{browser => content}/rewards_protocol_navigation_throttle.cc (97%) rename components/brave_rewards/{browser => content}/rewards_protocol_navigation_throttle.h (87%) rename components/brave_rewards/{browser => content}/rewards_protocol_navigation_throttle_unittest.cc (100%) rename components/brave_rewards/{browser => content}/rewards_service.cc (76%) rename components/brave_rewards/{browser => content}/rewards_service.h (86%) rename components/brave_rewards/{browser => content}/rewards_service_impl.cc (96%) rename components/brave_rewards/{browser => content}/rewards_service_impl.h (93%) rename components/brave_rewards/{browser => content}/rewards_service_impl_jp_unittest.cc (89%) rename components/brave_rewards/{browser => content}/rewards_service_impl_unittest.cc (89%) rename components/brave_rewards/{browser => content}/rewards_service_observer.h (81%) rename components/brave_rewards/{browser => content}/service_sandbox_type.h (79%) rename components/brave_rewards/{browser => content}/test_util.cc (95%) create mode 100644 components/brave_rewards/content/test_util.h create mode 100644 components/brave_rewards/core/buildflags/BUILD.gn create mode 100644 components/brave_rewards/core/buildflags/buildflags.gni rename components/brave_rewards/{common => core}/features.cc (93%) rename components/brave_rewards/{common => core}/features.h (73%) create mode 100644 components/brave_rewards/core/internal/BUILD.gn rename components/brave_rewards/core/{ => internal}/DEPS (100%) rename components/brave_rewards/core/{ => internal}/bitflyer/bitflyer.cc (70%) rename components/brave_rewards/core/{ => internal}/bitflyer/bitflyer.h (66%) rename components/brave_rewards/core/{ => internal}/common/DEPS (100%) rename components/brave_rewards/core/{ => internal}/common/brotli_util.cc (97%) rename components/brave_rewards/core/{ => internal}/common/brotli_util.h (76%) rename components/brave_rewards/core/{ => internal}/common/brotli_util_unittest.cc (96%) rename components/brave_rewards/core/{ => internal}/common/callback_helpers.h (75%) rename components/brave_rewards/core/{ => internal}/common/environment_config.cc (98%) rename components/brave_rewards/core/{ => internal}/common/environment_config.h (84%) rename components/brave_rewards/core/{ => internal}/common/random_util.cc (90%) rename components/brave_rewards/core/{ => internal}/common/random_util.h (76%) rename components/brave_rewards/core/{ => internal}/common/request_signer.cc (97%) rename components/brave_rewards/core/{ => internal}/common/request_signer.h (84%) rename components/brave_rewards/core/{ => internal}/common/request_signer_unittest.cc (98%) rename components/brave_rewards/core/{ => internal}/common/signer.cc (97%) rename components/brave_rewards/core/{ => internal}/common/signer.h (87%) rename components/brave_rewards/core/{ => internal}/common/signer_unittest.cc (95%) rename components/brave_rewards/core/{ => internal}/common/time_util.cc (95%) rename components/brave_rewards/core/{ => internal}/common/time_util.h (75%) rename components/brave_rewards/core/{ => internal}/common/url_helpers.h (86%) rename components/brave_rewards/core/{ => internal}/common/url_loader.cc (88%) rename components/brave_rewards/core/{ => internal}/common/url_loader.h (85%) rename components/brave_rewards/core/{ => internal}/common/url_loader_unittest.cc (88%) rename components/brave_rewards/core/{ => internal}/config.gni (100%) rename components/brave_rewards/core/{ => internal}/constants.h (82%) rename components/brave_rewards/core/{ => internal}/contribution/contribution.cc (96%) rename components/brave_rewards/core/{ => internal}/contribution/contribution.h (87%) rename components/brave_rewards/core/{ => internal}/contribution/contribution_external_wallet.cc (89%) rename components/brave_rewards/core/{ => internal}/contribution/contribution_external_wallet.h (81%) rename components/brave_rewards/core/{ => internal}/contribution/contribution_monthly.cc (79%) rename components/brave_rewards/core/{ => internal}/contribution/contribution_monthly.h (77%) rename components/brave_rewards/core/{ => internal}/contribution/contribution_tip.cc (87%) rename components/brave_rewards/core/{ => internal}/contribution/contribution_tip.h (80%) rename components/brave_rewards/core/{ => internal}/contribution/contribution_util.cc (90%) rename components/brave_rewards/core/{ => internal}/contribution/contribution_util.h (72%) rename components/brave_rewards/core/{ => internal}/contribution/contribution_util_unittest.cc (91%) rename components/brave_rewards/core/{ => internal}/credentials/credentials.h (69%) rename components/brave_rewards/core/{ => internal}/credentials/credentials_common.cc (92%) rename components/brave_rewards/core/{ => internal}/credentials/credentials_common.h (73%) rename components/brave_rewards/core/{ => internal}/credentials/credentials_redeem.cc (86%) rename components/brave_rewards/core/{ => internal}/credentials/credentials_redeem.h (65%) rename components/brave_rewards/core/{ => internal}/credentials/credentials_trigger.cc (86%) rename components/brave_rewards/core/{ => internal}/credentials/credentials_trigger.h (66%) rename components/brave_rewards/core/{ => internal}/credentials/credentials_util.cc (97%) rename components/brave_rewards/core/{ => internal}/credentials/credentials_util.h (82%) rename components/brave_rewards/core/{ => internal}/credentials/credentials_util_unittest.cc (97%) rename components/brave_rewards/core/{ => internal}/database/DEPS (100%) rename components/brave_rewards/core/{ => internal}/database/database.cc (98%) rename components/brave_rewards/core/{ => internal}/database/database.h (85%) rename components/brave_rewards/core/{ => internal}/database/database_activity_info.cc (96%) rename components/brave_rewards/core/{ => internal}/database/database_activity_info.h (81%) rename components/brave_rewards/core/{ => internal}/database/database_balance_report.cc (97%) rename components/brave_rewards/core/{ => internal}/database/database_balance_report.h (81%) rename components/brave_rewards/core/{ => internal}/database/database_contribution_info.cc (97%) rename components/brave_rewards/core/{ => internal}/database/database_contribution_info.h (85%) rename components/brave_rewards/core/{ => internal}/database/database_contribution_info_publishers.cc (97%) rename components/brave_rewards/core/{ => internal}/database/database_contribution_info_publishers.h (79%) rename components/brave_rewards/core/{ => internal}/database/database_contribution_queue.cc (94%) rename components/brave_rewards/core/{ => internal}/database/database_contribution_queue.h (77%) rename components/brave_rewards/core/{ => internal}/database/database_contribution_queue_publishers.cc (91%) rename components/brave_rewards/core/{ => internal}/database/database_contribution_queue_publishers.h (73%) rename components/brave_rewards/core/{ => internal}/database/database_creds_batch.cc (98%) rename components/brave_rewards/core/{ => internal}/database/database_creds_batch.h (85%) rename components/brave_rewards/core/{ => internal}/database/database_event_log.cc (93%) rename components/brave_rewards/core/{ => internal}/database/database_event_log.h (74%) rename components/brave_rewards/core/{ => internal}/database/database_external_transactions.cc (95%) rename components/brave_rewards/core/{ => internal}/database/database_external_transactions.h (77%) rename components/brave_rewards/core/{ => internal}/database/database_initialize.cc (85%) rename components/brave_rewards/core/{ => internal}/database/database_initialize.h (65%) rename components/brave_rewards/core/{ => internal}/database/database_media_publisher_info.cc (94%) rename components/brave_rewards/core/{ => internal}/database/database_media_publisher_info.h (71%) rename components/brave_rewards/core/{ => internal}/database/database_migration.cc (62%) rename components/brave_rewards/core/{ => internal}/database/database_migration.h (77%) rename components/brave_rewards/core/{ => internal}/database/database_migration_unittest.cc (98%) rename components/brave_rewards/core/{ => internal}/database/database_mock.cc (85%) rename components/brave_rewards/core/{ => internal}/database/database_mock.h (70%) rename components/brave_rewards/core/{ => internal}/database/database_publisher_info.cc (96%) rename components/brave_rewards/core/{ => internal}/database/database_publisher_info.h (80%) rename components/brave_rewards/core/{ => internal}/database/database_publisher_prefix_list.cc (94%) rename components/brave_rewards/core/{ => internal}/database/database_publisher_prefix_list.h (73%) rename components/brave_rewards/core/{ => internal}/database/database_publisher_prefix_list_unittest.cc (91%) rename components/brave_rewards/core/{ => internal}/database/database_recurring_tip.cc (96%) rename components/brave_rewards/core/{ => internal}/database/database_recurring_tip.h (80%) rename components/brave_rewards/core/{ => internal}/database/database_server_publisher_banner.cc (95%) rename components/brave_rewards/core/{ => internal}/database/database_server_publisher_banner.h (75%) rename components/brave_rewards/core/{ => internal}/database/database_server_publisher_info.cc (95%) rename components/brave_rewards/core/{ => internal}/database/database_server_publisher_info.h (77%) rename components/brave_rewards/core/{ => internal}/database/database_server_publisher_links.cc (93%) rename components/brave_rewards/core/{ => internal}/database/database_server_publisher_links.h (74%) rename components/brave_rewards/core/{ => internal}/database/database_sku_order.cc (97%) rename components/brave_rewards/core/{ => internal}/database/database_sku_order.h (80%) rename components/brave_rewards/core/{ => internal}/database/database_sku_order_items.cc (94%) rename components/brave_rewards/core/{ => internal}/database/database_sku_order_items.h (75%) rename components/brave_rewards/core/{ => internal}/database/database_sku_transaction.cc (95%) rename components/brave_rewards/core/{ => internal}/database/database_sku_transaction.h (79%) rename components/brave_rewards/core/{ => internal}/database/database_table.cc (75%) rename components/brave_rewards/core/{ => internal}/database/database_table.h (71%) rename components/brave_rewards/core/{ => internal}/database/database_unblinded_token.cc (96%) rename components/brave_rewards/core/{ => internal}/database/database_unblinded_token.h (85%) rename components/brave_rewards/core/{ => internal}/database/database_util.cc (99%) rename components/brave_rewards/core/{ => internal}/database/database_util.h (83%) rename components/brave_rewards/core/{ => internal}/database/database_util_unittest.cc (91%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v1.h (87%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v10.h (89%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v11.h (90%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v12.h (84%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v13.h (65%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v14.h (70%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v15.h (97%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v16.h (70%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v17.h (66%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v18.h (91%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v19.h (87%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v2.h (86%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v20.h (76%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v21.h (85%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v22.h (82%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v23.h (88%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v24.h (67%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v25.h (66%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v26.h (86%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v27.h (66%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v28.h (86%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v29.h (72%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v3.h (79%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v30.h (73%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v31.h (73%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v32.h (72%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v33.h (72%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v34.h (71%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v35.h (73%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v36.h (68%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v37.h (78%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v38.h (73%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v39.h (69%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v4.h (86%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v40.h (68%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v5.h (66%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v6.h (86%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v7.h (92%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v8.h (89%) rename components/brave_rewards/core/{ => internal}/database/migration/migration_v9.h (84%) rename components/brave_rewards/core/{ => internal}/endpoint/bitflyer/bitflyer_server.cc (75%) rename components/brave_rewards/core/{ => internal}/endpoint/bitflyer/bitflyer_server.h (59%) rename components/brave_rewards/core/{ => internal}/endpoint/bitflyer/get_balance/get_balance_bitflyer.cc (91%) rename components/brave_rewards/core/{ => internal}/endpoint/bitflyer/get_balance/get_balance_bitflyer.h (81%) rename components/brave_rewards/core/{ => internal}/endpoint/bitflyer/get_balance/get_balance_bitflyer_unittest.cc (92%) rename components/brave_rewards/core/{ => internal}/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.cc (93%) rename components/brave_rewards/core/{ => internal}/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h (86%) rename components/brave_rewards/core/{ => internal}/endpoint/bitflyer/post_oauth/post_oauth_bitflyer_unittest.cc (89%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/gemini_server.cc (78%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/gemini_server.h (57%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/post_account/post_account_gemini.cc (91%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/post_account/post_account_gemini.h (82%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/post_account/post_account_gemini_unittest.cc (91%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/post_balance/post_balance_gemini.cc (90%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/post_balance/post_balance_gemini.h (80%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/post_balance/post_balance_gemini_unittest.cc (91%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/post_oauth/post_oauth_gemini.cc (90%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/post_oauth/post_oauth_gemini.h (82%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/post_oauth/post_oauth_gemini_unittest.cc (86%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.cc (90%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h (78%) rename components/brave_rewards/core/{ => internal}/endpoint/gemini/post_recipient_id/post_recipient_id_gemini_unittest.cc (91%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/get_credentials/get_credentials.cc (91%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/get_credentials/get_credentials.h (82%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/get_credentials/get_credentials_unittest.cc (92%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/payment_server.cc (80%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/payment_server.h (58%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_credentials/post_credentials.cc (89%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_credentials/post_credentials.h (82%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_credentials/post_credentials_unittest.cc (89%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_order/post_order.cc (94%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_order/post_order.h (85%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_order/post_order_unittest.cc (93%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.cc (90%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h (78%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini_unittest.cc (89%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_transaction_uphold/post_transaction_uphold.cc (89%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_transaction_uphold/post_transaction_uphold.h (79%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_transaction_uphold/post_transaction_uphold_unittest.cc (89%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_votes/post_votes.cc (87%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_votes/post_votes.h (76%) rename components/brave_rewards/core/{ => internal}/endpoint/payment/post_votes/post_votes_unittest.cc (90%) rename components/brave_rewards/core/{ => internal}/endpoint/private_cdn/get_publisher/get_publisher.cc (93%) rename components/brave_rewards/core/{ => internal}/endpoint/private_cdn/get_publisher/get_publisher.h (78%) rename components/brave_rewards/core/{ => internal}/endpoint/private_cdn/get_publisher/get_publisher_unittest.cc (92%) rename components/brave_rewards/core/{ => internal}/endpoint/private_cdn/private_cdn_server.cc (74%) rename components/brave_rewards/core/{ => internal}/endpoint/private_cdn/private_cdn_server.h (62%) rename components/brave_rewards/core/{ => internal}/endpoint/rewards/get_prefix_list/get_prefix_list.cc (84%) rename components/brave_rewards/core/{ => internal}/endpoint/rewards/get_prefix_list/get_prefix_list.h (73%) rename components/brave_rewards/core/{ => internal}/endpoint/rewards/get_prefix_list/get_prefix_list_unittest.cc (86%) rename components/brave_rewards/core/{ => internal}/endpoint/rewards/rewards_server.cc (75%) rename components/brave_rewards/core/{ => internal}/endpoint/rewards/rewards_server.h (63%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/get_capabilities/get_capabilities.cc (91%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/get_capabilities/get_capabilities.h (90%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/get_capabilities/get_capabilities_unittest.cc (95%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/get_card/get_card.cc (88%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/get_card/get_card.h (88%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/get_card/get_card_unittest.cc (93%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/get_cards/get_cards.cc (87%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/get_cards/get_cards.h (88%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/get_cards/get_cards_unittest.cc (95%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/get_me/get_me.cc (90%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/get_me/get_me.h (88%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/get_me/get_me_unittest.cc (94%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/patch_card/patch_card.cc (87%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/patch_card/patch_card.h (88%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/patch_card/patch_card_unittest.cc (93%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/post_cards/post_cards.cc (88%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/post_cards/post_cards.h (88%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/post_cards/post_cards_unittest.cc (93%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/uphold_server.cc (79%) rename components/brave_rewards/core/{ => internal}/endpoint/uphold/uphold_server.h (57%) rename components/brave_rewards/core/{ => internal}/endpoints/bitflyer/post_commit_transaction_bitflyer.cc (91%) rename components/brave_rewards/core/{ => internal}/endpoints/bitflyer/post_commit_transaction_bitflyer.h (74%) rename components/brave_rewards/core/{ => internal}/endpoints/bitflyer/post_commit_transaction_bitflyer_unittest.cc (85%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/get_parameters.cc (95%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/get_parameters.h (79%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/get_parameters_unittest.cc (93%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/get_ui_cards.cc (92%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/get_ui_cards.h (76%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/get_wallet.cc (91%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/get_wallet.h (76%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/get_wallet_unittest.cc (91%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/patch_wallets.cc (92%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/patch_wallets.h (68%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/patch_wallets_unittest.cc (83%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_challenges.cc (86%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_challenges.h (74%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_challenges_unittest.cc (88%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_connect_bitflyer.cc (88%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_connect_bitflyer.h (79%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_connect_gemini.cc (90%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_connect_gemini.h (79%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_connect_uphold.cc (90%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_connect_uphold.h (86%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_connect_zebpay.cc (88%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_connect_zebpay.h (73%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_wallets.cc (91%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_wallets.h (70%) rename components/brave_rewards/core/{ => internal}/endpoints/brave/post_wallets_unittest.cc (82%) rename components/brave_rewards/core/{ => internal}/endpoints/common/get_transaction_status.cc (89%) rename components/brave_rewards/core/{ => internal}/endpoints/common/get_transaction_status.h (68%) rename components/brave_rewards/core/{ => internal}/endpoints/common/post_commit_transaction.cc (90%) rename components/brave_rewards/core/{ => internal}/endpoints/common/post_commit_transaction.h (65%) rename components/brave_rewards/core/{ => internal}/endpoints/common/post_connect.cc (95%) rename components/brave_rewards/core/{ => internal}/endpoints/common/post_connect.h (67%) rename components/brave_rewards/core/{ => internal}/endpoints/common/post_connect_unittest.cc (90%) rename components/brave_rewards/core/{ => internal}/endpoints/common/post_create_transaction.cc (91%) rename components/brave_rewards/core/{ => internal}/endpoints/common/post_create_transaction.h (69%) rename components/brave_rewards/core/{ => internal}/endpoints/gemini/get_recipient_id_gemini.cc (87%) rename components/brave_rewards/core/{ => internal}/endpoints/gemini/get_recipient_id_gemini.h (73%) rename components/brave_rewards/core/{ => internal}/endpoints/gemini/get_recipient_id_gemini_unittest.cc (82%) rename components/brave_rewards/core/{ => internal}/endpoints/gemini/post_commit_transaction_gemini.cc (91%) rename components/brave_rewards/core/{ => internal}/endpoints/gemini/post_commit_transaction_gemini.h (71%) rename components/brave_rewards/core/{ => internal}/endpoints/gemini/post_commit_transaction_gemini_unittest.cc (85%) rename components/brave_rewards/core/{ => internal}/endpoints/request_builder.cc (94%) rename components/brave_rewards/core/{ => internal}/endpoints/request_builder.h (78%) rename components/brave_rewards/core/{ => internal}/endpoints/request_for.h (82%) rename components/brave_rewards/core/{ => internal}/endpoints/response_handler.h (73%) rename components/brave_rewards/core/{ => internal}/endpoints/result_for.h (72%) rename components/brave_rewards/core/{ => internal}/endpoints/uphold/get_transaction_status_uphold.cc (90%) rename components/brave_rewards/core/{ => internal}/endpoints/uphold/get_transaction_status_uphold.h (84%) rename components/brave_rewards/core/{ => internal}/endpoints/uphold/get_transaction_status_uphold_unittest.cc (83%) rename components/brave_rewards/core/{ => internal}/endpoints/uphold/post_commit_transaction_uphold.cc (88%) rename components/brave_rewards/core/{ => internal}/endpoints/uphold/post_commit_transaction_uphold.h (84%) rename components/brave_rewards/core/{ => internal}/endpoints/uphold/post_commit_transaction_uphold_unittest.cc (84%) rename components/brave_rewards/core/{ => internal}/endpoints/uphold/post_create_transaction_uphold.cc (89%) rename components/brave_rewards/core/{ => internal}/endpoints/uphold/post_create_transaction_uphold.h (85%) rename components/brave_rewards/core/{ => internal}/endpoints/uphold/post_create_transaction_uphold_unittest.cc (81%) rename components/brave_rewards/core/{ => internal}/endpoints/uphold/post_oauth_uphold.cc (89%) rename components/brave_rewards/core/{ => internal}/endpoints/uphold/post_oauth_uphold.h (74%) rename components/brave_rewards/core/{ => internal}/endpoints/uphold/post_oauth_uphold_unittest.cc (82%) rename components/brave_rewards/core/{ => internal}/endpoints/zebpay/get_balance_zebpay.cc (90%) rename components/brave_rewards/core/{ => internal}/endpoints/zebpay/get_balance_zebpay.h (68%) rename components/brave_rewards/core/{ => internal}/endpoints/zebpay/get_balance_zebpay_unittest.cc (80%) rename components/brave_rewards/core/{ => internal}/endpoints/zebpay/post_oauth_zebpay.cc (94%) rename components/brave_rewards/core/{ => internal}/endpoints/zebpay/post_oauth_zebpay.h (76%) rename components/brave_rewards/core/{ => internal}/endpoints/zebpay/post_oauth_zebpay_unittest.cc (85%) rename components/brave_rewards/core/{ => internal}/gemini/gemini.cc (73%) rename components/brave_rewards/core/{ => internal}/gemini/gemini.h (68%) rename components/brave_rewards/core/{ => internal}/global_constants.h (76%) rename components/brave_rewards/core/{ => internal}/initialization_manager.cc (85%) rename components/brave_rewards/core/{ => internal}/initialization_manager.h (84%) rename components/brave_rewards/core/{ => internal}/legacy/DEPS (100%) rename components/brave_rewards/core/{ => internal}/legacy/bat_state.cc (82%) rename components/brave_rewards/core/{ => internal}/legacy/bat_state.h (71%) rename components/brave_rewards/core/{ => internal}/legacy/bat_util.cc (94%) rename components/brave_rewards/core/{ => internal}/legacy/bat_util.h (68%) rename components/brave_rewards/core/{ => internal}/legacy/bat_util_unittest.cc (95%) rename components/brave_rewards/core/{ => internal}/legacy/client_properties.cc (97%) rename components/brave_rewards/core/{ => internal}/legacy/client_properties.h (72%) rename components/brave_rewards/core/{ => internal}/legacy/client_state_unittest.cc (99%) rename components/brave_rewards/core/{ => internal}/legacy/publisher_settings_properties.cc (97%) rename components/brave_rewards/core/{ => internal}/legacy/publisher_settings_properties.h (76%) rename components/brave_rewards/core/{ => internal}/legacy/publisher_settings_state_unittest.cc (94%) rename components/brave_rewards/core/{ => internal}/legacy/publisher_state.cc (90%) rename components/brave_rewards/core/{ => internal}/legacy/publisher_state.h (74%) rename components/brave_rewards/core/{ => internal}/legacy/report_balance_properties.cc (96%) rename components/brave_rewards/core/{ => internal}/legacy/report_balance_properties.h (78%) rename components/brave_rewards/core/{ => internal}/legacy/report_balance_state_unittest.cc (94%) rename components/brave_rewards/core/{ => internal}/legacy/state_writer.h (71%) rename components/brave_rewards/core/{ => internal}/legacy/static_values.h (65%) rename components/brave_rewards/core/{ => internal}/legacy/wallet_info_properties.cc (97%) rename components/brave_rewards/core/{ => internal}/legacy/wallet_info_properties.h (79%) rename components/brave_rewards/core/{ => internal}/legacy/wallet_info_state_unittest.cc (96%) rename components/brave_rewards/core/{ => internal}/logging/event_log_keys.h (87%) rename components/brave_rewards/core/{ => internal}/logging/event_log_util.cc (90%) rename components/brave_rewards/core/{ => internal}/logging/event_log_util.h (60%) rename components/brave_rewards/core/{ => internal}/notifications/notification_keys.h (72%) rename components/brave_rewards/core/{ => internal}/parameters/rewards_parameters_provider.cc (94%) rename components/brave_rewards/core/{ => internal}/parameters/rewards_parameters_provider.h (82%) rename components/brave_rewards/core/{ => internal}/parameters/rewards_parameters_provider_unittest.cc (94%) rename components/brave_rewards/core/{ => internal}/publisher/media/helper.cc (94%) rename components/brave_rewards/core/{ => internal}/publisher/media/helper.h (71%) rename components/brave_rewards/core/{ => internal}/publisher/media/helper_unittest.cc (89%) rename components/brave_rewards/core/{ => internal}/publisher/media/media.cc (87%) rename components/brave_rewards/core/{ => internal}/publisher/media/media.h (81%) rename components/brave_rewards/core/{ => internal}/publisher/media/youtube.cc (97%) rename components/brave_rewards/core/{ => internal}/publisher/media/youtube.h (94%) rename components/brave_rewards/core/{ => internal}/publisher/media/youtube_unittest.cc (97%) rename components/brave_rewards/core/{ => internal}/publisher/prefix_iterator.h (92%) rename components/brave_rewards/core/{ => internal}/publisher/prefix_list_reader.cc (88%) rename components/brave_rewards/core/{ => internal}/publisher/prefix_list_reader.h (83%) rename components/brave_rewards/core/{ => internal}/publisher/prefix_list_reader_unittest.cc (96%) rename components/brave_rewards/core/{ => internal}/publisher/prefix_util.cc (92%) rename components/brave_rewards/core/{ => internal}/publisher/prefix_util.h (78%) rename components/brave_rewards/core/{ => internal}/publisher/protos/channel_response.proto (100%) rename components/brave_rewards/core/{ => internal}/publisher/protos/publisher_prefix_list.proto (100%) rename components/brave_rewards/core/{ => internal}/publisher/publisher.cc (96%) rename components/brave_rewards/core/{ => internal}/publisher/publisher.h (93%) rename components/brave_rewards/core/{ => internal}/publisher/publisher_prefix_list_updater.cc (90%) rename components/brave_rewards/core/{ => internal}/publisher/publisher_prefix_list_updater.h (82%) rename components/brave_rewards/core/{ => internal}/publisher/publisher_status_helper.cc (93%) rename components/brave_rewards/core/{ => internal}/publisher/publisher_status_helper.h (70%) rename components/brave_rewards/core/{ => internal}/publisher/publisher_unittest.cc (92%) rename components/brave_rewards/core/{ => internal}/publisher/server_publisher_fetcher.cc (89%) rename components/brave_rewards/core/{ => internal}/publisher/server_publisher_fetcher.h (80%) rename components/brave_rewards/core/{ => internal}/rewards_callbacks.h (87%) rename components/brave_rewards/core/{ => internal}/rewards_database.cc (99%) rename components/brave_rewards/core/{ => internal}/rewards_database.h (86%) rename components/brave_rewards/core/{ => internal}/rewards_engine.cc (82%) rename components/brave_rewards/core/{ => internal}/rewards_engine.h (96%) rename components/brave_rewards/core/{ => internal}/rewards_engine_helper.cc (91%) rename components/brave_rewards/core/{ => internal}/rewards_engine_helper.h (75%) rename components/brave_rewards/core/{ => internal}/rewards_log_stream.cc (93%) rename components/brave_rewards/core/{ => internal}/rewards_log_stream.h (81%) rename components/brave_rewards/core/{ => internal}/state/state.cc (73%) rename components/brave_rewards/core/{ => internal}/state/state.h (84%) rename components/brave_rewards/core/{ => internal}/state/state_keys.h (89%) rename components/brave_rewards/core/{ => internal}/state/state_migration.cc (94%) create mode 100644 components/brave_rewards/core/internal/state/state_migration.h rename components/brave_rewards/core/{ => internal}/state/state_migration_v1.cc (86%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v1.h (73%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v10.cc (92%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v10.h (67%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v11.cc (77%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v11.h (66%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v12.cc (91%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v12.h (69%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v13.cc (81%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v13.h (69%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v14.cc (78%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v14.h (74%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v2.cc (89%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v2.h (69%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v3.cc (90%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v3.h (61%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v4.cc (80%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v4.h (66%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v5.cc (68%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v5.h (66%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v6.cc (83%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v6.h (66%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v7.cc (77%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v7.h (66%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v8.cc (76%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v8.h (66%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v9.cc (90%) rename components/brave_rewards/core/{ => internal}/state/state_migration_v9.h (60%) create mode 100644 components/brave_rewards/core/internal/test/BUILD.gn rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v1.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v10.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v11.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v12.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v13.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v14.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v15.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v16.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v17.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v18.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v19.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v20.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v21.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v22.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v23.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v24.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v25.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v26.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v27.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v29.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v3.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v30.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v32.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v33.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v34.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v35.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v36.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v37.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v38.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v39.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v4.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v5.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v6.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v7.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v8.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_db_v9.sql (100%) rename components/brave_rewards/core/{ => internal}/test/data/publisher_info_schema_current.txt (100%) rename components/brave_rewards/core/{ => internal}/test/rewards_engine_test.cc (86%) rename components/brave_rewards/core/{ => internal}/test/rewards_engine_test.h (88%) rename components/brave_rewards/core/{ => internal}/test/test_rewards_engine_client.cc (98%) rename components/brave_rewards/core/{ => internal}/test/test_rewards_engine_client.h (93%) rename components/brave_rewards/core/{ => internal}/test/test_rewards_engine_client_unittest.cc (87%) rename components/brave_rewards/core/{ => internal}/uphold/uphold.cc (76%) rename components/brave_rewards/core/{ => internal}/uphold/uphold.h (67%) rename components/brave_rewards/core/{ => internal}/uphold/uphold_capabilities.h (66%) rename components/brave_rewards/core/{ => internal}/uphold/uphold_card.cc (92%) rename components/brave_rewards/core/{ => internal}/uphold/uphold_card.h (79%) rename components/brave_rewards/core/{ => internal}/uphold/uphold_user.cc (85%) rename components/brave_rewards/core/{ => internal}/uphold/uphold_user.h (71%) rename components/brave_rewards/core/{ => internal}/wallet/wallet.cc (81%) rename components/brave_rewards/core/{ => internal}/wallet/wallet.h (70%) rename components/brave_rewards/core/{ => internal}/wallet/wallet_balance.cc (77%) rename components/brave_rewards/core/{ => internal}/wallet/wallet_balance.h (72%) rename components/brave_rewards/core/{ => internal}/wallet/wallet_create.cc (82%) rename components/brave_rewards/core/{ => internal}/wallet/wallet_create.h (74%) rename components/brave_rewards/core/{ => internal}/wallet/wallet_unittest.cc (88%) rename components/brave_rewards/core/{ => internal}/wallet/wallet_util.cc (93%) rename components/brave_rewards/core/{ => internal}/wallet/wallet_util.h (82%) rename components/brave_rewards/core/{ => internal}/wallet/wallet_utils_unittest.cc (96%) rename components/brave_rewards/core/{ => internal}/wallet_provider/bitflyer/bitflyer_transfer.cc (83%) rename components/brave_rewards/core/{ => internal}/wallet_provider/bitflyer/bitflyer_transfer.h (59%) rename components/brave_rewards/core/{ => internal}/wallet_provider/bitflyer/connect_bitflyer_wallet.cc (80%) rename components/brave_rewards/core/{ => internal}/wallet_provider/bitflyer/connect_bitflyer_wallet.h (65%) rename components/brave_rewards/core/{ => internal}/wallet_provider/bitflyer/connect_bitflyer_wallet_unittest.cc (80%) rename components/brave_rewards/core/{ => internal}/wallet_provider/connect_external_wallet.cc (89%) rename components/brave_rewards/core/{ => internal}/wallet_provider/connect_external_wallet.h (79%) rename components/brave_rewards/core/{ => internal}/wallet_provider/connect_external_wallet_unittest.cc (93%) rename components/brave_rewards/core/{ => internal}/wallet_provider/gemini/connect_gemini_wallet.cc (87%) rename components/brave_rewards/core/{ => internal}/wallet_provider/gemini/connect_gemini_wallet.h (71%) rename components/brave_rewards/core/{ => internal}/wallet_provider/gemini/connect_gemini_wallet_unittest.cc (81%) rename components/brave_rewards/core/{ => internal}/wallet_provider/gemini/gemini_transfer.cc (85%) rename components/brave_rewards/core/{ => internal}/wallet_provider/gemini/gemini_transfer.h (59%) rename components/brave_rewards/core/{ => internal}/wallet_provider/linkage_checker.cc (88%) rename components/brave_rewards/core/{ => internal}/wallet_provider/linkage_checker.h (79%) rename components/brave_rewards/core/{ => internal}/wallet_provider/linkage_checker_unittest.cc (89%) rename components/brave_rewards/core/{ => internal}/wallet_provider/solana/solana_wallet_provider.cc (88%) rename components/brave_rewards/core/{ => internal}/wallet_provider/solana/solana_wallet_provider.h (74%) rename components/brave_rewards/core/{ => internal}/wallet_provider/solana/solana_wallet_provider_unittest.cc (91%) rename components/brave_rewards/core/{ => internal}/wallet_provider/transfer.cc (94%) rename components/brave_rewards/core/{ => internal}/wallet_provider/transfer.h (83%) rename components/brave_rewards/core/{ => internal}/wallet_provider/uphold/connect_uphold_wallet.cc (91%) rename components/brave_rewards/core/{ => internal}/wallet_provider/uphold/connect_uphold_wallet.h (65%) rename components/brave_rewards/core/{ => internal}/wallet_provider/uphold/connect_uphold_wallet_unittest.cc (80%) rename components/brave_rewards/core/{ => internal}/wallet_provider/uphold/uphold_transfer.cc (92%) rename components/brave_rewards/core/{ => internal}/wallet_provider/uphold/uphold_transfer.h (63%) rename components/brave_rewards/core/{ => internal}/wallet_provider/wallet_provider.cc (95%) rename components/brave_rewards/core/{ => internal}/wallet_provider/wallet_provider.h (85%) rename components/brave_rewards/core/{ => internal}/wallet_provider/zebpay/connect_zebpay_wallet.cc (82%) rename components/brave_rewards/core/{ => internal}/wallet_provider/zebpay/connect_zebpay_wallet.h (61%) rename components/brave_rewards/core/{ => internal}/wallet_provider/zebpay/connect_zebpay_wallet_unittest.cc (81%) rename components/brave_rewards/core/{ => internal}/zebpay/zebpay.cc (80%) rename components/brave_rewards/core/{ => internal}/zebpay/zebpay.h (70%) rename components/brave_rewards/{common => core}/mojom/BUILD.gn (100%) rename components/brave_rewards/{common => core}/mojom/rewards.mojom (100%) rename components/brave_rewards/{common => core}/mojom/rewards_core.mojom (98%) rename components/brave_rewards/{common => core}/mojom/rewards_database.mojom (100%) rename components/brave_rewards/{common => core}/mojom/rewards_engine.mojom (97%) rename components/brave_rewards/{common => core}/mojom/rewards_page.mojom (99%) rename components/brave_rewards/{common => core}/mojom/rewards_panel.mojom (100%) rename components/brave_rewards/{common => core}/mojom/rewards_tip_panel.mojom (96%) rename components/brave_rewards/{common => core}/pref_names.h (96%) rename components/brave_rewards/{common => core}/pref_registry.cc (97%) rename components/brave_rewards/{common => core}/pref_registry.h (71%) rename components/brave_rewards/{common => core}/publisher_utils.cc (96%) rename components/brave_rewards/{common => core}/publisher_utils.h (87%) rename components/brave_rewards/{common => core}/publisher_utils_unittest.cc (98%) rename components/brave_rewards/{common => core}/rewards_flags.cc (96%) rename components/brave_rewards/{common => core}/rewards_flags.h (75%) rename components/brave_rewards/{common => core}/rewards_util.cc (89%) rename components/brave_rewards/{common => core}/rewards_util.h (72%) delete mode 100644 components/brave_rewards/core/state/state_migration.h delete mode 100644 components/brave_rewards/core/test/BUILD.gn delete mode 100644 components/brave_rewards/test/BUILD.gn diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f6bb245875d3..8aa383fcee19 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -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 diff --git a/.storybook/BUILD.gn b/.storybook/BUILD.gn index 6ea66caa378c..109d76bb7438 100644 --- a/.storybook/BUILD.gn +++ b/.storybook/BUILD.gn @@ -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", diff --git a/android/android_browser_tests.gni b/android/android_browser_tests.gni index 9fbe0c403380..96faed3d72a1 100644 --- a/android/android_browser_tests.gni +++ b/android/android_browser_tests.gni @@ -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", @@ -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", diff --git a/android/java/org/chromium/chrome/browser/BraveRewardsBalance.java b/android/java/org/chromium/chrome/browser/BraveRewardsBalance.java index 077421460504..71e948095503 100644 --- a/android/java/org/chromium/chrome/browser/BraveRewardsBalance.java +++ b/android/java/org/chromium/chrome/browser/BraveRewardsBalance.java @@ -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"; diff --git a/android/java/org/chromium/chrome/browser/BraveRewardsNativeWorker.java b/android/java/org/chromium/chrome/browser/BraveRewardsNativeWorker.java index 2b68bcaf5ea0..2129fa0531d8 100644 --- a/android/java/org/chromium/chrome/browser/BraveRewardsNativeWorker.java +++ b/android/java/org/chromium/chrome/browser/BraveRewardsNativeWorker.java @@ -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; diff --git a/browser/BUILD.gn b/browser/BUILD.gn index 077834fa823b..80131625ef4e 100644 --- a/browser/BUILD.gn +++ b/browser/BUILD.gn @@ -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", ] diff --git a/browser/DEPS b/browser/DEPS index fb5442d1cf41..b14e360961d6 100644 --- a/browser/DEPS +++ b/browser/DEPS @@ -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", diff --git a/browser/about_flags.cc b/browser/about_flags.cc index ec5befc05f5a..9cd7fd17d228 100644 --- a/browser/about_flags.cc +++ b/browser/about_flags.cc @@ -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" diff --git a/browser/android/preferences/BUILD.gn b/browser/android/preferences/BUILD.gn index e6f04c6c93a1..2a9518035b09 100644 --- a/browser/android/preferences/BUILD.gn +++ b/browser/android/preferences/BUILD.gn @@ -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", @@ -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", diff --git a/browser/android/preferences/brave_pref_service_bridge.cc b/browser/android/preferences/brave_pref_service_bridge.cc index 8cabc3c57a24..fb69e5962096 100644 --- a/browser/android/preferences/brave_pref_service_bridge.cc +++ b/browser/android/preferences/brave_pref_service_bridge.cc @@ -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" diff --git a/browser/brave_ads/creatives/search_result_ad/BUILD.gn b/browser/brave_ads/creatives/search_result_ad/BUILD.gn index febf7f4f6edb..7ad94ab14a5d 100644 --- a/browser/brave_ads/creatives/search_result_ad/BUILD.gn +++ b/browser/brave_ads/creatives/search_result_ad/BUILD.gn @@ -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", @@ -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", ] diff --git a/browser/brave_ads/creatives/search_result_ad/creative_search_result_ad_tab_helper.cc b/browser/brave_ads/creatives/search_result_ad/creative_search_result_ad_tab_helper.cc index 381a53de5c66..27453d5293be 100644 --- a/browser/brave_ads/creatives/search_result_ad/creative_search_result_ad_tab_helper.cc +++ b/browser/brave_ads/creatives/search_result_ad/creative_search_result_ad_tab_helper.cc @@ -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" diff --git a/browser/brave_ads/creatives/search_result_ad/creative_search_result_ad_tab_helper_browsertest.cc b/browser/brave_ads/creatives/search_result_ad/creative_search_result_ad_tab_helper_browsertest.cc index bb0643253e26..1170fe95ddf6 100644 --- a/browser/brave_ads/creatives/search_result_ad/creative_search_result_ad_tab_helper_browsertest.cc +++ b/browser/brave_ads/creatives/search_result_ad/creative_search_result_ad_tab_helper_browsertest.cc @@ -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" diff --git a/browser/brave_ads/tabs/BUILD.gn b/browser/brave_ads/tabs/BUILD.gn index d9ca0686dc8d..83ddbe221f8d 100644 --- a/browser/brave_ads/tabs/BUILD.gn +++ b/browser/brave_ads/tabs/BUILD.gn @@ -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", @@ -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", diff --git a/browser/brave_ads/tabs/ads_tab_helper.cc b/browser/brave_ads/tabs/ads_tab_helper.cc index d3f2ec7fc228..6f16025a9725 100644 --- a/browser/brave_ads/tabs/ads_tab_helper.cc +++ b/browser/brave_ads/tabs/ads_tab_helper.cc @@ -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" diff --git a/browser/brave_ads/tabs/ads_tab_helper_browsertest.cc b/browser/brave_ads/tabs/ads_tab_helper_browsertest.cc index a7508b2d3fda..a0d86ffd2760 100644 --- a/browser/brave_ads/tabs/ads_tab_helper_browsertest.cc +++ b/browser/brave_ads/tabs/ads_tab_helper_browsertest.cc @@ -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" diff --git a/browser/brave_browser_main_parts.cc b/browser/brave_browser_main_parts.cc index 069500aac7d2..8c350d3c605e 100644 --- a/browser/brave_browser_main_parts.cc +++ b/browser/brave_browser_main_parts.cc @@ -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" diff --git a/browser/brave_content_browser_client.cc b/browser/brave_content_browser_client.cc index 7302bceddb59..7cfd78cb9a45 100644 --- a/browser/brave_content_browser_client.cc +++ b/browser/brave_content_browser_client.cc @@ -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" @@ -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" diff --git a/browser/brave_news/BUILD.gn b/browser/brave_news/BUILD.gn index 7ac8e4779a66..d3ec575abedd 100644 --- a/browser/brave_news/BUILD.gn +++ b/browser/brave_news/BUILD.gn @@ -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", diff --git a/browser/brave_prefs_browsertest.cc b/browser/brave_prefs_browsertest.cc index b2c010a5298d..14fd0d3ba45e 100644 --- a/browser/brave_prefs_browsertest.cc +++ b/browser/brave_prefs_browsertest.cc @@ -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" diff --git a/browser/brave_profile_prefs.cc b/browser/brave_profile_prefs.cc index 81a45ec7ee39..a841a4f25a21 100644 --- a/browser/brave_profile_prefs.cc +++ b/browser/brave_profile_prefs.cc @@ -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" diff --git a/browser/brave_rewards/BUILD.gn b/browser/brave_rewards/BUILD.gn index 5c06726241a2..cf2f126b4653 100644 --- a/browser/brave_rewards/BUILD.gn +++ b/browser/brave_rewards/BUILD.gn @@ -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") @@ -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", @@ -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", @@ -77,7 +77,7 @@ source_set("util") { ] deps = [ - "//brave/components/brave_rewards/common", + "//brave/components/brave_rewards/core", "//chrome/browser/profiles:profile", "//components/prefs", ] diff --git a/browser/brave_rewards/DEPS b/browser/brave_rewards/DEPS index 33231787a0e0..3de1ef855692 100644 --- a/browser/brave_rewards/DEPS +++ b/browser/brave_rewards/DEPS @@ -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", ] diff --git a/browser/brave_rewards/android/brave_rewards_native_worker.cc b/browser/brave_rewards/android/brave_rewards_native_worker.cc index 39e8c7a597b0..d0555cb48f9d 100644 --- a/browser/brave_rewards/android/brave_rewards_native_worker.cc +++ b/browser/brave_rewards/android/brave_rewards_native_worker.cc @@ -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" @@ -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" diff --git a/browser/brave_rewards/android/brave_rewards_native_worker.h b/browser/brave_rewards/android/brave_rewards_native_worker.h index 59e29b23c753..a88e408b7756 100644 --- a/browser/brave_rewards/android/brave_rewards_native_worker.h +++ b/browser/brave_rewards/android/brave_rewards_native_worker.h @@ -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/. */ #ifndef BRAVE_BROWSER_BRAVE_REWARDS_ANDROID_BRAVE_REWARDS_NATIVE_WORKER_H_ #define BRAVE_BROWSER_BRAVE_REWARDS_ANDROID_BRAVE_REWARDS_NATIVE_WORKER_H_ @@ -19,9 +19,9 @@ #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" #include "brave/components/brave_ads/core/mojom/brave_ads.mojom.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service_observer.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/content/rewards_notification_service_observer.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards { class RewardsService; diff --git a/browser/brave_rewards/creator_detection_script_injector.cc b/browser/brave_rewards/creator_detection_script_injector.cc index 3d3da31752b1..60b491e2970f 100644 --- a/browser/brave_rewards/creator_detection_script_injector.cc +++ b/browser/brave_rewards/creator_detection_script_injector.cc @@ -13,9 +13,9 @@ #include "base/strings/strcat.h" #include "base/strings/utf_string_conversions.h" #include "brave/browser/brave_rewards/rewards_util.h" -#include "brave/components/brave_rewards/common/features.h" -#include "brave/components/brave_rewards/common/pref_names.h" -#include "brave/components/brave_rewards/common/publisher_utils.h" +#include "brave/components/brave_rewards/core/features.h" +#include "brave/components/brave_rewards/core/pref_names.h" +#include "brave/components/brave_rewards/core/publisher_utils.h" #include "brave/components/brave_rewards/resources/grit/creator_detection_generated.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_isolated_world_ids.h" diff --git a/browser/brave_rewards/extension_rewards_notification_service_observer.cc b/browser/brave_rewards/extension_rewards_notification_service_observer.cc index 6471e3e4f197..e06aa932e60d 100644 --- a/browser/brave_rewards/extension_rewards_notification_service_observer.cc +++ b/browser/brave_rewards/extension_rewards_notification_service_observer.cc @@ -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 #include diff --git a/browser/brave_rewards/extension_rewards_notification_service_observer.h b/browser/brave_rewards/extension_rewards_notification_service_observer.h index 9fc8ce200507..a230dc5d7123 100644 --- a/browser/brave_rewards/extension_rewards_notification_service_observer.h +++ b/browser/brave_rewards/extension_rewards_notification_service_observer.h @@ -1,13 +1,13 @@ /* 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/. */ #ifndef BRAVE_BROWSER_BRAVE_REWARDS_EXTENSION_REWARDS_NOTIFICATION_SERVICE_OBSERVER_H_ #define BRAVE_BROWSER_BRAVE_REWARDS_EXTENSION_REWARDS_NOTIFICATION_SERVICE_OBSERVER_H_ #include "base/memory/raw_ptr.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service_observer.h" +#include "brave/components/brave_rewards/content/rewards_notification_service_observer.h" class Profile; diff --git a/browser/brave_rewards/extension_rewards_service_observer.cc b/browser/brave_rewards/extension_rewards_service_observer.cc index 6e312392ecd5..9b803a0fb3f8 100644 --- a/browser/brave_rewards/extension_rewards_service_observer.cc +++ b/browser/brave_rewards/extension_rewards_service_observer.cc @@ -1,17 +1,17 @@ /* 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/extension_rewards_service_observer.h" -#include #include +#include #include #include "base/base64.h" #include "brave/common/extensions/api/brave_rewards.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service.h" #include "chrome/browser/profiles/profile.h" #include "extensions/browser/event_router.h" diff --git a/browser/brave_rewards/extension_rewards_service_observer.h b/browser/brave_rewards/extension_rewards_service_observer.h index 71074bc09082..8e681ef25f73 100644 --- a/browser/brave_rewards/extension_rewards_service_observer.h +++ b/browser/brave_rewards/extension_rewards_service_observer.h @@ -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/. */ #ifndef BRAVE_BROWSER_BRAVE_REWARDS_EXTENSION_REWARDS_SERVICE_OBSERVER_H_ #define BRAVE_BROWSER_BRAVE_REWARDS_EXTENSION_REWARDS_SERVICE_OBSERVER_H_ @@ -11,8 +11,8 @@ #include #include "base/memory/raw_ptr.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" class Profile; diff --git a/browser/brave_rewards/rewards_prefs_util.cc b/browser/brave_rewards/rewards_prefs_util.cc index 50bae3198d2e..af7a6e48a847 100644 --- a/browser/brave_rewards/rewards_prefs_util.cc +++ b/browser/brave_rewards/rewards_prefs_util.cc @@ -1,11 +1,11 @@ /* 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/. */ #include "brave/browser/brave_rewards/rewards_prefs_util.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "components/prefs/pref_service.h" namespace brave_rewards { diff --git a/browser/brave_rewards/rewards_prefs_util.h b/browser/brave_rewards/rewards_prefs_util.h index a113e5969505..7cf75e168dd7 100644 --- a/browser/brave_rewards/rewards_prefs_util.h +++ b/browser/brave_rewards/rewards_prefs_util.h @@ -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/. */ #ifndef BRAVE_BROWSER_BRAVE_REWARDS_REWARDS_PREFS_UTIL_H_ #define BRAVE_BROWSER_BRAVE_REWARDS_REWARDS_PREFS_UTIL_H_ diff --git a/browser/brave_rewards/rewards_service_factory.cc b/browser/brave_rewards/rewards_service_factory.cc index 414063bb3679..f902f7df6fd3 100644 --- a/browser/brave_rewards/rewards_service_factory.cc +++ b/browser/brave_rewards/rewards_service_factory.cc @@ -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/rewards_service_factory.h" @@ -12,10 +12,10 @@ #include "brave/browser/brave_rewards/rewards_util.h" #include "brave/browser/brave_wallet/brave_wallet_service_factory.h" #include "brave/browser/ui/webui/brave_rewards_source.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service_observer.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" -#include "brave/components/brave_rewards/browser/rewards_service_impl.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" +#include "brave/components/brave_rewards/content/rewards_notification_service_observer.h" +#include "brave/components/brave_rewards/content/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.h" #include "chrome/browser/favicon/favicon_service_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" diff --git a/browser/brave_rewards/rewards_service_factory.h b/browser/brave_rewards/rewards_service_factory.h index 7ce47a54f5ce..73ffa5669288 100644 --- a/browser/brave_rewards/rewards_service_factory.h +++ b/browser/brave_rewards/rewards_service_factory.h @@ -1,14 +1,14 @@ /* 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/. */ #ifndef BRAVE_BROWSER_BRAVE_REWARDS_REWARDS_SERVICE_FACTORY_H_ #define BRAVE_BROWSER_BRAVE_REWARDS_REWARDS_SERVICE_FACTORY_H_ #include -#include "brave/components/brave_rewards/browser/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service.h" #include "chrome/browser/profiles/profile_manager_observer.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" diff --git a/browser/brave_rewards/rewards_tab_helper.cc b/browser/brave_rewards/rewards_tab_helper.cc index cdd15689c581..f6ad8b3b64ef 100644 --- a/browser/brave_rewards/rewards_tab_helper.cc +++ b/browser/brave_rewards/rewards_tab_helper.cc @@ -1,15 +1,15 @@ /* 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/rewards_tab_helper.h" #include #include "brave/browser/brave_rewards/rewards_service_factory.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" -#include "brave/components/brave_rewards/common/publisher_utils.h" +#include "brave/components/brave_rewards/content/rewards_service.h" +#include "brave/components/brave_rewards/core/publisher_utils.h" #include "chrome/browser/profiles/profile.h" #include "components/sessions/content/session_tab_helper.h" #include "content/public/browser/navigation_entry.h" diff --git a/browser/brave_rewards/rewards_tab_helper.h b/browser/brave_rewards/rewards_tab_helper.h index a583b605f0a6..00018733ae9d 100644 --- a/browser/brave_rewards/rewards_tab_helper.h +++ b/browser/brave_rewards/rewards_tab_helper.h @@ -15,7 +15,7 @@ #include "base/observer_list_types.h" #include "base/scoped_observation.h" #include "brave/browser/brave_rewards/creator_detection_script_injector.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" #include "build/build_config.h" #include "components/sessions/core/session_id.h" #include "content/public/browser/web_contents_observer.h" diff --git a/browser/brave_rewards/rewards_util.cc b/browser/brave_rewards/rewards_util.cc index 309b7cd045af..9bf474b882f1 100644 --- a/browser/brave_rewards/rewards_util.cc +++ b/browser/brave_rewards/rewards_util.cc @@ -1,11 +1,11 @@ /* 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/. */ #include "brave/browser/brave_rewards/rewards_util.h" -#include "brave/components/brave_rewards/common/rewards_util.h" +#include "brave/components/brave_rewards/core/rewards_util.h" #include "chrome/browser/profiles/profile.h" namespace brave_rewards { diff --git a/browser/brave_rewards/rewards_util.h b/browser/brave_rewards/rewards_util.h index 35aa1500544f..783bac5f99dc 100644 --- a/browser/brave_rewards/rewards_util.h +++ b/browser/brave_rewards/rewards_util.h @@ -1,12 +1,12 @@ /* 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/. */ #ifndef BRAVE_BROWSER_BRAVE_REWARDS_REWARDS_UTIL_H_ #define BRAVE_BROWSER_BRAVE_REWARDS_REWARDS_UTIL_H_ -#include "brave/components/brave_rewards/common/rewards_util.h" +#include "brave/components/brave_rewards/core/rewards_util.h" class Profile; diff --git a/browser/brave_rewards/test/BUILD.gn b/browser/brave_rewards/test/BUILD.gn index 85858e3fafec..70fcd76ce435 100644 --- a/browser/brave_rewards/test/BUILD.gn +++ b/browser/brave_rewards/test/BUILD.gn @@ -1,20 +1,45 @@ # 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("//testing/test.gni") source_set("browser_tests") { testonly = true - sources = [ "creator_detection_browsertest.cc" ] + sources = [ + "creator_detection_browsertest.cc", + "rewards_browsertest.cc", + "rewards_contribution_browsertest.cc", + "rewards_flag_browsertest.cc", + "rewards_notification_browsertest.cc", + "rewards_p3a_browsertest.cc", + "rewards_publisher_browsertest.cc", + "rewards_state_browsertest.cc", + "util/rewards_browsertest_context_helper.cc", + "util/rewards_browsertest_context_helper.h", + "util/rewards_browsertest_context_util.cc", + "util/rewards_browsertest_context_util.h", + "util/rewards_browsertest_contribution.cc", + "util/rewards_browsertest_contribution.h", + "util/rewards_browsertest_network_util.cc", + "util/rewards_browsertest_network_util.h", + "util/rewards_browsertest_response.cc", + "util/rewards_browsertest_response.h", + "util/rewards_browsertest_util.cc", + "util/rewards_browsertest_util.h", + ] deps = [ "//base/test:test_support", "//brave/browser/brave_rewards", - "//brave/components/brave_rewards/common", - "//brave/components/brave_rewards/common:features", + "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core:features", + "//brave/components/brave_rewards/core/buildflags", + "//brave/components/brave_rewards/core/internal:publishers_proto", + "//brave/components/brave_rewards/core/mojom:core", + "//brave/components/ntp_background_images/common", "//chrome/browser/profiles:profile", "//chrome/browser/ui", "//chrome/test:test_support", @@ -39,11 +64,11 @@ source_set("browser_tests") { "//brave/browser", "//brave/browser/brave_ads", "//brave/browser/brave_rewards:util", - "//brave/components/brave_rewards/browser", + "//brave/components/brave_rewards/content", "//brave/components/l10n/common:test_support", "//components/policy/core/browser", "//components/policy/core/common:test_support", "//components/user_prefs", ] } -} # source_set("browser_tests") +} diff --git a/browser/brave_rewards/test/DEPS b/browser/brave_rewards/test/DEPS new file mode 100644 index 000000000000..59e5819850fd --- /dev/null +++ b/browser/brave_rewards/test/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + "+brave/components/ntp_background_images/common" +] diff --git a/browser/brave_rewards/test/creator_detection_browsertest.cc b/browser/brave_rewards/test/creator_detection_browsertest.cc index c47a44b7fbf2..b18699a32145 100644 --- a/browser/brave_rewards/test/creator_detection_browsertest.cc +++ b/browser/brave_rewards/test/creator_detection_browsertest.cc @@ -15,9 +15,9 @@ #include "base/timer/timer.h" #include "brave/browser/brave_rewards/rewards_service_factory.h" #include "brave/browser/brave_rewards/rewards_tab_helper.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/content/rewards_service.h" +#include "brave/components/brave_rewards/core/features.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/test/base/chrome_test_utils.h" diff --git a/components/brave_rewards/browser/test/rewards_browsertest.cc b/browser/brave_rewards/test/rewards_browsertest.cc similarity index 84% rename from components/brave_rewards/browser/test/rewards_browsertest.cc rename to browser/brave_rewards/test/rewards_browsertest.cc index 3a434668308d..a9f8d0f57f7b 100644 --- a/components/brave_rewards/browser/test/rewards_browsertest.cc +++ b/browser/brave_rewards/test/rewards_browsertest.cc @@ -1,7 +1,7 @@ /* Copyright (c) 2020 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 #include @@ -12,16 +12,16 @@ #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "brave/browser/brave_rewards/rewards_service_factory.h" -#include "brave/components/brave_rewards/browser/rewards_service_impl.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_contribution.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_response.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.h" -#include "brave/components/brave_rewards/common/features.h" -#include "brave/components/brave_rewards/common/pref_names.h" -#include "brave/components/brave_rewards/core/global_constants.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_helper.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_contribution.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_network_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_response.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_util.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.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/constants/brave_paths.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/test/base/in_process_browser_test.h" @@ -93,10 +93,8 @@ class RewardsBrowserTest : public InProcessBrowserTest { // Response mock base::ScopedAllowBlockingForTesting allow_blocking; response_->LoadMocks(); - rewards_service_->ForTestingSetTestResponseCallback( - base::BindRepeating( - &RewardsBrowserTest::GetTestResponse, - base::Unretained(this))); + rewards_service_->ForTestingSetTestResponseCallback(base::BindRepeating( + &RewardsBrowserTest::GetTestResponse, base::Unretained(this))); rewards_service_->SetEngineEnvForTesting(); // Other @@ -105,9 +103,7 @@ class RewardsBrowserTest : public InProcessBrowserTest { test_util::SetOnboardingBypassed(browser()); } - void TearDown() override { - InProcessBrowserTest::TearDown(); - } + void TearDown() override { InProcessBrowserTest::TearDown(); } void SetUpCommandLine(base::CommandLine* command_line) override { // HTTPS server only serves a valid cert for localhost, so this is needed @@ -115,18 +111,13 @@ class RewardsBrowserTest : public InProcessBrowserTest { command_line->AppendSwitch(switches::kIgnoreCertificateErrors); } - void GetTestResponse( - const std::string& url, - int32_t method, - int* response_status_code, - std::string* response, - base::flat_map* headers) { + void GetTestResponse(const std::string& url, + int32_t method, + int* response_status_code, + std::string* response, + base::flat_map* headers) { response_->SetExternalBalance(contribution_->GetExternalBalance()); - response_->Get( - url, - method, - response_status_code, - response); + response_->Get(url, method, response_status_code, response); } content::WebContents* contents() const { @@ -134,8 +125,9 @@ class RewardsBrowserTest : public InProcessBrowserTest { } GURL uphold_auth_url() { - GURL url("chrome://rewards/uphold/authorization?" - "code=0c42b34121f624593ee3b04cbe4cc6ddcd72d&state=123456789"); + GURL url( + "chrome://rewards/uphold/authorization?" + "code=0c42b34121f624593ee3b04cbe4cc6ddcd72d&state=123456789"); return url; } diff --git a/components/brave_rewards/browser/test/rewards_contribution_browsertest.cc b/browser/brave_rewards/test/rewards_contribution_browsertest.cc similarity index 89% rename from components/brave_rewards/browser/test/rewards_contribution_browsertest.cc rename to browser/brave_rewards/test/rewards_contribution_browsertest.cc index f1f7e6d45039..c7b1884fc2e7 100644 --- a/components/brave_rewards/browser/test/rewards_contribution_browsertest.cc +++ b/browser/brave_rewards/test/rewards_contribution_browsertest.cc @@ -1,7 +1,7 @@ /* Copyright (c) 2020 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 #include @@ -12,14 +12,14 @@ #include "base/test/bind.h" #include "base/threading/platform_thread.h" #include "brave/browser/brave_rewards/rewards_service_factory.h" -#include "brave/components/brave_rewards/browser/rewards_service_impl.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_contribution.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_response.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_helper.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_contribution.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_network_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_response.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_util.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/constants/brave_paths.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/testing_profile.h" @@ -66,9 +66,8 @@ class RewardsContributionBrowserTest : public InProcessBrowserTest { base::ScopedAllowBlockingForTesting allow_blocking; response_->LoadMocks(); rewards_service_->ForTestingSetTestResponseCallback( - base::BindRepeating( - &RewardsContributionBrowserTest::GetTestResponse, - base::Unretained(this))); + base::BindRepeating(&RewardsContributionBrowserTest::GetTestResponse, + base::Unretained(this))); rewards_service_->SetEngineEnvForTesting(); // Other @@ -77,9 +76,7 @@ class RewardsContributionBrowserTest : public InProcessBrowserTest { test_util::SetOnboardingBypassed(browser()); } - void TearDown() override { - InProcessBrowserTest::TearDown(); - } + void TearDown() override { InProcessBrowserTest::TearDown(); } void SetUpCommandLine(base::CommandLine* command_line) override { InProcessBrowserTest::SetUpCommandLine(command_line); @@ -88,18 +85,13 @@ class RewardsContributionBrowserTest : public InProcessBrowserTest { command_line->AppendSwitch(switches::kIgnoreCertificateErrors); } - void GetTestResponse( - const std::string& url, - int32_t method, - int* response_status_code, - std::string* response, - base::flat_map* headers) { + void GetTestResponse(const std::string& url, + int32_t method, + int* response_status_code, + std::string* response, + base::flat_map* headers) { response_->SetExternalBalance(contribution_->GetExternalBalance()); - response_->Get( - url, - method, - response_status_code, - response); + response_->Get(url, method, response_status_code, response); } content::WebContents* contents() { diff --git a/components/brave_rewards/browser/test/rewards_flag_browsertest.cc b/browser/brave_rewards/test/rewards_flag_browsertest.cc similarity index 90% rename from components/brave_rewards/browser/test/rewards_flag_browsertest.cc rename to browser/brave_rewards/test/rewards_flag_browsertest.cc index ed2ee74a2e87..b3639147f922 100644 --- a/components/brave_rewards/browser/test/rewards_flag_browsertest.cc +++ b/browser/brave_rewards/test/rewards_flag_browsertest.cc @@ -1,7 +1,7 @@ /* Copyright (c) 2020 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 @@ -11,11 +11,11 @@ #include "base/run_loop.h" #include "base/test/scoped_command_line.h" #include "brave/browser/brave_rewards/rewards_service_factory.h" -#include "brave/components/brave_rewards/browser/rewards_service_impl.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_response.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.h" -#include "brave/components/brave_rewards/common/rewards_flags.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_network_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_response.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_util.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" +#include "brave/components/brave_rewards/core/rewards_flags.h" #include "brave/components/constants/brave_paths.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/test/base/in_process_browser_test.h" @@ -57,26 +57,19 @@ class RewardsFlagBrowserTest : public InProcessBrowserTest { // Response mock base::ScopedAllowBlockingForTesting allow_blocking; response_->LoadMocks(); - rewards_service_->ForTestingSetTestResponseCallback( - base::BindRepeating( - &RewardsFlagBrowserTest::GetTestResponse, - base::Unretained(this))); + rewards_service_->ForTestingSetTestResponseCallback(base::BindRepeating( + &RewardsFlagBrowserTest::GetTestResponse, base::Unretained(this))); rewards_service_->SetEngineEnvForTesting(); test_util::SetOnboardingBypassed(browser()); } - void GetTestResponse( - const std::string& url, - int32_t method, - int* response_status_code, - std::string* response, - base::flat_map* headers) { - response_->Get( - url, - method, - response_status_code, - response); + void GetTestResponse(const std::string& url, + int32_t method, + int* response_status_code, + std::string* response, + base::flat_map* headers) { + response_->Get(url, method, response_status_code, response); } void TearDownOnMainThread() override { diff --git a/components/brave_rewards/browser/test/rewards_notification_browsertest.cc b/browser/brave_rewards/test/rewards_notification_browsertest.cc similarity index 82% rename from components/brave_rewards/browser/test/rewards_notification_browsertest.cc rename to browser/brave_rewards/test/rewards_notification_browsertest.cc index 84073062bfc4..dc1841c958a2 100644 --- a/components/brave_rewards/browser/test/rewards_notification_browsertest.cc +++ b/browser/brave_rewards/test/rewards_notification_browsertest.cc @@ -1,21 +1,21 @@ /* 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 #include "base/containers/flat_map.h" #include "base/memory/raw_ptr.h" #include "brave/browser/brave_rewards/rewards_service_factory.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service_observer.h" -#include "brave/components/brave_rewards/browser/rewards_service_impl.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_contribution.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_response.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_helper.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_contribution.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_network_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_response.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_util.h" +#include "brave/components/brave_rewards/content/rewards_notification_service.h" +#include "brave/components/brave_rewards/content/rewards_notification_service_observer.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" #include "brave/components/constants/brave_paths.h" #include "chrome/browser/ui/browser.h" #include "chrome/test/base/in_process_browser_test.h" @@ -66,9 +66,8 @@ class RewardsNotificationBrowserTest base::ScopedAllowBlockingForTesting allow_blocking; response_->LoadMocks(); rewards_service_->ForTestingSetTestResponseCallback( - base::BindRepeating( - &RewardsNotificationBrowserTest::GetTestResponse, - base::Unretained(this))); + base::BindRepeating(&RewardsNotificationBrowserTest::GetTestResponse, + base::Unretained(this))); rewards_service_->SetEngineEnvForTesting(); // Other @@ -79,9 +78,7 @@ class RewardsNotificationBrowserTest test_util::SetOnboardingBypassed(browser()); } - void TearDown() override { - InProcessBrowserTest::TearDown(); - } + void TearDown() override { InProcessBrowserTest::TearDown(); } void SetUpCommandLine(base::CommandLine* command_line) override { // HTTPS server only serves a valid cert for localhost, so this is needed @@ -89,17 +86,12 @@ class RewardsNotificationBrowserTest command_line->AppendSwitch(switches::kIgnoreCertificateErrors); } - void GetTestResponse( - const std::string& url, - int32_t method, - int* response_status_code, - std::string* response, - base::flat_map* headers) { - response_->Get( - url, - method, - response_status_code, - response); + void GetTestResponse(const std::string& url, + int32_t method, + int* response_status_code, + std::string* response, + base::flat_map* headers) { + response_->Get(url, method, response_status_code, response); } void OnNotificationAdded( diff --git a/browser/brave_rewards/test/rewards_ofac_browsertest.cc b/browser/brave_rewards/test/rewards_ofac_browsertest.cc index 164fd687c125..1feffca62f2e 100644 --- a/browser/brave_rewards/test/rewards_ofac_browsertest.cc +++ b/browser/brave_rewards/test/rewards_ofac_browsertest.cc @@ -1,14 +1,14 @@ /* 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/. */ #include "brave/app/brave_command_ids.h" #include "brave/browser/brave_ads/ads_service_factory.h" #include "brave/browser/brave_rewards/rewards_service_factory.h" #include "brave/browser/brave_rewards/rewards_util.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" -#include "brave/components/brave_rewards/common/rewards_util.h" +#include "brave/components/brave_rewards/content/rewards_service.h" +#include "brave/components/brave_rewards/core/rewards_util.h" #include "brave/components/l10n/common/test/scoped_default_locale.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_command_controller.h" diff --git a/components/brave_rewards/browser/test/rewards_p3a_browsertest.cc b/browser/brave_rewards/test/rewards_p3a_browsertest.cc similarity index 90% rename from components/brave_rewards/browser/test/rewards_p3a_browsertest.cc rename to browser/brave_rewards/test/rewards_p3a_browsertest.cc index 3cf93c367502..ed69692b28d5 100644 --- a/components/brave_rewards/browser/test/rewards_p3a_browsertest.cc +++ b/browser/brave_rewards/test/rewards_p3a_browsertest.cc @@ -1,7 +1,9 @@ /* Copyright (c) 2021 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/components/brave_rewards/content/rewards_p3a.h" #include #include @@ -11,16 +13,15 @@ #include "base/test/bind.h" #include "base/test/metrics/histogram_tester.h" #include "brave/browser/brave_rewards/rewards_service_factory.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_contribution.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_network_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_response.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_util.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_impl.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_contribution.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_response.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/constants/brave_paths.h" #include "brave/components/ntp_background_images/common/pref_names.h" #include "chrome/browser/browser_process.h" diff --git a/browser/brave_rewards/test/rewards_page_browsertest.cc b/browser/brave_rewards/test/rewards_page_browsertest.cc index d6419abd15f2..34fdfe7e9f5f 100644 --- a/browser/brave_rewards/test/rewards_page_browsertest.cc +++ b/browser/brave_rewards/test/rewards_page_browsertest.cc @@ -17,9 +17,9 @@ #include "base/test/scoped_feature_list.h" #include "brave/browser/brave_rewards/rewards_service_factory.h" #include "brave/browser/ui/brave_rewards/rewards_panel_coordinator.h" -#include "brave/components/brave_rewards/browser/rewards_service_impl.h" -#include "brave/components/brave_rewards/common/features.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" +#include "brave/components/brave_rewards/core/features.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/constants/brave_paths.h" #include "brave/components/constants/webui_url_constants.h" #include "chrome/browser/profiles/profile.h" diff --git a/browser/brave_rewards/test/rewards_policy_browsertest.cc b/browser/brave_rewards/test/rewards_policy_browsertest.cc index 8db27cc33c87..fe88b2fbac07 100644 --- a/browser/brave_rewards/test/rewards_policy_browsertest.cc +++ b/browser/brave_rewards/test/rewards_policy_browsertest.cc @@ -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/. */ #include "brave/app/brave_command_ids.h" #include "brave/browser/brave_ads/ads_service_factory.h" @@ -10,9 +10,9 @@ #include "brave/browser/ui/views/brave_actions/brave_actions_container.h" #include "brave/browser/ui/views/brave_actions/brave_rewards_action_view.h" #include "brave/browser/ui/views/location_bar/brave_location_bar_view.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" -#include "brave/components/brave_rewards/common/pref_names.h" -#include "brave/components/brave_rewards/common/rewards_util.h" +#include "brave/components/brave_rewards/content/rewards_service.h" +#include "brave/components/brave_rewards/core/pref_names.h" +#include "brave/components/brave_rewards/core/rewards_util.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_command_controller.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" diff --git a/components/brave_rewards/browser/test/rewards_publisher_browsertest.cc b/browser/brave_rewards/test/rewards_publisher_browsertest.cc similarity index 78% rename from components/brave_rewards/browser/test/rewards_publisher_browsertest.cc rename to browser/brave_rewards/test/rewards_publisher_browsertest.cc index 0eb929d29996..19072b1b983e 100644 --- a/components/brave_rewards/browser/test/rewards_publisher_browsertest.cc +++ b/browser/brave_rewards/test/rewards_publisher_browsertest.cc @@ -1,19 +1,19 @@ /* Copyright (c) 2020 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 #include "base/containers/flat_map.h" #include "base/memory/raw_ptr.h" #include "brave/browser/brave_rewards/rewards_service_factory.h" -#include "brave/components/brave_rewards/browser/rewards_service_impl.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_response.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_helper.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_network_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_response.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_util.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" #include "brave/components/constants/brave_paths.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/test/base/in_process_browser_test.h" @@ -56,18 +56,14 @@ class RewardsPublisherBrowserTest : public InProcessBrowserTest { // Response mock base::ScopedAllowBlockingForTesting allow_blocking; response_->LoadMocks(); - rewards_service_->ForTestingSetTestResponseCallback( - base::BindRepeating( - &RewardsPublisherBrowserTest::GetTestResponse, - base::Unretained(this))); + rewards_service_->ForTestingSetTestResponseCallback(base::BindRepeating( + &RewardsPublisherBrowserTest::GetTestResponse, base::Unretained(this))); rewards_service_->SetEngineEnvForTesting(); test_util::SetOnboardingBypassed(browser()); } - void TearDown() override { - InProcessBrowserTest::TearDown(); - } + void TearDown() override { InProcessBrowserTest::TearDown(); } void SetUpCommandLine(base::CommandLine* command_line) override { // HTTPS server only serves a valid cert for localhost, so this is needed @@ -75,17 +71,12 @@ class RewardsPublisherBrowserTest : public InProcessBrowserTest { command_line->AppendSwitch(switches::kIgnoreCertificateErrors); } - void GetTestResponse( - const std::string& url, - int32_t method, - int* response_status_code, - std::string* response, - base::flat_map* headers) { - response_->Get( - url, - method, - response_status_code, - response); + void GetTestResponse(const std::string& url, + int32_t method, + int* response_status_code, + std::string* response, + base::flat_map* headers) { + response_->Get(url, method, response_status_code, response); } content::WebContents* contents() { diff --git a/components/brave_rewards/browser/test/rewards_state_browsertest.cc b/browser/brave_rewards/test/rewards_state_browsertest.cc similarity index 94% rename from components/brave_rewards/browser/test/rewards_state_browsertest.cc rename to browser/brave_rewards/test/rewards_state_browsertest.cc index 0ecfb342af4a..7afd5846f470 100644 --- a/components/brave_rewards/browser/test/rewards_state_browsertest.cc +++ b/browser/brave_rewards/test/rewards_state_browsertest.cc @@ -1,7 +1,7 @@ /* Copyright (c) 2020 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 #include @@ -20,13 +20,13 @@ #include "base/strings/stringprintf.h" #include "base/test/bind.h" #include "brave/browser/brave_rewards/rewards_service_factory.h" -#include "brave/components/brave_rewards/browser/rewards_service_impl.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_response.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/buildflags.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_network_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_response.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_util.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" +#include "brave/components/brave_rewards/core/internal/buildflags.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" #include "brave/components/constants/brave_paths.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/common/chrome_paths.h" @@ -73,29 +73,20 @@ class RewardsStateBrowserTest : public InProcessBrowserTest { // Response mock base::ScopedAllowBlockingForTesting allow_blocking; response_->LoadMocks(); - rewards_service_->ForTestingSetTestResponseCallback( - base::BindRepeating( - &RewardsStateBrowserTest::GetTestResponse, - base::Unretained(this))); + rewards_service_->ForTestingSetTestResponseCallback(base::BindRepeating( + &RewardsStateBrowserTest::GetTestResponse, base::Unretained(this))); rewards_service_->SetEngineEnvForTesting(); } - void GetTestResponse( - const std::string& url, - int32_t method, - int* response_status_code, - std::string* response, - base::flat_map* headers) { - response_->Get( - url, - method, - response_status_code, - response); + void GetTestResponse(const std::string& url, + int32_t method, + int* response_status_code, + std::string* response, + base::flat_map* headers) { + response_->Get(url, method, response_status_code, response); } - void TearDown() override { - InProcessBrowserTest::TearDown(); - } + void TearDown() override { InProcessBrowserTest::TearDown(); } void GetMigrationVersionFromTest(int32_t* version) { if (!version) { @@ -109,10 +100,7 @@ class RewardsStateBrowserTest : public InProcessBrowserTest { std::string test_name = test_info->name(); auto version_split = base::SplitStringUsingSubstr( - test_name, - "_", - base::TRIM_WHITESPACE, - base::SPLIT_WANT_NONEMPTY); + test_name, "_", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); if (version_split.size() != 2) { return; @@ -188,14 +176,13 @@ class RewardsStateBrowserTest : public InProcessBrowserTest { IN_PROC_BROWSER_TEST_F(RewardsStateBrowserTest, State_1) { profile_->GetPrefs()->SetInteger("brave.rewards.version", -1); test_util::StartProcess(rewards_service_); - EXPECT_EQ( - profile_->GetPrefs()->GetInteger("brave.rewards.ac.min_visit_time"), - 5); + EXPECT_EQ(profile_->GetPrefs()->GetInteger("brave.rewards.ac.min_visit_time"), + 5); EXPECT_EQ(profile_->GetPrefs()->GetInteger("brave.rewards.ac.min_visits"), 5); EXPECT_EQ(profile_->GetPrefs()->GetDouble("brave.rewards.ac.score.a"), - 14500.0); + 14500.0); EXPECT_EQ(profile_->GetPrefs()->GetDouble("brave.rewards.ac.score.b"), - -14000.0); + -14000.0); rewards_service_->GetBalanceReport( 4, 2020, @@ -232,18 +219,13 @@ IN_PROC_BROWSER_TEST_F(RewardsStateBrowserTest, State_2) { EXPECT_EQ( wallet_json, R"({"payment_id":"eea767c4-cd27-4411-afd4-78a9c6b54dbc","recovery_seed":"PgFfhazUJuf8dX+8ckTjrtK1KMLyrfXmKJFDiS1Ad3I="})"); // NOLINT - EXPECT_EQ( - profile_->GetPrefs()->GetUint64("brave.rewards.creation_stamp"), - 1590484778ul); + EXPECT_EQ(profile_->GetPrefs()->GetUint64("brave.rewards.creation_stamp"), + 1590484778ul); EXPECT_EQ( profile_->GetPrefs()->GetUint64("brave.rewards.ac.next_reconcile_stamp"), 2593076778ul); - EXPECT_EQ( - profile_->GetPrefs()->GetDouble("brave.rewards.ac.amount"), - 20.0); - EXPECT_EQ( - profile_->GetPrefs()->GetBoolean("brave.rewards.ac.enabled"), - true); + EXPECT_EQ(profile_->GetPrefs()->GetDouble("brave.rewards.ac.amount"), 20.0); + EXPECT_EQ(profile_->GetPrefs()->GetBoolean("brave.rewards.ac.enabled"), true); } IN_PROC_BROWSER_TEST_F(RewardsStateBrowserTest, V8RewardsEnabledACEnabled) { @@ -251,9 +233,7 @@ IN_PROC_BROWSER_TEST_F(RewardsStateBrowserTest, V8RewardsEnabledACEnabled) { profile_->GetPrefs()->SetBoolean("brave.rewards.enabled", true); profile_->GetPrefs()->SetBoolean("brave.rewards.ac.enabled", true); test_util::StartProcess(rewards_service_); - EXPECT_EQ( - profile_->GetPrefs()->GetBoolean("brave.rewards.ac.enabled"), - true); + EXPECT_EQ(profile_->GetPrefs()->GetBoolean("brave.rewards.ac.enabled"), true); } IN_PROC_BROWSER_TEST_F(RewardsStateBrowserTest, V8RewardsEnabledACDisabled) { @@ -261,9 +241,8 @@ IN_PROC_BROWSER_TEST_F(RewardsStateBrowserTest, V8RewardsEnabledACDisabled) { profile_->GetPrefs()->SetBoolean("brave.rewards.enabled", true); profile_->GetPrefs()->SetBoolean("brave.rewards.ac.enabled", false); test_util::StartProcess(rewards_service_); - EXPECT_EQ( - profile_->GetPrefs()->GetBoolean("brave.rewards.ac.enabled"), - false); + EXPECT_EQ(profile_->GetPrefs()->GetBoolean("brave.rewards.ac.enabled"), + false); } IN_PROC_BROWSER_TEST_F(RewardsStateBrowserTest, V8RewardsDisabledACEnabled) { @@ -271,9 +250,8 @@ IN_PROC_BROWSER_TEST_F(RewardsStateBrowserTest, V8RewardsDisabledACEnabled) { profile_->GetPrefs()->SetBoolean("brave.rewards.enabled", false); profile_->GetPrefs()->SetBoolean("brave.rewards.ac.enabled", true); test_util::StartProcess(rewards_service_); - EXPECT_EQ( - profile_->GetPrefs()->GetBoolean("brave.rewards.ac.enabled"), - false); + EXPECT_EQ(profile_->GetPrefs()->GetBoolean("brave.rewards.ac.enabled"), + false); } IN_PROC_BROWSER_TEST_F(RewardsStateBrowserTest, V8RewardsDisabledACDisabled) { @@ -281,9 +259,8 @@ IN_PROC_BROWSER_TEST_F(RewardsStateBrowserTest, V8RewardsDisabledACDisabled) { profile_->GetPrefs()->SetBoolean("brave.rewards.enabled", false); profile_->GetPrefs()->SetBoolean("brave.rewards.ac.enabled", false); test_util::StartProcess(rewards_service_); - EXPECT_EQ( - profile_->GetPrefs()->GetBoolean("brave.rewards.ac.enabled"), - false); + EXPECT_EQ(profile_->GetPrefs()->GetBoolean("brave.rewards.ac.enabled"), + false); } IN_PROC_BROWSER_TEST_F(RewardsStateBrowserTest, V11ValidWallet) { diff --git a/components/brave_rewards/browser/test/common/DEPS b/browser/brave_rewards/test/util/DEPS similarity index 100% rename from components/brave_rewards/browser/test/common/DEPS rename to browser/brave_rewards/test/util/DEPS diff --git a/components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.cc b/browser/brave_rewards/test/util/rewards_browsertest_context_helper.cc similarity index 91% rename from components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.cc rename to browser/brave_rewards/test/util/rewards_browsertest_context_helper.cc index c5c0d233ff1c..e516cb99c77e 100644 --- a/components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.cc +++ b/browser/brave_rewards/test/util/rewards_browsertest_context_helper.cc @@ -1,16 +1,16 @@ /* Copyright (c) 2020 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/components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_helper.h" #include #include "base/test/bind.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_util.h" #include "brave/browser/ui/brave_rewards/rewards_panel_coordinator.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/test/browser_test_utils.h" @@ -92,9 +92,7 @@ void RewardsBrowserTestContextHelper::VisitPublisher(const GURL& url, bool verified) { const std::string publisher = url.host(); ui_test_utils::NavigateToURLWithDisposition( - browser_, - url, - WindowOpenDisposition::NEW_FOREGROUND_TAB, + browser_, url, WindowOpenDisposition::NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP); // The minimum publisher duration when testing is 1 second (and the diff --git a/components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.h b/browser/brave_rewards/test/util/rewards_browsertest_context_helper.h similarity index 77% rename from components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.h rename to browser/brave_rewards/test/util/rewards_browsertest_context_helper.h index 13cb48127b9e..2b8bb6df9a2b 100644 --- a/components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.h +++ b/browser/brave_rewards/test/util/rewards_browsertest_context_helper.h @@ -1,10 +1,10 @@ /* Copyright (c) 2020 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/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_CONTEXT_HELPER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_CONTEXT_HELPER_H_ +#ifndef BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_CONTEXT_HELPER_H_ +#define BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_CONTEXT_HELPER_H_ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" @@ -46,4 +46,4 @@ class RewardsBrowserTestContextHelper { } // namespace brave_rewards::test_util -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_CONTEXT_HELPER_H_ +#endif // BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_CONTEXT_HELPER_H_ diff --git a/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.cc b/browser/brave_rewards/test/util/rewards_browsertest_context_util.cc similarity index 75% rename from components/brave_rewards/browser/test/common/rewards_browsertest_context_util.cc rename to browser/brave_rewards/test/util/rewards_browsertest_context_util.cc index a7a3913403fe..2433ea010f19 100644 --- a/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.cc +++ b/browser/brave_rewards/test/util/rewards_browsertest_context_util.cc @@ -1,9 +1,9 @@ /* Copyright (c) 2020 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/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_util.h" #include "base/strings/stringprintf.h" #include "content/public/test/browser_test_utils.h" @@ -49,15 +49,14 @@ constexpr char kWaitForElementToAppearScript[] = R"( } // namespace -void WaitForElementToAppear( - content::WebContents* context, - const std::string& selector, - bool should_appear) { - if (!context) +void WaitForElementToAppear(content::WebContents* context, + const std::string& selector, + bool should_appear) { + if (!context) { return; + } - auto script = kWaitForElementToAppearScript + - content::JsReplace(R"( + auto script = kWaitForElementToAppearScript + content::JsReplace(R"( new Promise(async (resolve, reject) => { try { const selector = $1; @@ -69,23 +68,20 @@ void WaitForElementToAppear( } }) )", - selector); + selector); - auto result = EvalJs( - context, - script, - content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, - content::ISOLATED_WORLD_ID_CONTENT_END); + auto result = EvalJs(context, script, content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, + content::ISOLATED_WORLD_ID_CONTENT_END); ASSERT_EQ(should_appear, result); } -void WaitForElementToEqual( - content::WebContents* context, - const std::string& selector, - const std::string& expectedValue) { - if (!context) +void WaitForElementToEqual(content::WebContents* context, + const std::string& selector, + const std::string& expectedValue) { + if (!context) { return; + } std::string script = R"( new Promise(async (resolve, reject) => { @@ -140,12 +136,12 @@ void WaitForElementToEqual( ASSERT_EQ(true, result); } -void WaitForElementToContain( - content::WebContents* context, - const std::string& selector, - const std::string& substring) { - if (!context) +void WaitForElementToContain(content::WebContents* context, + const std::string& selector, + const std::string& substring) { + if (!context) { return; + } auto script = kWaitForElementToAppearScript + content::JsReplace(R"( @@ -194,24 +190,21 @@ void WaitForElementToContain( )", selector, substring); - auto result = EvalJs( - context, - script, - content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, - content::ISOLATED_WORLD_ID_CONTENT_END); + auto result = EvalJs(context, script, content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, + content::ISOLATED_WORLD_ID_CONTENT_END); ASSERT_EQ(true, result); } -void WaitForElementToContainHTML( - content::WebContents* context, - const std::string& selector, - const std::string& html) { - if (!context) +void WaitForElementToContainHTML(content::WebContents* context, + const std::string& selector, + const std::string& html) { + if (!context) { return; + } - auto script = kWaitForElementToAppearScript + - content::JsReplace(R"( + auto script = + kWaitForElementToAppearScript + content::JsReplace(R"( new Promise(async (resolve, reject) => { const TIMEOUT_SECONDS = 5; const selector = $1; @@ -255,26 +248,21 @@ void WaitForElementToContainHTML( } }); )", - selector, - html); + selector, html); - auto result = EvalJs( - context, - script, - content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, - content::ISOLATED_WORLD_ID_CONTENT_END); + auto result = EvalJs(context, script, content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, + content::ISOLATED_WORLD_ID_CONTENT_END); ASSERT_EQ(true, result); } -void WaitForElementThenClick( - content::WebContents* context, - const std::string& selector) { - if (!context) +void WaitForElementThenClick(content::WebContents* context, + const std::string& selector) { + if (!context) { return; + } - auto script = kWaitForElementToAppearScript + - content::JsReplace(R"( + auto script = kWaitForElementToAppearScript + content::JsReplace(R"( new Promise(async (resolve, reject) => { try { const selector = $1; @@ -287,26 +275,23 @@ void WaitForElementThenClick( } }) )", - selector); + selector); - auto result = EvalJs( - context, - script, - content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, - content::ISOLATED_WORLD_ID_CONTENT_END); + auto result = EvalJs(context, script, content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, + content::ISOLATED_WORLD_ID_CONTENT_END); ASSERT_EQ(true, result); } -std::string WaitForElementThenGetAttribute( - content::WebContents* context, - const std::string& selector, - const std::string& attribute_name) { - if (!context) +std::string WaitForElementThenGetAttribute(content::WebContents* context, + const std::string& selector, + const std::string& attribute_name) { + if (!context) { return ""; + } auto script = kWaitForElementToAppearScript + - content::JsReplace(R"( + content::JsReplace(R"( new Promise(async (resolve, reject) => { try { const selector = $1; @@ -319,26 +304,21 @@ std::string WaitForElementThenGetAttribute( } }) )", - selector, - attribute_name); + selector, attribute_name); - auto result = EvalJs( - context, - script, - content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, - content::ISOLATED_WORLD_ID_CONTENT_END); + auto result = EvalJs(context, script, content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, + content::ISOLATED_WORLD_ID_CONTENT_END); return result.ExtractString(); } -std::string WaitForElementThenGetContent( - content::WebContents* context, - const std::string& selector) { - if (!context) +std::string WaitForElementThenGetContent(content::WebContents* context, + const std::string& selector) { + if (!context) { return ""; + } - auto script = kWaitForElementToAppearScript + - content::JsReplace(R"( + auto script = kWaitForElementToAppearScript + content::JsReplace(R"( new Promise(async (resolve, reject) => { try { const selector = $1; @@ -350,23 +330,20 @@ std::string WaitForElementThenGetContent( } }) )", - selector); + selector); - auto result = EvalJs( - context, - script, - content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, - content::ISOLATED_WORLD_ID_CONTENT_END); + auto result = EvalJs(context, script, content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, + content::ISOLATED_WORLD_ID_CONTENT_END); return result.ExtractString(); } -void DragAndDrop( - content::WebContents* context, - const std::string& drag_selector, - const std::string& drop_selector) { - if (!context) +void DragAndDrop(content::WebContents* context, + const std::string& drag_selector, + const std::string& drop_selector) { + if (!context) { return; + } const std::string js_code = base::StringPrintf( R"( @@ -424,24 +401,21 @@ void DragAndDrop( '%s', '%s') )", - drag_selector.c_str(), - drop_selector.c_str()); - content::EvalJsResult jsResult = EvalJs( - context, - js_code, - content::EXECUTE_SCRIPT_NO_RESOLVE_PROMISES, - content::ISOLATED_WORLD_ID_CONTENT_END); + drag_selector.c_str(), drop_selector.c_str()); + content::EvalJsResult jsResult = + EvalJs(context, js_code, content::EXECUTE_SCRIPT_NO_RESOLVE_PROMISES, + content::ISOLATED_WORLD_ID_CONTENT_END); ASSERT_TRUE(jsResult.ExtractBool()); } std::vector GetSiteBannerTipOptions(content::WebContents* context) { - if (!context) + if (!context) { return {}; + } WaitForElementToAppear(context, "[data-test-id=tip-amount-options]"); - auto options = content::EvalJs( - context, - R"( + auto options = content::EvalJs(context, + R"( const delay = t => new Promise(resolve => setTimeout(resolve, t)); delay(500).then(() => Array.from( document.querySelectorAll( @@ -449,8 +423,9 @@ std::vector GetSiteBannerTipOptions(content::WebContents* context) { ) ).map(node => parseFloat(node.dataset.optionValue))) )", - content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, - content::ISOLATED_WORLD_ID_CONTENT_END).ExtractList(); + content::EXECUTE_SCRIPT_DEFAULT_OPTIONS, + content::ISOLATED_WORLD_ID_CONTENT_END) + .ExtractList(); std::vector result; for (const auto& value : options) { @@ -460,8 +435,9 @@ std::vector GetSiteBannerTipOptions(content::WebContents* context) { } double GetRewardsPopupMonthlyTipValue(content::WebContents* context) { - if (!context) + if (!context) { return 0; + } WaitForElementToAppear(context, "[data-test-id=monthly-tip-button]"); std::string script = R"_( diff --git a/browser/brave_rewards/test/util/rewards_browsertest_context_util.h b/browser/brave_rewards/test/util/rewards_browsertest_context_util.h new file mode 100644 index 000000000000..515f344797e7 --- /dev/null +++ b/browser/brave_rewards/test/util/rewards_browsertest_context_util.h @@ -0,0 +1,56 @@ +/* Copyright (c) 2020 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 https://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_CONTEXT_UTIL_H_ +#define BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_CONTEXT_UTIL_H_ + +#include +#include + +#include "build/build_config.h" + +namespace content { +class WebContents; +} // namespace content + +namespace brave_rewards::test_util { + +void WaitForElementToAppear(content::WebContents* context, + const std::string& selector, + bool should_appear = true); + +void WaitForElementToEqual(content::WebContents*, + const std::string& selector, + const std::string& expectedValue); + +void WaitForElementToContain(content::WebContents* context, + const std::string& selector, + const std::string& substring); + +void WaitForElementToContainHTML(content::WebContents* context, + const std::string& selector, + const std::string& html); + +void WaitForElementThenClick(content::WebContents* context, + const std::string& selector); + +std::string WaitForElementThenGetAttribute(content::WebContents* context, + const std::string& selector, + const std::string& attribute_name); + +std::string WaitForElementThenGetContent(content::WebContents* context, + const std::string& selector); + +void DragAndDrop(content::WebContents* context, + const std::string& drag_selector, + const std::string& drop_selector); + +std::vector GetSiteBannerTipOptions(content::WebContents* site_banner); + +double GetRewardsPopupMonthlyTipValue(content::WebContents* context); + +} // namespace brave_rewards::test_util + +#endif // BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_CONTEXT_UTIL_H_ diff --git a/components/brave_rewards/browser/test/common/rewards_browsertest_contribution.cc b/browser/brave_rewards/test/util/rewards_browsertest_contribution.cc similarity index 93% rename from components/brave_rewards/browser/test/common/rewards_browsertest_contribution.cc rename to browser/brave_rewards/test/util/rewards_browsertest_contribution.cc index f400ffcdb283..def4876ca109 100644 --- a/components/brave_rewards/browser/test/common/rewards_browsertest_contribution.cc +++ b/browser/brave_rewards/test/util/rewards_browsertest_contribution.cc @@ -1,20 +1,20 @@ /* Copyright (c) 2020 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/. */ + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_contribution.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_contribution.h" #include #include #include "base/strings/stringprintf.h" #include "base/test/bind.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.h" -#include "brave/components/brave_rewards/common/buildflags/buildflags.h" -#include "brave/components/brave_rewards/common/features.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_helper.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_util.h" +#include "brave/components/brave_rewards/core/buildflags/buildflags.h" +#include "brave/components/brave_rewards/core/features.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/test/base/ui_test_utils.h" @@ -81,9 +81,7 @@ void RewardsBrowserTestContribution::TipPublisher( // Navigate to a site in a new tab ui_test_utils::NavigateToURLWithDisposition( - browser_, - url, - WindowOpenDisposition::NEW_FOREGROUND_TAB, + browser_, url, WindowOpenDisposition::NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP); // Ensure that the tip button is disabled for unverified publishers. @@ -235,10 +233,7 @@ void RewardsBrowserTestContribution::OnReconcileComplete( const mojom::RewardsType type, const mojom::ContributionProcessor processor) { if (result == mojom::Result::OK) { - UpdateContributionBalance( - amount, - true, - processor); + UpdateContributionBalance(amount, true, processor); } if (type == mojom::RewardsType::AUTO_CONTRIBUTE) { @@ -330,7 +325,7 @@ void RewardsBrowserTestContribution::OnRecurringTipSaved( void RewardsBrowserTestContribution::WaitForMultipleTipReconcileCompleted( const int32_t needed) { multiple_tip_reconcile_needed_ = needed; - if (multiple_tip_reconcile_completed_|| + if (multiple_tip_reconcile_completed_ || multiple_tip_reconcile_count_ == needed) { return; } diff --git a/components/brave_rewards/browser/test/common/rewards_browsertest_contribution.h b/browser/brave_rewards/test/util/rewards_browsertest_contribution.h similarity index 82% rename from components/brave_rewards/browser/test/common/rewards_browsertest_contribution.h rename to browser/brave_rewards/test/util/rewards_browsertest_contribution.h index 3bd7943cd556..df7b6ac2cd47 100644 --- a/components/brave_rewards/browser/test/common/rewards_browsertest_contribution.h +++ b/browser/brave_rewards/test/util/rewards_browsertest_contribution.h @@ -1,10 +1,10 @@ /* Copyright (c) 2020 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/. */ + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_CONTRIBUTION_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_CONTRIBUTION_H_ +#ifndef BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_CONTRIBUTION_H_ +#define BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_CONTRIBUTION_H_ #include #include @@ -12,11 +12,11 @@ #include "base/memory/raw_ptr.h" #include "base/run_loop.h" -#include "brave/components/brave_rewards/browser/rewards_service_impl.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_context_helper.h" -#include "brave/components/brave_rewards/common/buildflags/buildflags.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_context_helper.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" +#include "brave/components/brave_rewards/core/buildflags/buildflags.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" class browser; @@ -66,8 +66,7 @@ class RewardsBrowserTestContribution : public RewardsServiceObserver { void IsBalanceCorrect(); - void WaitForMultipleACReconcileCompleted( - const int32_t needed); + void WaitForMultipleACReconcileCompleted(const int32_t needed); mojom::Result GetACStatus(); @@ -128,4 +127,4 @@ class RewardsBrowserTestContribution : public RewardsServiceObserver { } // namespace brave_rewards::test_util -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_CONTRIBUTION_H_ +#endif // BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_CONTRIBUTION_H_ diff --git a/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.cc b/browser/brave_rewards/test/util/rewards_browsertest_network_util.cc similarity index 87% rename from components/brave_rewards/browser/test/common/rewards_browsertest_network_util.cc rename to browser/brave_rewards/test/util/rewards_browsertest_network_util.cc index 3a70f22314bc..12851cd04d8e 100644 --- a/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.cc +++ b/browser/brave_rewards/test/util/rewards_browsertest_network_util.cc @@ -1,12 +1,13 @@ /* Copyright (c) 2020 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/test/util/rewards_browsertest_network_util.h" #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.h" #include "content/public/test/browser_test_utils.h" namespace brave_rewards::test_util { @@ -47,7 +48,7 @@ std::unique_ptr HandleRequest( if (request.relative_url == "/reddit") { http_response->set_content( - "" + "" " " " " "
" @@ -63,7 +64,7 @@ std::unique_ptr HandleRequest( if (request.relative_url == "/github") { http_response->set_content( - "" + "" " " " " "
" @@ -120,9 +121,8 @@ std::string GetUpholdUser() { )"; } -std::string GetUpholdCard( - const std::string& balance, - const std::string& address) { +std::string GetUpholdCard(const std::string& balance, + const std::string& address) { return base::StringPrintf( R"({ "available": "%s", @@ -137,9 +137,7 @@ std::string GetUpholdCard( "starred": false } })", - balance.c_str(), - balance.c_str(), - address.c_str()); + balance.c_str(), balance.c_str(), address.c_str()); } std::string GetOrderCreateResponse(mojom::SKUOrderPtr sku_order) { @@ -147,7 +145,7 @@ std::string GetOrderCreateResponse(mojom::SKUOrderPtr sku_order) { std::string items; for (const auto& item : sku_order->items) { items.append(base::StringPrintf( - R"({ + R"({ "id": "%s", "orderId": "%s", "sku": "", @@ -158,11 +156,8 @@ std::string GetOrderCreateResponse(mojom::SKUOrderPtr sku_order) { "price": "%g", "description": "%s" })", - item->order_item_id.c_str(), - sku_order->order_id.c_str(), - item->quantity, - item->price, - item->description.c_str())); + item->order_item_id.c_str(), sku_order->order_id.c_str(), + item->quantity, item->price, item->description.c_str())); } return base::StringPrintf( @@ -176,9 +171,7 @@ std::string GetOrderCreateResponse(mojom::SKUOrderPtr sku_order) { "status": "pending", "items": [%s] })", - sku_order->order_id.c_str(), - sku_order->total_amount, - items.c_str()); + sku_order->order_id.c_str(), sku_order->total_amount, items.c_str()); } } // namespace brave_rewards::test_util diff --git a/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.h b/browser/brave_rewards/test/util/rewards_browsertest_network_util.h similarity index 54% rename from components/brave_rewards/browser/test/common/rewards_browsertest_network_util.h rename to browser/brave_rewards/test/util/rewards_browsertest_network_util.h index bfe0b2f61cdf..67b1dfa0d2da 100644 --- a/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.h +++ b/browser/brave_rewards/test/util/rewards_browsertest_network_util.h @@ -1,16 +1,16 @@ /* Copyright (c) 2020 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/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_NETWORK_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_NETWORK_UTIL_H_ +#ifndef BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_NETWORK_UTIL_H_ +#define BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_NETWORK_UTIL_H_ #include #include -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" @@ -23,12 +23,11 @@ std::string GetUpholdCapabilities(); std::string GetUpholdUser(); -std::string GetUpholdCard( - const std::string& balance, - const std::string& address); +std::string GetUpholdCard(const std::string& balance, + const std::string& address); std::string GetOrderCreateResponse(mojom::SKUOrderPtr sku_order); } // namespace brave_rewards::test_util -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_NETWORK_UTIL_H_ +#endif // BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_NETWORK_UTIL_H_ diff --git a/components/brave_rewards/browser/test/common/rewards_browsertest_response.cc b/browser/brave_rewards/test/util/rewards_browsertest_response.cc similarity index 70% rename from components/brave_rewards/browser/test/common/rewards_browsertest_response.cc rename to browser/brave_rewards/test/util/rewards_browsertest_response.cc index 6d221b0d54ee..51e12e6dd374 100644 --- a/components/brave_rewards/browser/test/common/rewards_browsertest_response.cc +++ b/browser/brave_rewards/test/util/rewards_browsertest_response.cc @@ -1,9 +1,9 @@ /* Copyright (c) 2020 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/. */ + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_response.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_response.h" #include #include @@ -15,11 +15,11 @@ #include "base/numerics/byte_conversions.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_network_util.h" -#include "brave/components/brave_rewards/browser/test/common/rewards_browsertest_util.h" -#include "brave/components/brave_rewards/core/publisher/prefix_util.h" -#include "brave/components/brave_rewards/core/publisher/protos/channel_response.pb.h" -#include "brave/components/brave_rewards/core/publisher/protos/publisher_prefix_list.pb.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_network_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_util.h" +#include "brave/components/brave_rewards/core/internal/publisher/prefix_util.h" +#include "brave/components/brave_rewards/core/internal/publisher/protos/channel_response.pb.h" +#include "brave/components/brave_rewards/core/internal/publisher/protos/publisher_prefix_list.pb.h" #include "chrome/test/base/ui_test_utils.h" namespace { @@ -78,10 +78,8 @@ std::string GetPublisherChannelResponse( channel->set_channel_identifier(key); if (key == "bumpsmack.com") { - AddUpholdWalletToChannelResponse( - channel, - "address1", - publishers_pb::UPHOLD_ACCOUNT_NO_KYC); + AddUpholdWalletToChannelResponse(channel, "address1", + publishers_pb::UPHOLD_ACCOUNT_NO_KYC); } else if (key == "duckduckgo.com") { AddUpholdWalletToChannelResponse(channel, "address2"); } else if (key == "3zsistemi.si") { @@ -137,45 +135,38 @@ RewardsBrowserTestResponse::~RewardsBrowserTestResponse() = default; void RewardsBrowserTestResponse::LoadMocks() { base::FilePath path; test_util::GetTestDataDir(&path); - ASSERT_TRUE(base::ReadFileToString( - path.AppendASCII("wallet_resp.json"), - &wallet_)); + ASSERT_TRUE( + base::ReadFileToString(path.AppendASCII("wallet_resp.json"), &wallet_)); ASSERT_TRUE(base::ReadFileToString( - path.AppendASCII("creds_tokens_sku_resp.json"), - &creds_tokens_sku_)); + path.AppendASCII("creds_tokens_sku_resp.json"), &creds_tokens_sku_)); ASSERT_TRUE(base::ReadFileToString( path.AppendASCII("creds_tokens_sku_prod_resp.json"), &creds_tokens_sku_prod_)); - ASSERT_TRUE(base::ReadFileToString( - path.AppendASCII("parameters_resp.json"), - ¶meters_)); + ASSERT_TRUE(base::ReadFileToString(path.AppendASCII("parameters_resp.json"), + ¶meters_)); - ASSERT_TRUE(base::ReadFileToString( - path.AppendASCII("uphold_auth_resp.json"), - &uphold_auth_resp_)); + ASSERT_TRUE(base::ReadFileToString(path.AppendASCII("uphold_auth_resp.json"), + &uphold_auth_resp_)); - ASSERT_TRUE(base::ReadFileToString( - path.AppendASCII("uphold_transactions_resp.json"), - &uphold_transactions_resp_)); + ASSERT_TRUE( + base::ReadFileToString(path.AppendASCII("uphold_transactions_resp.json"), + &uphold_transactions_resp_)); ASSERT_TRUE(base::ReadFileToString( - path.AppendASCII("uphold_commit_resp.json"), - &uphold_commit_resp_)); - - std::vector publisher_keys { - "bumpsmack.com", - "duckduckgo.com", - "3zsistemi.si", - "site1.com", - "site2.com", - "site3.com", - "laurenwags.github.io", - "kjozwiakstaging.github.io", - "registeredsite.com" - }; + path.AppendASCII("uphold_commit_resp.json"), &uphold_commit_resp_)); + + std::vector publisher_keys{"bumpsmack.com", + "duckduckgo.com", + "3zsistemi.si", + "site1.com", + "site2.com", + "site3.com", + "laurenwags.github.io", + "kjozwiakstaging.github.io", + "registeredsite.com"}; for (auto& key : publisher_keys) { std::string prefix = internal::publisher::GetHashPrefixRaw(key, 4); @@ -183,11 +174,10 @@ void RewardsBrowserTestResponse::LoadMocks() { } } -void RewardsBrowserTestResponse::Get( - const std::string& url, - int32_t method, - int* response_status_code, - std::string* response) { +void RewardsBrowserTestResponse::Get(const std::string& url, + int32_t method, + int* response_status_code, + std::string* response) { requests_.emplace_back(url, method); DCHECK(response_status_code && response); @@ -211,15 +201,13 @@ void RewardsBrowserTestResponse::Get( if (url.find("/publishers/prefix-list") != std::string::npos) { *response = GetPublisherPrefixListResponse(publisher_prefixes_); - } + } if (url.find("/publishers/prefixes/") != std::string::npos) { size_t start = url.rfind('/') + 1; if (start < url.length()) { *response = GetPublisherChannelResponse( - publisher_prefixes_, - url.substr(start), - alternative_publisher_list_); + publisher_prefixes_, url.substr(start), alternative_publisher_list_); } else { *response = ""; } @@ -234,20 +222,16 @@ void RewardsBrowserTestResponse::Get( } if (url.find("/v0/me/cards") != std::string::npos) { - if (base::EndsWith( - url, - "transactions", - base::CompareCase::INSENSITIVE_ASCII)) { + if (base::EndsWith(url, "transactions", + base::CompareCase::INSENSITIVE_ASCII)) { *response = uphold_transactions_resp_; *response_status_code = net::HTTP_ACCEPTED; - } else if (base::EndsWith( - url, - "commit", - base::CompareCase::INSENSITIVE_ASCII)) { - *response = uphold_commit_resp_; + } else if (base::EndsWith(url, "commit", + base::CompareCase::INSENSITIVE_ASCII)) { + *response = uphold_commit_resp_; } else { - *response = test_util::GetUpholdCard( - external_balance_, test_util::GetUpholdExternalAddress()); + *response = test_util::GetUpholdCard( + external_balance_, test_util::GetUpholdExternalAddress()); } return; } @@ -265,11 +249,11 @@ void RewardsBrowserTestResponse::Get( if (url.find("/v1/orders") != std::string::npos) { if (url.find("credentials") != std::string::npos) { if (method == 0) { - #if defined(OFFICIAL_BUILD) - *response = creds_tokens_sku_prod_; - #else - *response = creds_tokens_sku_; - #endif +#if defined(OFFICIAL_BUILD) + *response = creds_tokens_sku_prod_; +#else + *response = creds_tokens_sku_; +#endif return; } diff --git a/components/brave_rewards/browser/test/common/rewards_browsertest_response.h b/browser/brave_rewards/test/util/rewards_browsertest_response.h similarity index 67% rename from components/brave_rewards/browser/test/common/rewards_browsertest_response.h rename to browser/brave_rewards/test/util/rewards_browsertest_response.h index 40505919e17d..259100362b2a 100644 --- a/components/brave_rewards/browser/test/common/rewards_browsertest_response.h +++ b/browser/brave_rewards/test/util/rewards_browsertest_response.h @@ -1,17 +1,17 @@ /* Copyright (c) 2020 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/. */ + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_RESPONSE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_RESPONSE_H_ +#ifndef BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_RESPONSE_H_ +#define BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_RESPONSE_H_ #include #include #include -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" namespace brave_rewards::test_util { @@ -29,11 +29,10 @@ class RewardsBrowserTestResponse { void LoadMocks(); - void Get( - const std::string& url, - int32_t method, - int* response_status_code, - std::string* response); + void Get(const std::string& url, + int32_t method, + int* response_status_code, + std::string* response); std::vector GetRequests(); @@ -63,4 +62,4 @@ class RewardsBrowserTestResponse { } // namespace brave_rewards::test_util -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_RESPONSE_H_ +#endif // BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_RESPONSE_H_ diff --git a/components/brave_rewards/browser/test/common/rewards_browsertest_util.cc b/browser/brave_rewards/test/util/rewards_browsertest_util.cc similarity index 90% rename from components/brave_rewards/browser/test/common/rewards_browsertest_util.cc rename to browser/brave_rewards/test/util/rewards_browsertest_util.cc index 968eb6c00299..2a903cc03458 100644 --- a/components/brave_rewards/browser/test/common/rewards_browsertest_util.cc +++ b/browser/brave_rewards/test/util/rewards_browsertest_util.cc @@ -1,9 +1,9 @@ /* Copyright (c) 2020 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/components/brave_rewards/browser/test/common/rewards_browsertest_util.h" +#include "brave/browser/brave_rewards/test/util/rewards_browsertest_util.h" #include #include @@ -17,9 +17,9 @@ #include "base/task/sequenced_task_runner.h" #include "base/test/bind.h" #include "brave/browser/brave_rewards/rewards_service_factory.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.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/ui/browser.h" @@ -141,10 +141,9 @@ void StartProcessWithConnectedUser(Profile* profile) { } } -GURL GetUrl( - net::EmbeddedTestServer* https_server, - const std::string& publisher_key, - const std::string& path) { +GURL GetUrl(net::EmbeddedTestServer* https_server, + const std::string& publisher_key, + const std::string& path) { DCHECK(https_server); std::string new_path = path; if (new_path.empty()) { @@ -172,15 +171,13 @@ std::string GetGeminiExternalAddress() { return "00471311-fc4d-463b-9317-579e82b0a6b8"; } -void NavigateToPublisherPage( - Browser* browser, - net::EmbeddedTestServer* https_server, - const std::string& publisher_key, - const std::string& path) { +void NavigateToPublisherPage(Browser* browser, + net::EmbeddedTestServer* https_server, + const std::string& publisher_key, + const std::string& path) { DCHECK(browser && https_server); ui_test_utils::NavigateToURLWithDisposition( - browser, - GetUrl(https_server, publisher_key, path), + browser, GetUrl(https_server, publisher_key, path), WindowOpenDisposition::NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP); } diff --git a/components/brave_rewards/browser/test/common/rewards_browsertest_util.h b/browser/brave_rewards/test/util/rewards_browsertest_util.h similarity index 68% rename from components/brave_rewards/browser/test/common/rewards_browsertest_util.h rename to browser/brave_rewards/test/util/rewards_browsertest_util.h index 1554027446de..c838f24f977a 100644 --- a/components/brave_rewards/browser/test/common/rewards_browsertest_util.h +++ b/browser/brave_rewards/test/util/rewards_browsertest_util.h @@ -1,16 +1,16 @@ /* Copyright (c) 2020 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/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_UTIL_H_ +#ifndef BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_UTIL_H_ +#define BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_UTIL_H_ #include #include #include "base/files/file_path.h" -#include "brave/components/brave_rewards/browser/rewards_service_impl.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "url/gurl.h" @@ -31,10 +31,9 @@ void StartProcess(RewardsServiceImpl* rewards_service); void StartProcessWithConnectedUser(Profile* profile); -GURL GetUrl( - net::EmbeddedTestServer* https_server, - const std::string& publisher_key, - const std::string& path = ""); +GURL GetUrl(net::EmbeddedTestServer* https_server, + const std::string& publisher_key, + const std::string& path = ""); void ActivateTabAtIndex(Browser* browser, const int index); @@ -44,11 +43,10 @@ std::string GetUpholdExternalAddress(); std::string GetGeminiExternalAddress(); -void NavigateToPublisherPage( - Browser* browser, - net::EmbeddedTestServer* https_server, - const std::string& publisher_key, - const std::string& path = ""); +void NavigateToPublisherPage(Browser* browser, + net::EmbeddedTestServer* https_server, + const std::string& publisher_key, + const std::string& path = ""); void NavigateToPublisherAndWaitForUpdate(Browser* browser, net::EmbeddedTestServer* https_server, @@ -69,4 +67,4 @@ std::optional DecryptPrefString(const std::string& value); } // namespace brave_rewards::test_util -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_UTIL_H_ +#endif // BRAVE_BROWSER_BRAVE_REWARDS_TEST_UTIL_REWARDS_BROWSERTEST_UTIL_H_ diff --git a/browser/brave_search/brave_search_browsertest.cc b/browser/brave_search/brave_search_browsertest.cc index 7ce021e1ce64..4c5e2e914c75 100644 --- a/browser/brave_search/brave_search_browsertest.cc +++ b/browser/brave_search/brave_search_browsertest.cc @@ -12,7 +12,7 @@ #include "base/test/scoped_feature_list.h" #include "base/test/thread_test_helper.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/brave_search/browser/brave_search_fallback_host.h" #include "brave/components/brave_search/common/features.h" #include "brave/components/constants/brave_paths.h" diff --git a/browser/brave_stats/brave_stats_updater_unittest.cc b/browser/brave_stats/brave_stats_updater_unittest.cc index c249c7acf77a..b49483419be5 100644 --- a/browser/brave_stats/brave_stats_updater_unittest.cc +++ b/browser/brave_stats/brave_stats_updater_unittest.cc @@ -21,7 +21,7 @@ #include "brave/browser/brave_stats/features.h" #include "brave/components/brave_ads/core/public/prefs/pref_names.h" #include "brave/components/brave_referrals/browser/brave_referrals_service.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service.h" #include "brave/components/brave_stats/browser/brave_stats_updater_util.h" #include "brave/components/brave_wallet/browser/brave_wallet_prefs.h" #include "brave/components/brave_wallet/browser/pref_names.h" diff --git a/browser/extensions/BUILD.gn b/browser/extensions/BUILD.gn index c5bc55eb1a47..df81afe82f01 100644 --- a/browser/extensions/BUILD.gn +++ b/browser/extensions/BUILD.gn @@ -141,9 +141,9 @@ source_set("extensions") { "//brave/components/brave_ads/core/public:headers", "//brave/components/brave_extension:static_resources", "//brave/components/brave_news/common", - "//brave/components/brave_rewards/browser", - "//brave/components/brave_rewards/common", - "//brave/components/brave_rewards/common/mojom", + "//brave/components/brave_rewards/content", + "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core/mojom", "//brave/components/brave_shields/core/common", "//brave/components/brave_vpn/common/buildflags", "//brave/components/brave_wallet/browser:pref_names", @@ -178,7 +178,7 @@ source_set("extensions") { ":component_loader", "//brave/browser/ethereum_remote_client/buildflags", "//brave/components/brave_ads/core/mojom", - "//brave/components/brave_rewards/common/mojom", + "//brave/components/brave_rewards/core/mojom", "//extensions/browser", ] diff --git a/browser/extensions/api/BUILD.gn b/browser/extensions/api/BUILD.gn index da874d9c61fa..865226e14e7a 100644 --- a/browser/extensions/api/BUILD.gn +++ b/browser/extensions/api/BUILD.gn @@ -14,7 +14,7 @@ function_registration("generated_api_registration") { deps = [ "//brave/components/brave_ads/core/mojom", - "//brave/components/brave_rewards/common/mojom", + "//brave/components/brave_rewards/core/mojom", "//extensions/browser", "//extensions/common", ] diff --git a/browser/extensions/api/brave_rewards_api.cc b/browser/extensions/api/brave_rewards_api.cc index 4c9b8aa27d4c..219f5b2968be 100644 --- a/browser/extensions/api/brave_rewards_api.cc +++ b/browser/extensions/api/brave_rewards_api.cc @@ -20,10 +20,10 @@ #include "brave/common/extensions/api/brave_rewards.h" #include "brave/components/brave_adaptive_captcha/brave_adaptive_captcha_service.h" #include "brave/components/brave_ads/core/browser/service/ads_service.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/pref_names.h" -#include "brave/components/brave_rewards/common/rewards_util.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/pref_names.h" +#include "brave/components/brave_rewards/core/rewards_util.h" #include "chrome/browser/extensions/api/tabs/tabs_constants.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_tab_util.h" diff --git a/browser/extensions/api/brave_rewards_api.h b/browser/extensions/api/brave_rewards_api.h index 34d4654d0911..5776cdd82efa 100644 --- a/browser/extensions/api/brave_rewards_api.h +++ b/browser/extensions/api/brave_rewards_api.h @@ -12,7 +12,7 @@ #include #include "brave/components/brave_ads/core/mojom/brave_ads.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" #include "extensions/browser/extension_function.h" namespace extensions { diff --git a/browser/extensions/api/rewards_notifications_api.cc b/browser/extensions/api/rewards_notifications_api.cc index b478862f98d2..18ff8098681b 100644 --- a/browser/extensions/api/rewards_notifications_api.cc +++ b/browser/extensions/api/rewards_notifications_api.cc @@ -10,8 +10,8 @@ #include "brave/browser/brave_rewards/rewards_service_factory.h" #include "brave/common/extensions/api/rewards_notifications.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_notification_service.h" +#include "brave/components/brave_rewards/content/rewards_service.h" #include "chrome/browser/profiles/profile.h" using brave_rewards::RewardsNotificationService; diff --git a/browser/extensions/api/settings_private/brave_prefs_util.cc b/browser/extensions/api/settings_private/brave_prefs_util.cc index 78a1e2e0a220..a454f2a70e94 100644 --- a/browser/extensions/api/settings_private/brave_prefs_util.cc +++ b/browser/extensions/api/settings_private/brave_prefs_util.cc @@ -8,7 +8,7 @@ #include "brave/browser/ui/tabs/brave_tab_prefs.h" #include "brave/components/ai_chat/core/common/pref_names.h" #include "brave/components/brave_news/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/core/common/pref_names.h" #include "brave/components/brave_vpn/common/buildflags/buildflags.h" #include "brave/components/brave_wallet/browser/pref_names.h" diff --git a/browser/net/BUILD.gn b/browser/net/BUILD.gn index 8352c709ab50..42415385c765 100644 --- a/browser/net/BUILD.gn +++ b/browser/net/BUILD.gn @@ -88,8 +88,8 @@ source_set("unit_tests") { "//brave/components/brave_ads/browser:test_support", "//brave/components/brave_ads/core", "//brave/components/brave_component_updater/browser", - "//brave/components/brave_rewards/common", - "//brave/components/brave_rewards/common:features", + "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core:features", "//brave/components/brave_shields/content/browser", "//brave/components/brave_shields/content/test:test_support", "//brave/components/l10n/common:test_support", diff --git a/browser/net/brave_network_audit_browsertest.cc b/browser/net/brave_network_audit_browsertest.cc index 7c5669ac5e50..8a2add2252fb 100644 --- a/browser/net/brave_network_audit_browsertest.cc +++ b/browser/net/brave_network_audit_browsertest.cc @@ -21,7 +21,7 @@ #include "brave/browser/net/brave_network_audit_allowed_lists.h" #include "brave/browser/net/brave_network_audit_test_helper.h" #include "brave/browser/ui/brave_browser.h" -#include "brave/components/brave_rewards/browser/rewards_service_impl.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" #include "brave/components/playlist/common/buildflags/buildflags.h" #include "chrome/browser/password_manager/profile_password_store_factory.h" #include "chrome/browser/profiles/profile.h" diff --git a/browser/net/search_ads_header_network_delegate_helper.cc b/browser/net/search_ads_header_network_delegate_helper.cc index a9acf8f5995e..56b558b730d5 100644 --- a/browser/net/search_ads_header_network_delegate_helper.cc +++ b/browser/net/search_ads_header_network_delegate_helper.cc @@ -6,7 +6,7 @@ #include "brave/browser/net/search_ads_header_network_delegate_helper.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/brave_search/common/brave_search_utils.h" #include "chrome/browser/profiles/profile.h" #include "components/prefs/pref_service.h" diff --git a/browser/net/search_ads_header_network_delegate_helper_unittest.cc b/browser/net/search_ads_header_network_delegate_helper_unittest.cc index 39ee0d69295d..6e18f3e9dbad 100644 --- a/browser/net/search_ads_header_network_delegate_helper_unittest.cc +++ b/browser/net/search_ads_header_network_delegate_helper_unittest.cc @@ -13,8 +13,8 @@ #include "brave/browser/net/url_context.h" #include "brave/components/brave_ads/core/public/prefs/pref_names.h" #include "brave/components/brave_ads/core/public/prefs/pref_registry.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/l10n/common/test/scoped_default_locale.h" #include "chrome/browser/prefs/browser_prefs.h" #include "chrome/test/base/testing_profile.h" @@ -30,7 +30,7 @@ #include "url/gurl.h" #if BUILDFLAG(IS_ANDROID) -#include "brave/components/brave_rewards/common/features.h" +#include "brave/components/brave_rewards/core/features.h" #endif // BUILDFLAG(IS_ANDROID) using testing::Return; diff --git a/browser/net/sources.gni b/browser/net/sources.gni index 1f91e61ed4d8..e841176265ef 100644 --- a/browser/net/sources.gni +++ b/browser/net/sources.gni @@ -63,7 +63,7 @@ brave_browser_net_deps = [ "//brave/components/brave_ads/browser", "//brave/components/brave_component_updater/browser", "//brave/components/brave_referrals/browser", - "//brave/components/brave_rewards/common", + "//brave/components/brave_rewards/core", "//brave/components/brave_search/common", "//brave/components/brave_service_keys", "//brave/components/brave_shields/adblock/rs:rust_lib", diff --git a/browser/ntp_background/BUILD.gn b/browser/ntp_background/BUILD.gn index 9a6062b0bfa1..553a364e471d 100644 --- a/browser/ntp_background/BUILD.gn +++ b/browser/ntp_background/BUILD.gn @@ -22,7 +22,7 @@ source_set("ntp_background") { "//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", "//brave/components/constants", "//brave/components/ntp_background_images/browser", "//brave/components/ntp_background_images/buildflags", @@ -67,7 +67,7 @@ source_set("unit_tests") { "//brave/browser:browser_process", "//brave/components/brave_ads/core/public:headers", "//brave/components/brave_referrals/browser", - "//brave/components/brave_rewards/common", + "//brave/components/brave_rewards/core", "//brave/components/ntp_background_images/browser", "//brave/components/p3a", "//components/prefs:test_support", diff --git a/browser/ntp_background/ntp_p3a_helper_impl.cc b/browser/ntp_background/ntp_p3a_helper_impl.cc index 0d0407c3d9ca..1b0cea74d131 100644 --- a/browser/ntp_background/ntp_p3a_helper_impl.cc +++ b/browser/ntp_background/ntp_p3a_helper_impl.cc @@ -23,7 +23,7 @@ #include "base/time/time.h" #include "brave/components/brave_ads/core/public/ads_feature.h" #include "brave/components/brave_ads/core/public/user_engagement/site_visit/site_visit_feature.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/ntp_background_images/browser/ntp_sponsored_images_data.h" #include "brave/components/p3a/features.h" #include "brave/components/p3a/metric_log_type.h" diff --git a/browser/ntp_background/ntp_p3a_helper_impl_unittest.cc b/browser/ntp_background/ntp_p3a_helper_impl_unittest.cc index 914f6e3fa25f..21e8041aa0a4 100644 --- a/browser/ntp_background/ntp_p3a_helper_impl_unittest.cc +++ b/browser/ntp_background/ntp_p3a_helper_impl_unittest.cc @@ -17,8 +17,8 @@ #include "brave/components/brave_ads/core/public/prefs/pref_registry.h" #include "brave/components/brave_ads/core/public/user_engagement/site_visit/site_visit_feature.h" #include "brave/components/brave_referrals/browser/brave_referrals_service.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/ntp_background_images/browser/ntp_sponsored_images_data.h" #include "brave/components/p3a/metric_log_type.h" #include "brave/components/p3a/p3a_config.h" diff --git a/browser/perf/brave_perf_features_processor.cc b/browser/perf/brave_perf_features_processor.cc index f66cd6c41216..e2de33c6519a 100644 --- a/browser/perf/brave_perf_features_processor.cc +++ b/browser/perf/brave_perf_features_processor.cc @@ -13,7 +13,7 @@ #include "brave/components/ai_chat/core/common/pref_names.h" #include "brave/components/brave_ads/core/public/prefs/pref_names.h" #include "brave/components/brave_news/common/pref_names.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service.h" #include "brave/components/brave_shields/content/browser/ad_block_service.h" #include "brave/components/brave_shields/core/browser/ad_block_component_service_manager.h" #include "brave/components/brave_shields/core/common/brave_shield_constants.h" diff --git a/browser/perf/brave_perf_features_processor_browsertest.cc b/browser/perf/brave_perf_features_processor_browsertest.cc index 0dcbdf986b2a..06d925cbc470 100644 --- a/browser/perf/brave_perf_features_processor_browsertest.cc +++ b/browser/perf/brave_perf_features_processor_browsertest.cc @@ -9,8 +9,8 @@ #include "brave/components/ai_chat/core/browser/utils.h" #include "brave/components/brave_ads/core/public/prefs/pref_names.h" #include "brave/components/brave_news/common/pref_names.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" +#include "brave/components/brave_rewards/content/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" #include "brave/components/speedreader/common/buildflags/buildflags.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" diff --git a/browser/perf/sources.gni b/browser/perf/sources.gni index cc5ed6dda16e..4637242967d2 100644 --- a/browser/perf/sources.gni +++ b/browser/perf/sources.gni @@ -14,7 +14,7 @@ brave_browser_perf_sources = [ brave_browser_perf_deps = [ "//base", "//brave/components/brave_ads/core", - "//brave/components/brave_rewards/browser", + "//brave/components/brave_rewards/content", "//brave/components/brave_shields/content/browser", "//brave/components/brave_shields/core/browser", "//brave/components/brave_shields/core/common/", diff --git a/browser/policy/brave_simple_policy_map.h b/browser/policy/brave_simple_policy_map.h index 1f4874a3e410..064b6ffcce05 100644 --- a/browser/policy/brave_simple_policy_map.h +++ b/browser/policy/brave_simple_policy_map.h @@ -16,7 +16,7 @@ #include "components/policy/policy_constants.h" #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/brave_sync/brave_sync_prefs.h" #include "brave/components/brave_wallet/common/pref_names.h" #endif diff --git a/browser/sources.gni b/browser/sources.gni index d0c67b924f6a..7f73d59f001a 100644 --- a/browser/sources.gni +++ b/browser/sources.gni @@ -157,11 +157,11 @@ brave_chrome_browser_deps = [ "//brave/components/brave_private_new_tab_ui/common", "//brave/components/brave_private_new_tab_ui/common:mojom", "//brave/components/brave_referrals/browser", - "//brave/components/brave_rewards/common", - "//brave/components/brave_rewards/common:features", - "//brave/components/brave_rewards/common/buildflags", - "//brave/components/brave_rewards/common/mojom", - "//brave/components/brave_rewards/common/mojom:webui", + "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core:features", + "//brave/components/brave_rewards/core/buildflags", + "//brave/components/brave_rewards/core/mojom", + "//brave/components/brave_rewards/core/mojom:webui", "//brave/components/brave_search/browser", "//brave/components/brave_search/common", "//brave/components/brave_search/common:mojom", diff --git a/browser/ui/BUILD.gn b/browser/ui/BUILD.gn index e9ef106a20d8..e79a44be827c 100644 --- a/browser/ui/BUILD.gn +++ b/browser/ui/BUILD.gn @@ -787,12 +787,12 @@ source_set("ui") { "//brave/components/brave_news/browser", "//brave/components/brave_news/common", "//brave/components/brave_perf_predictor/common", - "//brave/components/brave_rewards/browser", - "//brave/components/brave_rewards/common", - "//brave/components/brave_rewards/common:features", - "//brave/components/brave_rewards/common/mojom", - "//brave/components/brave_rewards/common/mojom:webui", - "//brave/components/brave_rewards/core:headers", + "//brave/components/brave_rewards/content", + "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core:features", + "//brave/components/brave_rewards/core/internal:headers", + "//brave/components/brave_rewards/core/mojom", + "//brave/components/brave_rewards/core/mojom:webui", "//brave/components/brave_rewards/resources", "//brave/components/brave_rewards/resources:internals_generated_resources", "//brave/components/brave_rewards/resources:page_generated_resources", @@ -1064,7 +1064,7 @@ source_set("ui") { "//brave/components/brave_private_new_tab_ui/common", "//brave/components/brave_private_new_tab_ui/common:mojom", "//brave/components/brave_private_new_tab_ui/resources/page:generated_resources", - "//brave/components/brave_rewards/browser", + "//brave/components/brave_rewards/content", "//brave/components/brave_rewards/resources/rewards_panel:brave_rewards_panel_generated", "//brave/components/brave_rewards/resources/tip_panel:tip_panel_generated", "//brave/components/brave_shields/resources/cookie_list_opt_in:cookie_list_opt_in_generated", diff --git a/browser/ui/brave_browser_command_controller.cc b/browser/ui/brave_browser_command_controller.cc index 6684ac369a8d..2dc7316a8afa 100644 --- a/browser/ui/brave_browser_command_controller.cc +++ b/browser/ui/brave_browser_command_controller.cc @@ -22,7 +22,7 @@ #include "brave/components/ai_chat/core/browser/utils.h" #include "brave/components/ai_chat/core/common/features.h" #include "brave/components/ai_chat/core/common/pref_names.h" -#include "brave/components/brave_rewards/common/rewards_util.h" +#include "brave/components/brave_rewards/core/rewards_util.h" #include "brave/components/brave_vpn/common/buildflags/buildflags.h" #include "brave/components/brave_wallet/common/common_utils.h" #include "brave/components/brave_wayback_machine/buildflags/buildflags.h" diff --git a/browser/ui/brave_rewards/BUILD.gn b/browser/ui/brave_rewards/BUILD.gn index 6bd5d6bdf8eb..7b06971225a0 100644 --- a/browser/ui/brave_rewards/BUILD.gn +++ b/browser/ui/brave_rewards/BUILD.gn @@ -10,7 +10,7 @@ source_set("unit_tests") { sources = [ "rewards_panel_coordinator_unittest.cc" ] deps = [ "//base", - "//brave/components/brave_rewards/common:features", + "//brave/components/brave_rewards/core:features", "//chrome/browser/ui", "//chrome/test:test_support", ] diff --git a/browser/ui/brave_rewards/rewards_panel_coordinator.h b/browser/ui/brave_rewards/rewards_panel_coordinator.h index 2a6a0f0cf17d..0edefdeb4454 100644 --- a/browser/ui/brave_rewards/rewards_panel_coordinator.h +++ b/browser/ui/brave_rewards/rewards_panel_coordinator.h @@ -8,7 +8,7 @@ #include "base/observer_list.h" #include "base/scoped_observation.h" -#include "brave/components/brave_rewards/common/mojom/rewards_panel.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_panel.mojom.h" #include "chrome/browser/ui/browser_user_data.h" #include "url/gurl.h" diff --git a/browser/ui/brave_rewards/tip_panel_coordinator.cc b/browser/ui/brave_rewards/tip_panel_coordinator.cc index c11d27c87794..95a4788dc354 100644 --- a/browser/ui/brave_rewards/tip_panel_coordinator.cc +++ b/browser/ui/brave_rewards/tip_panel_coordinator.cc @@ -9,7 +9,7 @@ #include #include "brave/browser/ui/brave_rewards/rewards_panel_coordinator.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser_window.h" diff --git a/browser/ui/brave_rewards/tip_panel_coordinator.h b/browser/ui/brave_rewards/tip_panel_coordinator.h index a33ff69b6f74..8e393e0015f7 100644 --- a/browser/ui/brave_rewards/tip_panel_coordinator.h +++ b/browser/ui/brave_rewards/tip_panel_coordinator.h @@ -11,7 +11,7 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/scoped_observation.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" #include "chrome/browser/ui/browser_user_data.h" #include "ui/gfx/geometry/size.h" diff --git a/browser/ui/views/brave_actions/brave_actions_container.cc b/browser/ui/views/brave_actions/brave_actions_container.cc index b8fe4836664f..11ba37b98e04 100644 --- a/browser/ui/views/brave_actions/brave_actions_container.cc +++ b/browser/ui/views/brave_actions/brave_actions_container.cc @@ -13,7 +13,7 @@ #include "brave/browser/ui/views/brave_actions/brave_rewards_action_view.h" #include "brave/browser/ui/views/brave_actions/brave_shields_action_view.h" #include "brave/browser/ui/views/rounded_separator.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/constants/pref_names.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" diff --git a/browser/ui/views/brave_actions/brave_actions_container_browsertest.cc b/browser/ui/views/brave_actions/brave_actions_container_browsertest.cc index ac5764de7566..f7702ab18417 100644 --- a/browser/ui/views/brave_actions/brave_actions_container_browsertest.cc +++ b/browser/ui/views/brave_actions/brave_actions_container_browsertest.cc @@ -3,13 +3,14 @@ * 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/. */ +#include "brave/browser/ui/views/brave_actions/brave_actions_container.h" + #include "base/functional/callback_helpers.h" #include "base/memory/raw_ptr.h" #include "brave/browser/ui/brave_rewards/rewards_panel_coordinator.h" -#include "brave/browser/ui/views/brave_actions/brave_actions_container.h" #include "brave/browser/ui/views/brave_actions/brave_rewards_action_view.h" #include "brave/browser/ui/views/location_bar/brave_location_bar_view.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/constants/pref_names.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" diff --git a/browser/ui/views/brave_actions/brave_rewards_action_view.cc b/browser/ui/views/brave_actions/brave_rewards_action_view.cc index cc1624809d53..7d6aa49fa10c 100644 --- a/browser/ui/views/brave_actions/brave_rewards_action_view.cc +++ b/browser/ui/views/brave_actions/brave_rewards_action_view.cc @@ -15,10 +15,10 @@ #include "brave/browser/ui/brave_icon_with_badge_image_source.h" #include "brave/browser/ui/webui/brave_rewards/rewards_page_top_ui.h" #include "brave/browser/ui/webui/brave_rewards/rewards_panel_ui.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/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/pref_names.h" #include "brave/components/constants/webui_url_constants.h" #include "brave/components/l10n/common/localization_util.h" #include "brave/components/vector_icons/vector_icons.h" diff --git a/browser/ui/views/brave_actions/brave_rewards_action_view.h b/browser/ui/views/brave_actions/brave_rewards_action_view.h index 5a29a1ca80e8..1ddab19dd1d0 100644 --- a/browser/ui/views/brave_actions/brave_rewards_action_view.h +++ b/browser/ui/views/brave_actions/brave_rewards_action_view.h @@ -14,10 +14,10 @@ #include "base/memory/weak_ptr.h" #include "brave/browser/brave_rewards/rewards_tab_helper.h" #include "brave/browser/ui/brave_rewards/rewards_panel_coordinator.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service_observer.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" +#include "brave/components/brave_rewards/content/rewards_notification_service.h" +#include "brave/components/brave_rewards/content/rewards_notification_service_observer.h" +#include "brave/components/brave_rewards/content/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" #include "chrome/browser/ui/views/toolbar/toolbar_button.h" #include "components/prefs/pref_change_registrar.h" diff --git a/browser/ui/webui/ads_internals/BUILD.gn b/browser/ui/webui/ads_internals/BUILD.gn index 1f73e0434f5d..1dd841e6ae2e 100644 --- a/browser/ui/webui/ads_internals/BUILD.gn +++ b/browser/ui/webui/ads_internals/BUILD.gn @@ -13,7 +13,7 @@ source_set("ads_internals") { "//brave/components/brave_ads/browser", "//brave/components/brave_ads/browser/resources:generated_resources", "//brave/components/brave_ads/core", - "//brave/components/brave_rewards/common", + "//brave/components/brave_rewards/core", "//chrome/browser:browser_public_dependencies", "//chrome/browser/profiles:profile", ] diff --git a/browser/ui/webui/brave_rewards/rewards_page_data_source.cc b/browser/ui/webui/brave_rewards/rewards_page_data_source.cc index 8fe750a42a08..3d307d756f31 100644 --- a/browser/ui/webui/brave_rewards/rewards_page_data_source.cc +++ b/browser/ui/webui/brave_rewards/rewards_page_data_source.cc @@ -9,7 +9,7 @@ #include "base/feature_list.h" #include "brave/components/brave_adaptive_captcha/server_util.h" -#include "brave/components/brave_rewards/common/features.h" +#include "brave/components/brave_rewards/core/features.h" #include "brave/components/brave_rewards/resources/grit/brave_rewards_resources.h" #include "brave/components/brave_rewards/resources/grit/rewards_page_generated_map.h" #include "brave/components/constants/webui_url_constants.h" diff --git a/browser/ui/webui/brave_rewards/rewards_page_handler.cc b/browser/ui/webui/brave_rewards/rewards_page_handler.cc index 56c3bf1811b2..69bde0a197c7 100644 --- a/browser/ui/webui/brave_rewards/rewards_page_handler.cc +++ b/browser/ui/webui/brave_rewards/rewards_page_handler.cc @@ -24,11 +24,11 @@ #include "brave/components/brave_ads/core/public/targeting/geographical/subdivision/supported_subdivisions.h" #include "brave/components/brave_ads/core/public/user_engagement/reactions/reactions_util.h" #include "brave/components/brave_news/common/pref_names.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/pref_names.h" -#include "brave/components/brave_rewards/common/rewards_util.h" +#include "brave/components/brave_rewards/content/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/pref_names.h" +#include "brave/components/brave_rewards/core/rewards_util.h" #include "brave/components/constants/pref_names.h" #include "brave/components/l10n/common/country_code_util.h" #include "brave/components/ntp_background_images/common/pref_names.h" diff --git a/browser/ui/webui/brave_rewards/rewards_page_handler.h b/browser/ui/webui/brave_rewards/rewards_page_handler.h index 6ae583653107..2ea7247abc45 100644 --- a/browser/ui/webui/brave_rewards/rewards_page_handler.h +++ b/browser/ui/webui/brave_rewards/rewards_page_handler.h @@ -10,7 +10,7 @@ #include #include "base/memory/raw_ptr.h" -#include "brave/components/brave_rewards/common/mojom/rewards_page.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_page.mojom.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" diff --git a/browser/ui/webui/brave_rewards/rewards_page_top_ui.h b/browser/ui/webui/brave_rewards/rewards_page_top_ui.h index 9e557ec771d0..0ebd0b3ddfae 100644 --- a/browser/ui/webui/brave_rewards/rewards_page_top_ui.h +++ b/browser/ui/webui/brave_rewards/rewards_page_top_ui.h @@ -9,7 +9,7 @@ #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_page.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_page.mojom.h" #include "chrome/browser/ui/webui/top_chrome/top_chrome_web_ui_controller.h" #include "chrome/browser/ui/webui/top_chrome/top_chrome_webui_config.h" #include "mojo/public/cpp/bindings/pending_receiver.h" diff --git a/browser/ui/webui/brave_rewards/rewards_page_ui.h b/browser/ui/webui/brave_rewards/rewards_page_ui.h index 6dc580e46482..46c6833962d9 100644 --- a/browser/ui/webui/brave_rewards/rewards_page_ui.h +++ b/browser/ui/webui/brave_rewards/rewards_page_ui.h @@ -9,7 +9,7 @@ #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_page.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_page.mojom.h" #include "content/public/browser/web_ui_controller.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" diff --git a/browser/ui/webui/brave_rewards/rewards_panel_handler.cc b/browser/ui/webui/brave_rewards/rewards_panel_handler.cc index b9cd5802c2b2..cfd6369b924b 100644 --- a/browser/ui/webui/brave_rewards/rewards_panel_handler.cc +++ b/browser/ui/webui/brave_rewards/rewards_panel_handler.cc @@ -7,7 +7,7 @@ #include -#include "brave/components/brave_rewards/browser/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" diff --git a/browser/ui/webui/brave_rewards/rewards_panel_handler.h b/browser/ui/webui/brave_rewards/rewards_panel_handler.h index 6d4836c49a60..bc9b0e785618 100644 --- a/browser/ui/webui/brave_rewards/rewards_panel_handler.h +++ b/browser/ui/webui/brave_rewards/rewards_panel_handler.h @@ -9,7 +9,7 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "brave/browser/ui/brave_rewards/rewards_panel_coordinator.h" -#include "brave/components/brave_rewards/common/mojom/rewards_panel.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_panel.mojom.h" #include "chrome/browser/ui/webui/top_chrome/top_chrome_web_ui_controller.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" diff --git a/browser/ui/webui/brave_rewards/rewards_panel_ui.h b/browser/ui/webui/brave_rewards/rewards_panel_ui.h index 8bd4debc7c05..2088ff72ae15 100644 --- a/browser/ui/webui/brave_rewards/rewards_panel_ui.h +++ b/browser/ui/webui/brave_rewards/rewards_panel_ui.h @@ -10,7 +10,7 @@ #include #include "base/memory/raw_ptr.h" -#include "brave/components/brave_rewards/common/mojom/rewards_panel.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_panel.mojom.h" #include "chrome/browser/ui/webui/top_chrome/top_chrome_web_ui_controller.h" #include "chrome/browser/ui/webui/top_chrome/top_chrome_webui_config.h" #include "mojo/public/cpp/bindings/pending_receiver.h" diff --git a/browser/ui/webui/brave_rewards/tip_panel_handler.cc b/browser/ui/webui/brave_rewards/tip_panel_handler.cc index 696947b96969..a5c94fcd94b6 100644 --- a/browser/ui/webui/brave_rewards/tip_panel_handler.cc +++ b/browser/ui/webui/brave_rewards/tip_panel_handler.cc @@ -11,7 +11,7 @@ #include "base/functional/bind.h" #include "brave/browser/brave_rewards/rewards_service_factory.h" #include "brave/browser/ui/brave_rewards/tip_panel_coordinator.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service.h" #include "brave/components/constants/webui_url_constants.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser_finder.h" diff --git a/browser/ui/webui/brave_rewards/tip_panel_handler.h b/browser/ui/webui/brave_rewards/tip_panel_handler.h index 34b8606f6f10..5308886725f0 100644 --- a/browser/ui/webui/brave_rewards/tip_panel_handler.h +++ b/browser/ui/webui/brave_rewards/tip_panel_handler.h @@ -10,7 +10,7 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/common/mojom/rewards_tip_panel.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_tip_panel.mojom.h" #include "chrome/browser/ui/webui/top_chrome/top_chrome_web_ui_controller.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" diff --git a/browser/ui/webui/brave_rewards/tip_panel_ui.h b/browser/ui/webui/brave_rewards/tip_panel_ui.h index c5b9eb6ee21a..dee80f662872 100644 --- a/browser/ui/webui/brave_rewards/tip_panel_ui.h +++ b/browser/ui/webui/brave_rewards/tip_panel_ui.h @@ -9,7 +9,7 @@ #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_tip_panel.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_tip_panel.mojom.h" #include "chrome/browser/ui/webui/top_chrome/top_chrome_web_ui_controller.h" #include "chrome/browser/ui/webui/top_chrome/top_chrome_webui_config.h" #include "mojo/public/cpp/bindings/pending_receiver.h" diff --git a/browser/ui/webui/brave_rewards_internals_ui.cc b/browser/ui/webui/brave_rewards_internals_ui.cc index 95b5601cb0b2..e6c706f8cd27 100644 --- a/browser/ui/webui/brave_rewards_internals_ui.cc +++ b/browser/ui/webui/brave_rewards_internals_ui.cc @@ -19,9 +19,9 @@ #include "brave/browser/ui/webui/brave_webui_source.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_service.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/content/rewards_service.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/brave_rewards/resources/grit/brave_rewards_internals_generated_map.h" #include "brave/components/brave_rewards/resources/grit/brave_rewards_resources.h" #include "chrome/browser/profiles/profile.h" diff --git a/browser/ui/webui/brave_rewards_page_ui.cc b/browser/ui/webui/brave_rewards_page_ui.cc index 8a77dd41a6b1..c8e5ee069eed 100644 --- a/browser/ui/webui/brave_rewards_page_ui.cc +++ b/browser/ui/webui/brave_rewards_page_ui.cc @@ -30,12 +30,12 @@ #include "brave/components/brave_ads/core/public/targeting/geographical/subdivision/supported_subdivisions.h" #include "brave/components/brave_ads/core/public/user_engagement/reactions/reactions_util.h" #include "brave/components/brave_news/common/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/browser/rewards_service_observer.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/pref_names.h" -#include "brave/components/brave_rewards/common/rewards_util.h" +#include "brave/components/brave_rewards/content/rewards_p3a.h" +#include "brave/components/brave_rewards/content/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/pref_names.h" +#include "brave/components/brave_rewards/core/rewards_util.h" #include "brave/components/brave_rewards/resources/grit/brave_rewards_page_generated_map.h" #include "brave/components/brave_rewards/resources/grit/brave_rewards_resources.h" #include "brave/components/constants/webui_url_constants.h" diff --git a/browser/ui/webui/brave_web_ui_controller_factory.cc b/browser/ui/webui/brave_web_ui_controller_factory.cc index 46c16d5feb36..d2b980c049ba 100644 --- a/browser/ui/webui/brave_web_ui_controller_factory.cc +++ b/browser/ui/webui/brave_web_ui_controller_factory.cc @@ -23,7 +23,7 @@ #include "brave/browser/ui/webui/skus_internals_ui.h" #include "brave/components/ai_rewriter/common/buildflags/buildflags.h" #include "brave/components/brave_federated/features.h" -#include "brave/components/brave_rewards/common/features.h" +#include "brave/components/brave_rewards/core/features.h" #include "brave/components/brave_wallet/common/common_utils.h" #include "brave/components/constants/pref_names.h" #include "brave/components/constants/webui_url_constants.h" diff --git a/browser/ui/webui/settings/brave_clear_browsing_data_handler.cc b/browser/ui/webui/settings/brave_clear_browsing_data_handler.cc index bc31bfeeb727..550b36a152d9 100644 --- a/browser/ui/webui/settings/brave_clear_browsing_data_handler.cc +++ b/browser/ui/webui/settings/brave_clear_browsing_data_handler.cc @@ -9,7 +9,7 @@ #include "base/functional/callback_helpers.h" #include "brave/browser/brave_ads/ads_service_factory.h" #include "brave/components/brave_ads/core/browser/service/ads_service.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 "components/prefs/pref_service.h" diff --git a/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc b/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc index 1fa6ab3ffbce..7c980f643bcb 100644 --- a/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc +++ b/browser/ui/webui/settings/brave_settings_localized_strings_provider.cc @@ -12,7 +12,7 @@ #include "brave/browser/ui/webui/brave_settings_ui.h" #include "brave/browser/ui/webui/settings/brave_privacy_handler.h" #include "brave/components/ai_chat/core/browser/model_validator.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_vpn/common/buildflags/buildflags.h" #include "brave/components/brave_wallet/browser/pref_names.h" diff --git a/build/android/config.gni b/build/android/config.gni index b681f6121d5c..37c043600d22 100644 --- a/build/android/config.gni +++ b/build/android/config.gni @@ -32,7 +32,7 @@ brave_chrome_java_deps = [ "//brave/browser/ui/android/theme:java", "//brave/components/ai_chat/core/common/mojom:mojom_java", "//brave/components/brave_news/common:mojom_java", - "//brave/components/brave_rewards/common/mojom:mojom_java", + "//brave/components/brave_rewards/core/mojom:mojom_java", "//brave/components/brave_shields/core/common:mojom_java", "//brave/components/brave_vpn/common/mojom:mojom_java", "//brave/components/brave_wallet/common:mojom_java", diff --git a/chromium_presubmit_config.json5 b/chromium_presubmit_config.json5 index a8662a447c8b..26e4fe6fa6c5 100644 --- a/chromium_presubmit_config.json5 +++ b/chromium_presubmit_config.json5 @@ -153,7 +153,8 @@ "test/data/speedreader/", ], "CheckStableMojomChanges": [ - "components/brave_rewards/common/mojom/rewards_engine\\.mojom", + "components/brave_rewards/common/mojom/.*\\.mojom", + "components/services/bat_rewards/public/interfaces/rewards_engine_factory\\.mojom", ] }, diff --git a/chromium_src/chrome/browser/flags/android/DEPS b/chromium_src/chrome/browser/flags/android/DEPS index 884e0f15c99e..69f757e80728 100644 --- a/chromium_src/chrome/browser/flags/android/DEPS +++ b/chromium_src/chrome/browser/flags/android/DEPS @@ -1,7 +1,7 @@ include_rules = [ "+brave/components/ai_chat/core/common/features.h", "+brave/components/brave_news/common/features.h", - "+brave/components/brave_rewards/common/features.h", + "+brave/components/brave_rewards/core/features.h", "+brave/components/brave_search_conversion/features.h", "+brave/components/brave_shields/core/common/features.h", "+brave/components/brave_vpn/common/features.h", diff --git a/chromium_src/chrome/browser/flags/android/chrome_feature_list.cc b/chromium_src/chrome/browser/flags/android/chrome_feature_list.cc index 3f2bf292f67f..1010a1590bc7 100644 --- a/chromium_src/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chromium_src/chrome/browser/flags/android/chrome_feature_list.cc @@ -9,7 +9,7 @@ #include "brave/browser/brave_browser_features.h" #include "brave/components/ai_chat/core/common/features.h" #include "brave/components/brave_news/common/features.h" -#include "brave/components/brave_rewards/common/features.h" +#include "brave/components/brave_rewards/core/features.h" #include "brave/components/brave_search_conversion/features.h" #include "brave/components/brave_shields/core/common/features.h" #include "brave/components/brave_vpn/common/features.h" diff --git a/chromium_src/ios/chrome/browser/shared/model/prefs/DEPS b/chromium_src/ios/chrome/browser/shared/model/prefs/DEPS index 6473877cf5b9..178a9dabf1d0 100644 --- a/chromium_src/ios/chrome/browser/shared/model/prefs/DEPS +++ b/chromium_src/ios/chrome/browser/shared/model/prefs/DEPS @@ -1,7 +1,7 @@ include_rules = [ "+brave/components/brave_ads/core/public", "+brave/components/brave_news/common", - "+brave/components/brave_rewards/common", + "+brave/components/brave_rewards/core", "+brave/components/brave_sync", "+brave/components/brave_wallet/browser", "+brave/components/de_amp/common", diff --git a/chromium_src/ios/chrome/browser/shared/model/prefs/browser_prefs.mm b/chromium_src/ios/chrome/browser/shared/model/prefs/browser_prefs.mm index aedfd60ecfc9..4e0ae3097963 100644 --- a/chromium_src/ios/chrome/browser/shared/model/prefs/browser_prefs.mm +++ b/chromium_src/ios/chrome/browser/shared/model/prefs/browser_prefs.mm @@ -9,7 +9,7 @@ #include "brave/components/brave_ads/core/public/prefs/obsolete_pref_util.h" #include "brave/components/brave_ads/core/public/prefs/pref_registry.h" #include "brave/components/brave_news/common/pref_names.h" -#include "brave/components/brave_rewards/common/pref_registry.h" +#include "brave/components/brave_rewards/core/pref_registry.h" #include "brave/components/brave_shields/core/common/pref_names.h" #include "brave/components/brave_sync/brave_sync_prefs.h" #include "brave/components/brave_wallet/browser/brave_wallet_prefs.h" diff --git a/chromium_src/ios/chrome/browser/shared/model/prefs/sources.gni b/chromium_src/ios/chrome/browser/shared/model/prefs/sources.gni index 3d3ac9d26ee6..37347cb945be 100644 --- a/chromium_src/ios/chrome/browser/shared/model/prefs/sources.gni +++ b/chromium_src/ios/chrome/browser/shared/model/prefs/sources.gni @@ -6,7 +6,7 @@ brave_browser_prefs_deps = [ "//brave/components/brave_ads/core", "//brave/components/brave_news/common", - "//brave/components/brave_rewards/common", + "//brave/components/brave_rewards/core", "//brave/components/brave_shields/core/common", "//brave/components/brave_sync:prefs", "//brave/components/brave_wallet/browser", diff --git a/components/brave_adaptive_captcha/BUILD.gn b/components/brave_adaptive_captcha/BUILD.gn index 6e5d7148c27b..705fdb2bf747 100644 --- a/components/brave_adaptive_captcha/BUILD.gn +++ b/components/brave_adaptive_captcha/BUILD.gn @@ -20,9 +20,9 @@ source_set("brave_adaptive_captcha") { deps = [ "//base", "//brave/components/api_request_helper", - "//brave/components/brave_rewards/browser", - "//brave/components/brave_rewards/common", - "//brave/components/brave_rewards/core:buildflags", + "//brave/components/brave_rewards/content", + "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core/internal:buildflags", "//components/keyed_service/core", "//components/prefs", "//net", diff --git a/components/brave_adaptive_captcha/brave_adaptive_captcha_service.h b/components/brave_adaptive_captcha/brave_adaptive_captcha_service.h index 9a012230677c..7facac7f1aa5 100644 --- a/components/brave_adaptive_captcha/brave_adaptive_captcha_service.h +++ b/components/brave_adaptive_captcha/brave_adaptive_captcha_service.h @@ -13,8 +13,8 @@ #include "brave/components/api_request_helper/api_request_helper.h" #include "brave/components/brave_adaptive_captcha/brave_adaptive_captcha_delegate.h" #include "brave/components/brave_adaptive_captcha/get_adaptive_captcha_challenge.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" +#include "brave/components/brave_rewards/content/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" #include "components/keyed_service/core/keyed_service.h" namespace network { diff --git a/components/brave_adaptive_captcha/server_util.cc b/components/brave_adaptive_captcha/server_util.cc index 885b022a9ce2..f4fc823efd92 100644 --- a/components/brave_adaptive_captcha/server_util.cc +++ b/components/brave_adaptive_captcha/server_util.cc @@ -6,8 +6,8 @@ #include "brave/components/brave_adaptive_captcha/server_util.h" #include "base/check.h" -#include "brave/components/brave_rewards/common/rewards_flags.h" -#include "brave/components/brave_rewards/core/buildflags.h" +#include "brave/components/brave_rewards/core/internal/buildflags.h" +#include "brave/components/brave_rewards/core/rewards_flags.h" namespace brave_adaptive_captcha { diff --git a/components/brave_ads/browser/BUILD.gn b/components/brave_ads/browser/BUILD.gn index 99e8b089a0af..e5f32c3b07dd 100644 --- a/components/brave_ads/browser/BUILD.gn +++ b/components/brave_ads/browser/BUILD.gn @@ -70,8 +70,8 @@ static_library("browser") { "//brave/app:brave_generated_resources_grit", "//brave/common", "//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", "//components/history/core/browser", "//content/public/browser", "//mojo/public/cpp/bindings", diff --git a/components/brave_ads/browser/ads_service_impl.cc b/components/brave_ads/browser/ads_service_impl.cc index 5f446b51228f..f5c3b98880bc 100644 --- a/components/brave_ads/browser/ads_service_impl.cc +++ b/components/brave_ads/browser/ads_service_impl.cc @@ -51,9 +51,9 @@ #include "brave/components/brave_ads/core/public/user_attention/user_idle_detection/user_idle_detection_feature.h" #include "brave/components/brave_ads/resources/grit/bat_ads_resources.h" #include "brave/components/brave_news/common/pref_names.h" -#include "brave/components/brave_rewards/browser/rewards_service.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom-forward.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/content/rewards_service.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom-forward.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/l10n/common/country_code_util.h" #include "brave/components/l10n/common/locale_util.h" #include "brave/components/l10n/common/prefs.h" diff --git a/components/brave_ads/browser/ads_service_impl.h b/components/brave_ads/browser/ads_service_impl.h index 3e2c6e7ef173..338c079f47a7 100644 --- a/components/brave_ads/browser/ads_service_impl.h +++ b/components/brave_ads/browser/ads_service_impl.h @@ -28,7 +28,7 @@ #include "brave/components/brave_ads/core/mojom/brave_ads.mojom.h" #include "brave/components/brave_ads/core/public/ads_callback.h" #include "brave/components/brave_ads/core/public/service/ads_service_callback.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom-forward.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom-forward.h" #include "brave/components/services/bat_ads/public/interfaces/bat_ads.mojom.h" #include "components/history/core/browser/history_service.h" #include "components/prefs/pref_change_registrar.h" diff --git a/components/brave_ads/core/browser/internals/BUILD.gn b/components/brave_ads/core/browser/internals/BUILD.gn index 441d4c1cc58b..386a5bd517fe 100644 --- a/components/brave_ads/core/browser/internals/BUILD.gn +++ b/components/brave_ads/core/browser/internals/BUILD.gn @@ -13,7 +13,7 @@ source_set("internals") { public_deps = [ "//base", - "//brave/components/brave_rewards/common", + "//brave/components/brave_rewards/core", "//brave/components/services/bat_ads/public/interfaces", "//components/prefs", "//mojo/public/cpp/bindings", diff --git a/components/brave_ads/core/browser/internals/ads_internals_handler.cc b/components/brave_ads/core/browser/internals/ads_internals_handler.cc index f1679145fdc6..c16fa37cc351 100644 --- a/components/brave_ads/core/browser/internals/ads_internals_handler.cc +++ b/components/brave_ads/core/browser/internals/ads_internals_handler.cc @@ -11,7 +11,7 @@ #include "base/functional/bind.h" #include "base/json/json_writer.h" #include "brave/components/brave_ads/core/browser/service/ads_service.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/services/bat_ads/public/interfaces/bat_ads.mojom.h" #include "components/prefs/pref_service.h" diff --git a/components/brave_ads/core/internal/BUILD.gn b/components/brave_ads/core/internal/BUILD.gn index 065164a88f7c..4339d2dc7655 100644 --- a/components/brave_ads/core/internal/BUILD.gn +++ b/components/brave_ads/core/internal/BUILD.gn @@ -1227,8 +1227,8 @@ static_library("internal") { deps = [ "//base", "//brave/components/brave_news/common", - "//brave/components/brave_rewards/common", "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core/internal", "//brave/components/challenge_bypass_ristretto", "//brave/components/constants", "//brave/components/l10n/common", diff --git a/components/brave_ads/core/internal/common/country_code/country_code_unittest.cc b/components/brave_ads/core/internal/common/country_code/country_code_unittest.cc index a842c5772bba..90d1e6218e57 100644 --- a/components/brave_ads/core/internal/common/country_code/country_code_unittest.cc +++ b/components/brave_ads/core/internal/common/country_code/country_code_unittest.cc @@ -14,7 +14,7 @@ #include "brave/components/brave_ads/core/internal/common/test/test_base.h" #include "brave/components/brave_ads/core/internal/prefs/pref_util.h" #include "brave/components/brave_ads/core/internal/settings/settings_test_util.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/l10n/common/prefs.h" #include "net/http/http_status_code.h" diff --git a/components/brave_ads/core/internal/common/subdivision/subdivision_unittest.cc b/components/brave_ads/core/internal/common/subdivision/subdivision_unittest.cc index d571bff30647..25ae108034fd 100644 --- a/components/brave_ads/core/internal/common/subdivision/subdivision_unittest.cc +++ b/components/brave_ads/core/internal/common/subdivision/subdivision_unittest.cc @@ -13,7 +13,7 @@ #include "brave/components/brave_ads/core/internal/prefs/pref_util.h" #include "brave/components/brave_ads/core/internal/settings/settings_test_util.h" #include "brave/components/brave_news/common/pref_names.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "net/http/http_status_code.h" // npm run test -- brave_unit_tests --filter=BraveAds* diff --git a/components/brave_ads/core/internal/common/test/internal/command_line_switch_test_util_internal.cc b/components/brave_ads/core/internal/common/test/internal/command_line_switch_test_util_internal.cc index c948a914995b..49612aa8c67c 100644 --- a/components/brave_ads/core/internal/common/test/internal/command_line_switch_test_util_internal.cc +++ b/components/brave_ads/core/internal/common/test/internal/command_line_switch_test_util_internal.cc @@ -5,7 +5,7 @@ #include "brave/components/brave_ads/core/internal/common/test/internal/command_line_switch_test_util_internal.h" -#include "brave/components/brave_rewards/common/rewards_flags.h" +#include "brave/components/brave_rewards/core/rewards_flags.h" namespace brave_ads::test { diff --git a/components/brave_ads/core/internal/common/test/pref_registry_test_util.cc b/components/brave_ads/core/internal/common/test/pref_registry_test_util.cc index 233a861c6e1e..f7f321cc9706 100644 --- a/components/brave_ads/core/internal/common/test/pref_registry_test_util.cc +++ b/components/brave_ads/core/internal/common/test/pref_registry_test_util.cc @@ -11,7 +11,7 @@ #include "brave/components/brave_ads/core/internal/common/test/time_test_util.h" #include "brave/components/brave_ads/core/public/prefs/pref_names.h" #include "brave/components/brave_news/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/l10n/common/locale_util.h" #include "brave/components/l10n/common/prefs.h" #include "brave/components/ntp_background_images/common/pref_names.h" diff --git a/components/brave_ads/core/internal/flags/debug/debug_command_line_switch_parser_util.cc b/components/brave_ads/core/internal/flags/debug/debug_command_line_switch_parser_util.cc index a89ba41afad8..47b63745ef04 100644 --- a/components/brave_ads/core/internal/flags/debug/debug_command_line_switch_parser_util.cc +++ b/components/brave_ads/core/internal/flags/debug/debug_command_line_switch_parser_util.cc @@ -5,7 +5,7 @@ #include "brave/components/brave_ads/core/internal/flags/debug/debug_command_line_switch_parser_util.h" -#include "brave/components/brave_rewards/common/rewards_flags.h" +#include "brave/components/brave_rewards/core/rewards_flags.h" namespace brave_ads { diff --git a/components/brave_ads/core/internal/flags/environment/environment_command_line_switch_parser_util.cc b/components/brave_ads/core/internal/flags/environment/environment_command_line_switch_parser_util.cc index 6a685dae1ea0..8d9cd9293f07 100644 --- a/components/brave_ads/core/internal/flags/environment/environment_command_line_switch_parser_util.cc +++ b/components/brave_ads/core/internal/flags/environment/environment_command_line_switch_parser_util.cc @@ -8,7 +8,7 @@ #include "base/notreached.h" #include "base/types/cxx23_to_underlying.h" #include "brave/components/brave_ads/core/mojom/brave_ads.mojom.h" -#include "brave/components/brave_rewards/common/rewards_flags.h" +#include "brave/components/brave_rewards/core/rewards_flags.h" namespace brave_ads { diff --git a/components/brave_ads/core/internal/prefs/pref_path_util.cc b/components/brave_ads/core/internal/prefs/pref_path_util.cc index e63a1ff31564..43370a3bdc9e 100644 --- a/components/brave_ads/core/internal/prefs/pref_path_util.cc +++ b/components/brave_ads/core/internal/prefs/pref_path_util.cc @@ -7,7 +7,7 @@ #include "brave/components/brave_ads/core/public/prefs/pref_names.h" #include "brave/components/brave_news/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/ntp_background_images/common/pref_names.h" namespace brave_ads { diff --git a/components/brave_ads/core/internal/settings/settings.cc b/components/brave_ads/core/internal/settings/settings.cc index fa80913ded2b..9be6652fc764 100644 --- a/components/brave_ads/core/internal/settings/settings.cc +++ b/components/brave_ads/core/internal/settings/settings.cc @@ -9,7 +9,7 @@ #include "brave/components/brave_ads/core/public/ad_units/notification_ad/notification_ad_feature.h" #include "brave/components/brave_ads/core/public/prefs/pref_names.h" #include "brave/components/brave_news/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/ntp_background_images/common/pref_names.h" namespace brave_ads { diff --git a/components/brave_ads/core/internal/settings/settings_test_util.cc b/components/brave_ads/core/internal/settings/settings_test_util.cc index 9a0773f7f06b..628a14b046b9 100644 --- a/components/brave_ads/core/internal/settings/settings_test_util.cc +++ b/components/brave_ads/core/internal/settings/settings_test_util.cc @@ -8,7 +8,7 @@ #include "brave/components/brave_ads/core/internal/common/test/profile_pref_value_test_util.h" #include "brave/components/brave_ads/core/public/prefs/pref_names.h" #include "brave/components/brave_news/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/ntp_background_images/common/pref_names.h" namespace brave_ads::test { diff --git a/components/brave_ads/core/test/BUILD.gn b/components/brave_ads/core/test/BUILD.gn index bfad995e665d..0579b76185e9 100644 --- a/components/brave_ads/core/test/BUILD.gn +++ b/components/brave_ads/core/test/BUILD.gn @@ -658,9 +658,8 @@ source_set("brave_ads_unit_tests") { "//brave/components/brave_ads/core", "//brave/components/brave_ads/core/internal", "//brave/components/brave_news/common", - "//brave/components/brave_rewards/common", "//brave/components/brave_rewards/core", - "//brave/components/brave_rewards/test:brave_rewards_unit_tests", + "//brave/components/brave_rewards/core/internal", "//brave/components/challenge_bypass_ristretto", "//brave/components/l10n/common", "//brave/components/l10n/common:test_support", diff --git a/components/brave_news/browser/BUILD.gn b/components/brave_news/browser/BUILD.gn index c5ff6e93cd0e..24ade0916360 100644 --- a/components/brave_news/browser/BUILD.gn +++ b/components/brave_news/browser/BUILD.gn @@ -69,7 +69,7 @@ static_library("browser") { "//brave/components/brave_ads/browser", "//brave/components/brave_news/api", "//brave/components/brave_private_cdn", - "//brave/components/brave_rewards/common", + "//brave/components/brave_rewards/core", "//brave/components/l10n/common", "//brave/components/p3a_utils", "//brave/components/time_period_storage", diff --git a/components/brave_news/browser/brave_news_p3a.cc b/components/brave_news/browser/brave_news_p3a.cc index fd70dc80d277..158266b2e1cf 100644 --- a/components/brave_news/browser/brave_news_p3a.cc +++ b/components/brave_news/browser/brave_news_p3a.cc @@ -15,7 +15,7 @@ #include "brave/components/brave_news/browser/brave_news_pref_manager.h" #include "brave/components/brave_news/common/p3a_pref_names.h" #include "brave/components/brave_news/common/subscriptions_snapshot.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/p3a_utils/bucket.h" #include "brave/components/p3a_utils/feature_usage.h" #include "brave/components/time_period_storage/weekly_storage.h" diff --git a/components/brave_news/browser/brave_news_p3a_unittest.cc b/components/brave_news/browser/brave_news_p3a_unittest.cc index 2835cea448a8..106882dc3a8d 100644 --- a/components/brave_news/browser/brave_news_p3a_unittest.cc +++ b/components/brave_news/browser/brave_news_p3a_unittest.cc @@ -12,7 +12,7 @@ #include "brave/components/brave_news/browser/brave_news_pref_manager.h" #include "brave/components/brave_news/common/p3a_pref_names.h" #include "brave/components/brave_news/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/time_period_storage/weekly_storage.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/scoped_user_pref_update.h" diff --git a/components/brave_news/browser/test/BUILD.gn b/components/brave_news/browser/test/BUILD.gn index 8ea5493bb109..6fa941a76095 100644 --- a/components/brave_news/browser/test/BUILD.gn +++ b/components/brave_news/browser/test/BUILD.gn @@ -36,7 +36,7 @@ source_set("brave_news_unit_tests") { "//brave/components/brave_news/common", "//brave/components/brave_news/common:mojom", "//brave/components/brave_news/rust:unit_tests", - "//brave/components/brave_rewards/common", + "//brave/components/brave_rewards/core", "//brave/components/l10n/common", "//brave/components/l10n/common:test_support", "//brave/components/time_period_storage", diff --git a/components/brave_rewards/browser/android_util.h b/components/brave_rewards/browser/android_util.h deleted file mode 100644 index e8f56543aaa9..000000000000 --- a/components/brave_rewards/browser/android_util.h +++ /dev/null @@ -1,17 +0,0 @@ -/* 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/. */ - -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_ANDROID_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_ANDROID_UTIL_H_ - -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" - -namespace android_util { - -brave_rewards::mojom::ClientInfoPtr GetAndroidClientInfo(); - -} // namespace android_util - -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_ANDROID_UTIL_H_ diff --git a/components/brave_rewards/browser/logging.h b/components/brave_rewards/browser/logging.h deleted file mode 100644 index c3171e9b2bad..000000000000 --- a/components/brave_rewards/browser/logging.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (c) 2020 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/. */ - -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_LOGGING_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_LOGGING_H_ - -#include - -namespace brave_rewards { - -#define BLOG(verbose_level, stream) Log(__FILE__, __LINE__, \ - verbose_level, (std::ostringstream() << stream).str()); - -#define BLOG_IF(verbose_level, condition, stream) \ - !(condition) ? (void) 0 : BLOG(verbose_level, stream) - -} // namespace brave_rewards - -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_LOGGING_H_ diff --git a/components/brave_rewards/browser/test/DEPS b/components/brave_rewards/browser/test/DEPS deleted file mode 100644 index 4ef4138e48f6..000000000000 --- a/components/brave_rewards/browser/test/DEPS +++ /dev/null @@ -1,3 +0,0 @@ -include_rules = [ - "+crypto", -] diff --git a/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.h b/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.h deleted file mode 100644 index bd3cb00cab57..000000000000 --- a/components/brave_rewards/browser/test/common/rewards_browsertest_context_util.h +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright (c) 2020 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/. */ - -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_CONTEXT_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_CONTEXT_UTIL_H_ - -#include -#include - -#include "build/build_config.h" - -namespace content { -class WebContents; -} // namespace content - -namespace brave_rewards::test_util { - -void WaitForElementToAppear( - content::WebContents* context, - const std::string& selector, - bool should_appear = true); - -void WaitForElementToEqual( - content::WebContents*, - const std::string& selector, - const std::string& expectedValue); - -void WaitForElementToContain( - content::WebContents* context, - const std::string& selector, - const std::string& substring); - -void WaitForElementToContainHTML( - content::WebContents* context, - const std::string& selector, - const std::string& html); - -void WaitForElementThenClick( - content::WebContents* context, - const std::string& selector); - -std::string WaitForElementThenGetAttribute( - content::WebContents* context, - const std::string& selector, - const std::string& attribute_name); - -std::string WaitForElementThenGetContent( - content::WebContents* context, - const std::string& selector); - -void DragAndDrop( - content::WebContents* context, - const std::string& drag_selector, - const std::string& drop_selector); - -std::vector GetSiteBannerTipOptions(content::WebContents* site_banner); - -double GetRewardsPopupMonthlyTipValue(content::WebContents* context); - -} // namespace brave_rewards::test_util - -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_COMMON_REWARDS_BROWSERTEST_CONTEXT_UTIL_H_ diff --git a/components/brave_rewards/browser/test_util.h b/components/brave_rewards/browser/test_util.h deleted file mode 100644 index ecbd65934593..000000000000 --- a/components/brave_rewards/browser/test_util.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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/. */ - -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_UTIL_H_ - -#include - -#include "base/files/file_path.h" - -class KeyedService; -class Profile; - -namespace brave_rewards { - -std::unique_ptr CreateBraveRewardsProfile(const base::FilePath& path); - -} // namespace brave_rewards - -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_TEST_UTIL_H_ diff --git a/components/brave_rewards/common/BUILD.gn b/components/brave_rewards/common/BUILD.gn deleted file mode 100644 index 9c45c3c0cd08..000000000000 --- a/components/brave_rewards/common/BUILD.gn +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2023 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 https://mozilla.org/MPL/2.0/. - -source_set("features") { - sources = [ - "features.cc", - "features.h", - ] - - deps = [ - "//base", - "//brave/components/brave_rewards/common/buildflags:buildflags", - ] -} - -static_library("common") { - sources = [ - "pref_names.h", - "pref_registry.cc", - "pref_registry.h", - "publisher_utils.cc", - "publisher_utils.h", - "rewards_flags.cc", - "rewards_flags.h", - "rewards_util.cc", - "rewards_util.h", - ] - - deps = [ - ":features", - "//base", - "//brave/components/l10n/common", - "//components/prefs", - "//net", - "//url", - ] -} diff --git a/components/brave_rewards/common/buildflags/BUILD.gn b/components/brave_rewards/common/buildflags/BUILD.gn deleted file mode 100644 index 517b992e002e..000000000000 --- a/components/brave_rewards/common/buildflags/BUILD.gn +++ /dev/null @@ -1,7 +0,0 @@ -import("//brave/components/brave_rewards/common/buildflags/buildflags.gni") -import("//build/buildflag_header.gni") - -buildflag_header("buildflags") { - header = "buildflags.h" - flags = [ "ENABLE_GEMINI_WALLET=$enable_gemini_wallet" ] -} diff --git a/components/brave_rewards/common/buildflags/buildflags.gni b/components/brave_rewards/common/buildflags/buildflags.gni deleted file mode 100644 index 64ed77eeef20..000000000000 --- a/components/brave_rewards/common/buildflags/buildflags.gni +++ /dev/null @@ -1,3 +0,0 @@ -declare_args() { - enable_gemini_wallet = is_mac || is_linux || is_win || is_android -} diff --git a/components/brave_rewards/browser/BUILD.gn b/components/brave_rewards/content/BUILD.gn similarity index 69% rename from components/brave_rewards/browser/BUILD.gn rename to components/brave_rewards/content/BUILD.gn index 3ec2f42a30c3..860f39aca364 100644 --- a/components/brave_rewards/browser/BUILD.gn +++ b/components/brave_rewards/content/BUILD.gn @@ -3,10 +3,10 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at https://mozilla.org/MPL/2.0/. -import("//brave/components/brave_rewards/core/config.gni") +import("//brave/components/brave_rewards/core/internal/config.gni") import("//extensions/buildflags/buildflags.gni") -static_library("browser") { +static_library("content") { sources = [ "android_util.cc", "android_util.h", @@ -34,10 +34,10 @@ static_library("browser") { "//base", "//brave/app:brave_generated_resources_grit", "//brave/components/brave_ads/core", - "//brave/components/brave_rewards/common", - "//brave/components/brave_rewards/common:features", - "//brave/components/brave_rewards/common/buildflags", "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core:features", + "//brave/components/brave_rewards/core/buildflags", + "//brave/components/brave_rewards/core/internal", "//brave/components/brave_wallet/browser", "//brave/components/brave_wallet/common", "//brave/components/brave_wallet/common:mojom", @@ -64,7 +64,7 @@ static_library("browser") { "//url", ] - public_deps = [ "//brave/components/brave_rewards/core:headers" ] + public_deps = [ "//brave/components/brave_rewards/core/internal:headers" ] if (is_android) { deps += [ "//brave/components/safetynet:android" ] @@ -74,12 +74,12 @@ static_library("browser") { source_set("testutil") { testonly = true deps = [ - ":browser", + ":content", "//base", "//brave/browser", "//brave/browser/brave_rewards", - "//brave/components/brave_rewards/common", - "//brave/components/brave_rewards/core:headers", + "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core/internal:headers", "//chrome/browser/bitmap_fetcher:bitmap_fetcher", "//chrome/browser/prefs", "//chrome/test:test_support", @@ -92,3 +92,29 @@ source_set("testutil") { "test_util.h", ] } + +source_set("unit_tests") { + testonly = true + + sources = [ + "rewards_protocol_navigation_throttle_unittest.cc", + "rewards_service_impl_jp_unittest.cc", + "rewards_service_impl_unittest.cc", + ] + + deps = [ + ":content", + ":testutil", + "//base", + "//base/test:test_support", + "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core:features", + "//brave/components/l10n/common:test_support", + "//chrome/browser/profiles:profile", + "//chrome/test:test_support", + "//components/prefs", + "//content/test:test_support", + "//testing/gtest", + "//url", + ] +} diff --git a/components/brave_rewards/browser/CHANGELOG.md b/components/brave_rewards/content/CHANGELOG.md similarity index 100% rename from components/brave_rewards/browser/CHANGELOG.md rename to components/brave_rewards/content/CHANGELOG.md diff --git a/components/brave_rewards/browser/DEPS b/components/brave_rewards/content/DEPS similarity index 100% rename from components/brave_rewards/browser/DEPS rename to components/brave_rewards/content/DEPS diff --git a/components/brave_rewards/browser/android_util.cc b/components/brave_rewards/content/android_util.cc similarity index 79% rename from components/brave_rewards/browser/android_util.cc rename to components/brave_rewards/content/android_util.cc index 9d43f78fc87f..94dc4c7c6a2e 100644 --- a/components/brave_rewards/browser/android_util.cc +++ b/components/brave_rewards/content/android_util.cc @@ -1,9 +1,9 @@ /* 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/. */ + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/browser/android_util.h" +#include "brave/components/brave_rewards/content/android_util.h" namespace android_util { diff --git a/components/brave_rewards/content/android_util.h b/components/brave_rewards/content/android_util.h new file mode 100644 index 000000000000..cf9a136c8d42 --- /dev/null +++ b/components/brave_rewards/content/android_util.h @@ -0,0 +1,17 @@ +/* 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 https://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_ANDROID_UTIL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_ANDROID_UTIL_H_ + +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" + +namespace android_util { + +brave_rewards::mojom::ClientInfoPtr GetAndroidClientInfo(); + +} // namespace android_util + +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_ANDROID_UTIL_H_ diff --git a/components/brave_rewards/browser/diagnostic_log.cc b/components/brave_rewards/content/diagnostic_log.cc similarity index 98% rename from components/brave_rewards/browser/diagnostic_log.cc rename to components/brave_rewards/content/diagnostic_log.cc index ffa1cac90b11..c703dda89eee 100644 --- a/components/brave_rewards/browser/diagnostic_log.cc +++ b/components/brave_rewards/content/diagnostic_log.cc @@ -1,7 +1,7 @@ /* Copyright (c) 2021 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/. */ #ifdef UNSAFE_BUFFERS_BUILD // TODO(https://github.com/brave/brave-browser/issues/41661): Remove this and @@ -9,7 +9,7 @@ #pragma allow_unsafe_buffers #endif -#include "brave/components/brave_rewards/browser/diagnostic_log.h" +#include "brave/components/brave_rewards/content/diagnostic_log.h" #include #include diff --git a/components/brave_rewards/browser/diagnostic_log.h b/components/brave_rewards/content/diagnostic_log.h similarity index 89% rename from components/brave_rewards/browser/diagnostic_log.h rename to components/brave_rewards/content/diagnostic_log.h index 895b3ca21c75..103ca224bd6f 100644 --- a/components/brave_rewards/browser/diagnostic_log.h +++ b/components/brave_rewards/content/diagnostic_log.h @@ -1,10 +1,10 @@ /* Copyright (c) 2021 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/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_DIAGNOSTIC_LOG_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_DIAGNOSTIC_LOG_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_DIAGNOSTIC_LOG_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_DIAGNOSTIC_LOG_H_ #include @@ -66,4 +66,4 @@ class DiagnosticLog { } // namespace brave_rewards -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_DIAGNOSTIC_LOG_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_DIAGNOSTIC_LOG_H_ diff --git a/components/brave_rewards/content/logging.h b/components/brave_rewards/content/logging.h new file mode 100644 index 000000000000..3245244b005d --- /dev/null +++ b/components/brave_rewards/content/logging.h @@ -0,0 +1,22 @@ +/* Copyright (c) 2020 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 https://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_LOGGING_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_LOGGING_H_ + +#include + +namespace brave_rewards { + +#define BLOG(verbose_level, stream) \ + Log(__FILE__, __LINE__, verbose_level, \ + (std::ostringstream() << stream).str()); + +#define BLOG_IF(verbose_level, condition, stream) \ + !(condition) ? (void)0 : BLOG(verbose_level, stream) + +} // namespace brave_rewards + +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_LOGGING_H_ diff --git a/components/brave_rewards/browser/rewards_notification_service.cc b/components/brave_rewards/content/rewards_notification_service.cc similarity index 85% rename from components/brave_rewards/browser/rewards_notification_service.cc rename to components/brave_rewards/content/rewards_notification_service.cc index 29bb37de31b2..e654eabb0ca9 100644 --- a/components/brave_rewards/browser/rewards_notification_service.cc +++ b/components/brave_rewards/content/rewards_notification_service.cc @@ -1,11 +1,11 @@ /* 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/components/brave_rewards/browser/rewards_notification_service.h" +#include "brave/components/brave_rewards/content/rewards_notification_service.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service_observer.h" +#include "brave/components/brave_rewards/content/rewards_notification_service_observer.h" namespace brave_rewards { @@ -24,10 +24,7 @@ RewardsNotificationService::RewardsNotification::RewardsNotification( RewardsNotificationService::RewardsNotificationType type, RewardsNotificationService::RewardsNotificationTimestamp timestamp, RewardsNotificationService::RewardsNotificationArgs args) - : id_(id), - type_(type), - timestamp_(timestamp), - args_(args) {} + : id_(id), type_(type), timestamp_(timestamp), args_(args) {} RewardsNotificationService::RewardsNotification::~RewardsNotification() = default; diff --git a/components/brave_rewards/browser/rewards_notification_service.h b/components/brave_rewards/content/rewards_notification_service.h similarity index 91% rename from components/brave_rewards/browser/rewards_notification_service.h rename to components/brave_rewards/content/rewards_notification_service.h index 14e0efd202cd..57d4359c1ff5 100644 --- a/components/brave_rewards/browser/rewards_notification_service.h +++ b/components/brave_rewards/content/rewards_notification_service.h @@ -1,10 +1,10 @@ /* 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/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_NOTIFICATION_SERVICE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_NOTIFICATION_SERVICE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_NOTIFICATION_SERVICE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_NOTIFICATION_SERVICE_H_ #include #include @@ -77,4 +77,4 @@ class RewardsNotificationService { } // namespace brave_rewards -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_NOTIFICATION_SERVICE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_NOTIFICATION_SERVICE_H_ diff --git a/components/brave_rewards/browser/rewards_notification_service_impl.cc b/components/brave_rewards/content/rewards_notification_service_impl.cc similarity index 93% rename from components/brave_rewards/browser/rewards_notification_service_impl.cc rename to components/brave_rewards/content/rewards_notification_service_impl.cc index 9d0922ef5254..74d23f9cecdf 100644 --- a/components/brave_rewards/browser/rewards_notification_service_impl.cc +++ b/components/brave_rewards/content/rewards_notification_service_impl.cc @@ -1,9 +1,9 @@ /* 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/components/brave_rewards/browser/rewards_notification_service_impl.h" +#include "brave/components/brave_rewards/content/rewards_notification_service_impl.h" #include #include @@ -18,7 +18,7 @@ #include "base/strings/stringprintf.h" #include "base/time/time.h" #include "base/values.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "build/build_config.h" #include "components/prefs/pref_service.h" @@ -111,8 +111,9 @@ void RewardsNotificationServiceImpl::DeleteAllNotifications( void RewardsNotificationServiceImpl::GetNotification(RewardsNotificationID id) { DCHECK(!id.empty()); - if (rewards_notifications_.find(id) == rewards_notifications_.end()) + if (rewards_notifications_.find(id) == rewards_notifications_.end()) { return; + } OnGetNotification(rewards_notifications_[id]); } @@ -142,8 +143,9 @@ RewardsNotificationServiceImpl::GenerateRewardsNotificationTimestamp() const { void RewardsNotificationServiceImpl::ReadRewardsNotificationsJSON() { std::string json = prefs_->GetString(prefs::kNotifications); - if (json.empty()) + if (json.empty()) { return; + } std::optional parsed = base::JSONReader::Read(json); // legacy read @@ -175,13 +177,15 @@ void RewardsNotificationServiceImpl::ReadRewardsNotificationsJSON() { void RewardsNotificationServiceImpl::ReadRewardsNotifications( const base::Value::List& root) { for (const auto& item : root) { - if (!item.is_dict()) + if (!item.is_dict()) { continue; + } const base::Value::Dict& dict = item.GetDict(); std::string notification_id; const std::string* notification_id_opt = dict.FindString("id"); - if (notification_id_opt) + if (notification_id_opt) { notification_id = *notification_id_opt; + } int notification_type = dict.FindInt("type").value_or(0); int notification_timestamp = dict.FindDouble("timestamp").value_or(0.0); RewardsNotificationArgs notification_args; @@ -191,10 +195,11 @@ void RewardsNotificationServiceImpl::ReadRewardsNotifications( // case where the ID contains an invalid string or integer if (notification_id.empty()) { int old_id = dict.FindInt("id").value_or(0); - if (old_id == 0 && notification_type == 2) + if (old_id == 0 && notification_type == 2) { notification_id = "rewards_notification_grant"; - else + } else { notification_id = base::NumberToString(old_id); + } } else if (notification_id == "0" && notification_type == 2) { notification_id = "rewards_notification_grant"; } @@ -207,10 +212,10 @@ void RewardsNotificationServiceImpl::ReadRewardsNotifications( } } - RewardsNotification notification(notification_id, + RewardsNotification notification( + notification_id, static_cast(notification_type), - notification_timestamp, - notification_args); + notification_timestamp, notification_args); rewards_notifications_[notification.id_] = notification; } } @@ -260,31 +265,36 @@ bool RewardsNotificationServiceImpl::Exists(RewardsNotificationID id) const { void RewardsNotificationServiceImpl::TriggerOnNotificationAdded( const RewardsNotification& rewards_notification) { - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnNotificationAdded(this, rewards_notification); + } } void RewardsNotificationServiceImpl::TriggerOnNotificationDeleted( const RewardsNotification& rewards_notification) { - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnNotificationDeleted(this, rewards_notification); + } } void RewardsNotificationServiceImpl::TriggerOnAllNotificationsDeleted() { - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnAllNotificationsDeleted(this); + } } void RewardsNotificationServiceImpl::TriggerOnGetNotification( const RewardsNotification& rewards_notification) { - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnGetNotification(this, rewards_notification); + } } void RewardsNotificationServiceImpl::TriggerOnGetAllNotifications( const RewardsNotificationsList& rewards_notifications_list) { - for (auto& observer : observers_) + for (auto& observer : observers_) { observer.OnGetAllNotifications(this, rewards_notifications_list); + } } void RewardsNotificationServiceImpl::OnNotificationAdded( @@ -335,8 +345,7 @@ void RewardsNotificationServiceImpl::OnReconcileComplete( args.push_back(base::NumberToString(amount)); AddNotification( - RewardsNotificationService::REWARDS_NOTIFICATION_AUTO_CONTRIBUTE, - args, + RewardsNotificationService::REWARDS_NOTIFICATION_AUTO_CONTRIBUTE, args, "contribution_" + contribution_id); } } diff --git a/components/brave_rewards/browser/rewards_notification_service_impl.h b/components/brave_rewards/content/rewards_notification_service_impl.h similarity index 85% rename from components/brave_rewards/browser/rewards_notification_service_impl.h rename to components/brave_rewards/content/rewards_notification_service_impl.h index 39df6b78e387..bd0d5a8c9849 100644 --- a/components/brave_rewards/browser/rewards_notification_service_impl.h +++ b/components/brave_rewards/content/rewards_notification_service_impl.h @@ -1,28 +1,26 @@ /* 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/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_NOTIFICATION_SERVICE_IMPL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_NOTIFICATION_SERVICE_IMPL_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_NOTIFICATION_SERVICE_IMPL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_NOTIFICATION_SERVICE_IMPL_H_ #include #include #include #include "base/values.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service_observer.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/content/rewards_notification_service.h" +#include "brave/components/brave_rewards/content/rewards_notification_service_observer.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" #include "extensions/buildflags/buildflags.h" class PrefService; namespace brave_rewards { -class ExtensionRewardsNotificationServiceObserver; - class RewardsNotificationServiceImpl final : public RewardsNotificationService, public RewardsServiceObserver { public: @@ -88,4 +86,4 @@ class RewardsNotificationServiceImpl final : public RewardsNotificationService, } // namespace brave_rewards -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_NOTIFICATION_SERVICE_IMPL_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_NOTIFICATION_SERVICE_IMPL_H_ diff --git a/components/brave_rewards/browser/rewards_notification_service_observer.h b/components/brave_rewards/content/rewards_notification_service_observer.h similarity index 70% rename from components/brave_rewards/browser/rewards_notification_service_observer.h rename to components/brave_rewards/content/rewards_notification_service_observer.h index 4f23d36cee39..13a453f0e8f0 100644 --- a/components/brave_rewards/browser/rewards_notification_service_observer.h +++ b/components/brave_rewards/content/rewards_notification_service_observer.h @@ -1,12 +1,13 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public +/* 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/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_NOTIFICATION_SERVICE_OBSERVER_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_NOTIFICATION_SERVICE_OBSERVER_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_NOTIFICATION_SERVICE_OBSERVER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_NOTIFICATION_SERVICE_OBSERVER_H_ #include "base/observer_list_types.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service.h" +#include "brave/components/brave_rewards/content/rewards_notification_service.h" namespace brave_rewards { @@ -35,4 +36,4 @@ class RewardsNotificationServiceObserver : public base::CheckedObserver { } // namespace brave_rewards -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_NOTIFICATION_SERVICE_OBSERVER_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_NOTIFICATION_SERVICE_OBSERVER_H_ diff --git a/components/brave_rewards/browser/rewards_p3a.cc b/components/brave_rewards/content/rewards_p3a.cc similarity index 97% rename from components/brave_rewards/browser/rewards_p3a.cc rename to components/brave_rewards/content/rewards_p3a.cc index 99fb3e523c09..06f4a7389afa 100644 --- a/components/brave_rewards/browser/rewards_p3a.cc +++ b/components/brave_rewards/content/rewards_p3a.cc @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/browser/rewards_p3a.h" +#include "brave/components/brave_rewards/content/rewards_p3a.h" #include "base/metrics/histogram_macros.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/ntp_background_images/common/pref_names.h" #include "brave/components/p3a_utils/bucket.h" #include "brave/components/time_period_storage/monthly_storage.h" diff --git a/components/brave_rewards/browser/rewards_p3a.h b/components/brave_rewards/content/rewards_p3a.h similarity index 94% rename from components/brave_rewards/browser/rewards_p3a.h rename to components/brave_rewards/content/rewards_p3a.h index 1c77ce0a4058..20fe77f90ada 100644 --- a/components/brave_rewards/browser/rewards_p3a.h +++ b/components/brave_rewards/content/rewards_p3a.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_P3A_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_P3A_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_P3A_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_P3A_H_ #include @@ -110,4 +110,4 @@ class ConversionMonitor { } // namespace p3a } // namespace brave_rewards -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_P3A_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_P3A_H_ diff --git a/components/brave_rewards/browser/rewards_protocol_navigation_throttle.cc b/components/brave_rewards/content/rewards_protocol_navigation_throttle.cc similarity index 97% rename from components/brave_rewards/browser/rewards_protocol_navigation_throttle.cc rename to components/brave_rewards/content/rewards_protocol_navigation_throttle.cc index 98a9b090124c..542855224bc1 100644 --- a/components/brave_rewards/browser/rewards_protocol_navigation_throttle.cc +++ b/components/brave_rewards/content/rewards_protocol_navigation_throttle.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/browser/rewards_protocol_navigation_throttle.h" +#include "brave/components/brave_rewards/content/rewards_protocol_navigation_throttle.h" #include #include @@ -15,7 +15,7 @@ #include "base/strings/strcat.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" -#include "brave/components/brave_rewards/core/buildflags.h" +#include "brave/components/brave_rewards/core/internal/buildflags.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/navigation_throttle.h" diff --git a/components/brave_rewards/browser/rewards_protocol_navigation_throttle.h b/components/brave_rewards/content/rewards_protocol_navigation_throttle.h similarity index 87% rename from components/brave_rewards/browser/rewards_protocol_navigation_throttle.h rename to components/brave_rewards/content/rewards_protocol_navigation_throttle.h index 3e9dafb456f7..64bbc9f8f937 100644 --- a/components/brave_rewards/browser/rewards_protocol_navigation_throttle.h +++ b/components/brave_rewards/content/rewards_protocol_navigation_throttle.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_PROTOCOL_NAVIGATION_THROTTLE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_PROTOCOL_NAVIGATION_THROTTLE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_PROTOCOL_NAVIGATION_THROTTLE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_PROTOCOL_NAVIGATION_THROTTLE_H_ #include @@ -40,4 +40,4 @@ class RewardsProtocolNavigationThrottle : public content::NavigationThrottle { } // namespace brave_rewards -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_PROTOCOL_NAVIGATION_THROTTLE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_PROTOCOL_NAVIGATION_THROTTLE_H_ diff --git a/components/brave_rewards/browser/rewards_protocol_navigation_throttle_unittest.cc b/components/brave_rewards/content/rewards_protocol_navigation_throttle_unittest.cc similarity index 100% rename from components/brave_rewards/browser/rewards_protocol_navigation_throttle_unittest.cc rename to components/brave_rewards/content/rewards_protocol_navigation_throttle_unittest.cc diff --git a/components/brave_rewards/browser/rewards_service.cc b/components/brave_rewards/content/rewards_service.cc similarity index 76% rename from components/brave_rewards/browser/rewards_service.cc rename to components/brave_rewards/content/rewards_service.cc index 3ec12be66dca..3c71cbb8652f 100644 --- a/components/brave_rewards/browser/rewards_service.cc +++ b/components/brave_rewards/content/rewards_service.cc @@ -1,11 +1,11 @@ /* 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/components/brave_rewards/browser/rewards_service.h" +#include "brave/components/brave_rewards/content/rewards_service.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" namespace brave_rewards { diff --git a/components/brave_rewards/browser/rewards_service.h b/components/brave_rewards/content/rewards_service.h similarity index 86% rename from components/brave_rewards/browser/rewards_service.h rename to components/brave_rewards/content/rewards_service.h index 95885320aad5..a0c2c3639bce 100644 --- a/components/brave_rewards/browser/rewards_service.h +++ b/components/brave_rewards/content/rewards_service.h @@ -1,10 +1,10 @@ /* 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/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_SERVICE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_SERVICE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_SERVICE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_SERVICE_H_ #include #include @@ -12,18 +12,14 @@ #include "base/containers/flat_map.h" #include "base/functional/callback_forward.h" #include "base/observer_list.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_engine.mojom.h" +#include "brave/components/brave_rewards/content/rewards_notification_service.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_engine.mojom.h" #include "build/build_config.h" #include "components/keyed_service/core/keyed_service.h" #include "components/sessions/core/session_id.h" #include "url/gurl.h" -namespace content { -class NavigationHandle; -} - namespace brave_rewards { namespace p3a { @@ -164,10 +160,9 @@ class RewardsService : public KeyedService { GetPublisherMinVisitsCallback callback) = 0; virtual void SetPublisherMinVisits(int visits) const = 0; - virtual void GetBalanceReport( - const uint32_t month, - const uint32_t year, - GetBalanceReportCallback callback) = 0; + virtual void GetBalanceReport(const uint32_t month, + const uint32_t year, + GetBalanceReportCallback callback) = 0; virtual void GetPublisherActivityFromVisitData( mojom::VisitDataPtr visit_data) = 0; virtual void GetPublisherActivityFromUrl( @@ -193,16 +188,14 @@ class RewardsService : public KeyedService { virtual void GetRecurringTips(GetRecurringTipsCallback callback) = 0; virtual void GetOneTimeTips(GetOneTimeTipsCallback callback) = 0; - virtual void SetPublisherExclude( - const std::string& publisher_key, - bool exclude) = 0; + virtual void SetPublisherExclude(const std::string& publisher_key, + bool exclude) = 0; virtual RewardsNotificationService* GetNotificationService() const = 0; virtual void GetRewardsInternalsInfo( GetRewardsInternalsInfoCallback callback) = 0; - virtual void RefreshPublisher( - const std::string& publisher_key, - RefreshPublisherCallback callback) = 0; + virtual void RefreshPublisher(const std::string& publisher_key, + RefreshPublisherCallback callback) = 0; void AddObserver(RewardsServiceObserver* observer); void RemoveObserver(RewardsServiceObserver* observer); @@ -219,21 +212,18 @@ class RewardsService : public KeyedService { const std::string& publisher_id, base::OnceCallback callback) = 0; - virtual void GetPublisherInfo( - const std::string& publisher_key, - GetPublisherInfoCallback callback) = 0; + virtual void GetPublisherInfo(const std::string& publisher_key, + GetPublisherInfoCallback callback) = 0; - virtual void GetPublisherPanelInfo( - const std::string& publisher_key, - GetPublisherInfoCallback callback) = 0; + virtual void GetPublisherPanelInfo(const std::string& publisher_key, + GetPublisherInfoCallback callback) = 0; virtual void SavePublisherInfo(const uint64_t window_id, mojom::PublisherInfoPtr publisher_info, SavePublisherInfoCallback callback) = 0; - virtual void GetShareURL( - const base::flat_map& args, - GetShareURLCallback callback) = 0; + virtual void GetShareURL(const base::flat_map& args, + GetShareURLCallback callback) = 0; virtual void FetchBalance(FetchBalanceCallback callback) = 0; @@ -265,20 +255,17 @@ class RewardsService : public KeyedService { const base::flat_map& args, ConnectExternalWalletCallback) = 0; - virtual void GetAllContributions( - GetAllContributionsCallback callback) = 0; + virtual void GetAllContributions(GetAllContributionsCallback callback) = 0; virtual void WriteDiagnosticLog(const std::string& file, const int line, const int verbose_level, const std::string& message) = 0; - virtual void LoadDiagnosticLog( - const int num_lines, - LoadDiagnosticLogCallback callback) = 0; + virtual void LoadDiagnosticLog(const int num_lines, + LoadDiagnosticLogCallback callback) = 0; - virtual void ClearDiagnosticLog( - ClearDiagnosticLogCallback callback) = 0; + virtual void ClearDiagnosticLog(ClearDiagnosticLogCallback callback) = 0; virtual void CompleteReset(SuccessCallback callback) = 0; @@ -298,4 +285,4 @@ class RewardsService : public KeyedService { } // namespace brave_rewards -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_SERVICE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_SERVICE_H_ diff --git a/components/brave_rewards/browser/rewards_service_impl.cc b/components/brave_rewards/content/rewards_service_impl.cc similarity index 96% rename from components/brave_rewards/browser/rewards_service_impl.cc rename to components/brave_rewards/content/rewards_service_impl.cc index 5a0b6ca98bd4..738df6f395ee 100644 --- a/components/brave_rewards/browser/rewards_service_impl.cc +++ b/components/brave_rewards/content/rewards_service_impl.cc @@ -1,9 +1,9 @@ /* 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/components/brave_rewards/browser/rewards_service_impl.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" #include @@ -33,22 +33,22 @@ #include "base/time/time.h" #include "brave/components/api_request_helper/api_request_helper.h" #include "brave/components/brave_ads/core/public/prefs/pref_names.h" -#include "brave/components/brave_rewards/browser/android_util.h" -#include "brave/components/brave_rewards/browser/diagnostic_log.h" -#include "brave/components/brave_rewards/browser/logging.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service.h" -#include "brave/components/brave_rewards/browser/rewards_notification_service_impl.h" -#include "brave/components/brave_rewards/browser/rewards_p3a.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" -#include "brave/components/brave_rewards/browser/service_sandbox_type.h" -#include "brave/components/brave_rewards/common/buildflags/buildflags.h" -#include "brave/components/brave_rewards/common/features.h" -#include "brave/components/brave_rewards/common/pref_names.h" -#include "brave/components/brave_rewards/common/publisher_utils.h" -#include "brave/components/brave_rewards/common/rewards_util.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/parameters/rewards_parameters_provider.h" -#include "brave/components/brave_rewards/core/rewards_database.h" +#include "brave/components/brave_rewards/content/android_util.h" +#include "brave/components/brave_rewards/content/diagnostic_log.h" +#include "brave/components/brave_rewards/content/logging.h" +#include "brave/components/brave_rewards/content/rewards_notification_service.h" +#include "brave/components/brave_rewards/content/rewards_notification_service_impl.h" +#include "brave/components/brave_rewards/content/rewards_p3a.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" +#include "brave/components/brave_rewards/content/service_sandbox_type.h" +#include "brave/components/brave_rewards/core/buildflags/buildflags.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/internal/parameters/rewards_parameters_provider.h" +#include "brave/components/brave_rewards/core/internal/rewards_database.h" +#include "brave/components/brave_rewards/core/pref_names.h" +#include "brave/components/brave_rewards/core/publisher_utils.h" +#include "brave/components/brave_rewards/core/rewards_util.h" #include "brave/components/brave_wallet/browser/brave_wallet_service.h" #include "brave/components/brave_wallet/browser/json_rpc_service.h" #include "brave/components/ntp_background_images/common/pref_names.h" @@ -157,8 +157,8 @@ std::string LoadOnFileTaskRunner(const base::FilePath& path) { net::NetworkTrafficAnnotationTag GetNetworkTrafficAnnotationTagForFaviconFetch() { - return net::DefineNetworkTrafficAnnotation( - "brave_rewards_favicon_fetcher", R"( + return net::DefineNetworkTrafficAnnotation("brave_rewards_favicon_fetcher", + R"( semantics { sender: "Brave Rewards Media Fetcher" @@ -808,14 +808,11 @@ void RewardsServiceImpl::OnReconcileComplete( RecordBackendP3AStats(); } - for (auto& observer : observers_) - observer.OnReconcileComplete( - this, - result, - contribution->contribution_id, - contribution->amount, - contribution->type, - contribution->processor); + for (auto& observer : observers_) { + observer.OnReconcileComplete(this, result, contribution->contribution_id, + contribution->amount, contribution->type, + contribution->processor); + } } void RewardsServiceImpl::LoadLegacyState(LoadLegacyStateCallback callback) { @@ -887,12 +884,9 @@ void RewardsServiceImpl::LoadURL(mojom::UrlRequestPtr request, std::string test_response; base::flat_map test_headers; int response_status_code = net::HTTP_OK; - test_response_callback_.Run( - request->url, - static_cast(request->method), - &response_status_code, - &test_response, - &test_headers); + test_response_callback_.Run(request->url, static_cast(request->method), + &response_status_code, &test_response, + &test_headers); auto response = mojom::UrlResponse::New(); response->url = request->url; @@ -913,9 +907,8 @@ void RewardsServiceImpl::LoadURL(mojom::UrlRequestPtr request, net_request->credentials_mode = network::mojom::CredentialsMode::kInclude; #if BUILDFLAG(IS_ANDROID) - net_request->headers.SetHeader( - net::HttpRequestHeaders::kUserAgent, - "DESKTOP"); + net_request->headers.SetHeader(net::HttpRequestHeaders::kUserAgent, + "DESKTOP"); #endif } else { @@ -1349,10 +1342,9 @@ void RewardsServiceImpl::OnGetBalanceReport( std::move(callback).Run(result, std::move(report)); } -void RewardsServiceImpl::GetBalanceReport( - const uint32_t month, - const uint32_t year, - GetBalanceReportCallback callback) { +void RewardsServiceImpl::GetBalanceReport(const uint32_t month, + const uint32_t year, + GetBalanceReportCallback callback) { if (!Connected() || month < 1 || month > 12) { return DeferCallback(FROM_HERE, std::move(callback), mojom::Result::FAILED, nullptr); @@ -1568,9 +1560,8 @@ void RewardsServiceImpl::IsPublisherRegistered( engine_->IsPublisherRegistered(publisher_id, std::move(callback)); } -void RewardsServiceImpl::GetPublisherInfo( - const std::string& publisher_key, - GetPublisherInfoCallback callback) { +void RewardsServiceImpl::GetPublisherInfo(const std::string& publisher_key, + GetPublisherInfoCallback callback) { if (!Connected()) { return DeferCallback(FROM_HERE, std::move(callback), mojom::Result::FAILED, nullptr); @@ -1602,8 +1593,7 @@ void RewardsServiceImpl::SavePublisherInfo( std::move(callback)); } -void RewardsServiceImpl::GetRecurringTips( - GetRecurringTipsCallback callback) { +void RewardsServiceImpl::GetRecurringTips(GetRecurringTipsCallback callback) { if (!Connected()) { return DeferCallback(FROM_HERE, std::move(callback), std::vector()); @@ -1628,8 +1618,7 @@ void RewardsServiceImpl::OnRecurringTip(const mojom::Result result) { } } -void RewardsServiceImpl::RemoveRecurringTip( - const std::string& publisher_key) { +void RewardsServiceImpl::RemoveRecurringTip(const std::string& publisher_key) { if (!Connected()) { return; } @@ -1651,9 +1640,8 @@ void RewardsServiceImpl::OnSetPublisherExclude(const std::string& publisher_key, } } -void RewardsServiceImpl::SetPublisherExclude( - const std::string& publisher_key, - bool exclude) { +void RewardsServiceImpl::SetPublisherExclude(const std::string& publisher_key, + bool exclude) { if (!Connected()) { return; } @@ -1700,9 +1688,8 @@ void RewardsServiceImpl::OnDiagnosticLogWritten(const bool success) { DCHECK(success); } -void RewardsServiceImpl::LoadDiagnosticLog( - const int num_lines, - LoadDiagnosticLogCallback callback) { +void RewardsServiceImpl::LoadDiagnosticLog(const int num_lines, + LoadDiagnosticLogCallback callback) { diagnostic_log_->ReadLastNLines( num_lines, base::BindOnce(&RewardsServiceImpl::OnDiagnosticLogLoaded, AsWeakPtr(), std::move(callback))); @@ -1877,9 +1864,8 @@ void RewardsServiceImpl::OnPublisherUpdated(const std::string& publisher_id) { } } -void RewardsServiceImpl::RefreshPublisher( - const std::string& publisher_key, - RefreshPublisherCallback callback) { +void RewardsServiceImpl::RefreshPublisher(const std::string& publisher_key, + RefreshPublisherCallback callback) { if (!Connected()) { return DeferCallback(FROM_HERE, std::move(callback), mojom::PublisherStatus::NOT_VERIFIED, ""); @@ -1902,8 +1888,8 @@ RewardsServiceImpl::GetAllNotifications() { } void RewardsServiceImpl::GetShareURL( - const base::flat_map& args, - GetShareURLCallback callback) { + const base::flat_map& args, + GetShareURLCallback callback) { if (!Connected()) { return DeferCallback(FROM_HERE, std::move(callback), ""); } @@ -2343,8 +2329,9 @@ bool RewardsServiceImpl::IsBitFlyerCountry() const { bool RewardsServiceImpl::IsValidWalletType( const std::string& wallet_type) const { for (auto& provider : GetExternalWalletProviders()) { - if (wallet_type == provider) + if (wallet_type == provider) { return true; + } } return false; } diff --git a/components/brave_rewards/browser/rewards_service_impl.h b/components/brave_rewards/content/rewards_service_impl.h similarity index 93% rename from components/brave_rewards/browser/rewards_service_impl.h rename to components/brave_rewards/content/rewards_service_impl.h index e6fd96825af5..3ff44f634152 100644 --- a/components/brave_rewards/browser/rewards_service_impl.h +++ b/components/brave_rewards/content/rewards_service_impl.h @@ -1,10 +1,10 @@ /* 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/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_SERVICE_IMPL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_SERVICE_IMPL_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_SERVICE_IMPL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_SERVICE_IMPL_H_ #include #include @@ -23,11 +23,11 @@ #include "base/time/time.h" #include "base/timer/wall_clock_timer.h" #include "base/values.h" -#include "brave/components/brave_rewards/browser/diagnostic_log.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/mojom/rewards_engine.mojom.h" -#include "brave/components/brave_rewards/common/rewards_flags.h" +#include "brave/components/brave_rewards/content/diagnostic_log.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/mojom/rewards_engine.mojom.h" +#include "brave/components/brave_rewards/core/rewards_flags.h" #include "brave/components/brave_wallet/browser/brave_wallet_service.h" #include "brave/components/brave_wallet/common/brave_wallet.mojom.h" #include "brave/components/services/bat_rewards/public/interfaces/rewards_engine_factory.mojom.h" @@ -68,7 +68,6 @@ class RewardsDatabase; } // namespace internal class RewardsNotificationServiceImpl; -class RewardsBrowserTest; using GetDebugCallback = base::OnceCallback; using GetReconcileIntervalCallback = base::OnceCallback; @@ -158,10 +157,9 @@ class RewardsServiceImpl final : public RewardsService, GetPublisherMinVisitTimeCallback callback) override; void GetPublisherMinVisits(GetPublisherMinVisitsCallback callback) override; void RestorePublishers() override; - void GetBalanceReport( - const uint32_t month, - const uint32_t year, - GetBalanceReportCallback callback) override; + void GetBalanceReport(const uint32_t month, + const uint32_t year, + GetBalanceReportCallback callback) override; void GetPublisherActivityFromVisitData( mojom::VisitDataPtr visit_data) override; void GetPublisherActivityFromUrl(uint64_t tab_id, @@ -174,9 +172,8 @@ class RewardsServiceImpl final : public RewardsService, mojom::PublisherBannerPtr banner); void RemoveRecurringTip(const std::string& publisher_key) override; void GetRecurringTips(GetRecurringTipsCallback callback) override; - void SetPublisherExclude( - const std::string& publisher_key, - bool exclude) override; + void SetPublisherExclude(const std::string& publisher_key, + bool exclude) override; RewardsNotificationService* GetNotificationService() const override; void GetRewardsInternalsInfo( @@ -204,26 +201,23 @@ class RewardsServiceImpl final : public RewardsService, base::OnceCallback callback) override; const RewardsNotificationService::RewardsNotificationsMap& - GetAllNotifications() override; + GetAllNotifications() override; void IsPublisherRegistered(const std::string& publisher_id, base::OnceCallback callback) override; - void GetPublisherInfo( - const std::string& publisher_key, - GetPublisherInfoCallback callback) override; + void GetPublisherInfo(const std::string& publisher_key, + GetPublisherInfoCallback callback) override; - void GetPublisherPanelInfo( - const std::string& publisher_key, - GetPublisherInfoCallback callback) override; + void GetPublisherPanelInfo(const std::string& publisher_key, + GetPublisherInfoCallback callback) override; void SavePublisherInfo(const uint64_t window_id, mojom::PublisherInfoPtr publisher_info, SavePublisherInfoCallback callback) override; - void GetShareURL( - const base::flat_map& args, - GetShareURLCallback callback) override; + void GetShareURL(const base::flat_map& args, + GetShareURLCallback callback) override; void OnTip(const std::string& publisher_key, double amount, @@ -373,9 +367,8 @@ class RewardsServiceImpl final : public RewardsService, void OnDiagnosticLogWritten(const bool success); - void LoadDiagnosticLog( - const int num_lines, - LoadDiagnosticLogCallback callback) override; + void LoadDiagnosticLog(const int num_lines, + LoadDiagnosticLogCallback callback) override; void OnDiagnosticLogLoaded(LoadDiagnosticLogCallback callback, const std::string& value); @@ -509,7 +502,7 @@ class RewardsServiceImpl final : public RewardsService, mojom::Environment GetDefaultServerEnvironmentForAndroid(); safetynet_check::SafetyNetCheckRunner safetynet_check_runner_; #endif - raw_ptr prefs_; // NOT OWNED + raw_ptr prefs_; // NOT OWNED raw_ptr favicon_service_; const RequestImageCallback request_image_callback_; const CancelImageRequestCallback cancel_image_request_callback_; @@ -553,4 +546,4 @@ class RewardsServiceImpl final : public RewardsService, } // namespace brave_rewards -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_SERVICE_IMPL_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_SERVICE_IMPL_H_ diff --git a/components/brave_rewards/browser/rewards_service_impl_jp_unittest.cc b/components/brave_rewards/content/rewards_service_impl_jp_unittest.cc similarity index 89% rename from components/brave_rewards/browser/rewards_service_impl_jp_unittest.cc rename to components/brave_rewards/content/rewards_service_impl_jp_unittest.cc index 5d4b823ca9a7..9ea34b5f3f70 100644 --- a/components/brave_rewards/browser/rewards_service_impl_jp_unittest.cc +++ b/components/brave_rewards/content/rewards_service_impl_jp_unittest.cc @@ -1,15 +1,15 @@ /* 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 "base/files/scoped_temp_dir.h" #include "base/test/scoped_feature_list.h" -#include "brave/components/brave_rewards/browser/rewards_service_impl.h" -#include "brave/components/brave_rewards/browser/test_util.h" -#include "brave/components/brave_rewards/common/features.h" -#include "brave/components/brave_rewards/common/pref_names.h" -#include "brave/components/brave_rewards/core/global_constants.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" +#include "brave/components/brave_rewards/content/test_util.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/l10n/common/test/scoped_default_locale.h" #include "chrome/browser/profiles/profile.h" #include "chrome/test/base/testing_browser_process.h" @@ -43,8 +43,7 @@ class RewardsServiceJPTest : public testing::Test { const GURL& url, base::OnceCallback, const net::NetworkTrafficAnnotationTag& traffic_annotation)>(), base::RepeatingCallback(), - profile()->GetDefaultStoragePartition(), - nullptr); + profile()->GetDefaultStoragePartition(), nullptr); ASSERT_TRUE(rewards_service()); profile()->GetPrefs()->SetString(prefs::kDeclaredGeo, "JP"); diff --git a/components/brave_rewards/browser/rewards_service_impl_unittest.cc b/components/brave_rewards/content/rewards_service_impl_unittest.cc similarity index 89% rename from components/brave_rewards/browser/rewards_service_impl_unittest.cc rename to components/brave_rewards/content/rewards_service_impl_unittest.cc index 9cf26617b9c9..7d7e2a358ece 100644 --- a/components/brave_rewards/browser/rewards_service_impl_unittest.cc +++ b/components/brave_rewards/content/rewards_service_impl_unittest.cc @@ -1,20 +1,20 @@ /* 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/components/brave_rewards/browser/rewards_service_impl.h" +#include "brave/components/brave_rewards/content/rewards_service_impl.h" #include #include "base/files/scoped_temp_dir.h" #include "base/test/scoped_feature_list.h" -#include "brave/components/brave_rewards/browser/rewards_service_observer.h" -#include "brave/components/brave_rewards/browser/test_util.h" -#include "brave/components/brave_rewards/common/features.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/pref_names.h" -#include "brave/components/brave_rewards/core/global_constants.h" +#include "brave/components/brave_rewards/content/rewards_service_observer.h" +#include "brave/components/brave_rewards/content/test_util.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/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/l10n/common/test/scoped_default_locale.h" #include "chrome/browser/profiles/profile.h" #include "chrome/test/base/testing_browser_process.h" @@ -70,8 +70,7 @@ class RewardsServiceTest : public testing::Test { const GURL& url, base::OnceCallback, const net::NetworkTrafficAnnotationTag& traffic_annotation)>(), base::RepeatingCallback(), - profile()->GetDefaultStoragePartition(), - nullptr); + profile()->GetDefaultStoragePartition(), nullptr); ASSERT_TRUE(rewards_service()); observer_ = std::make_unique(); rewards_service_->AddObserver(observer_.get()); diff --git a/components/brave_rewards/browser/rewards_service_observer.h b/components/brave_rewards/content/rewards_service_observer.h similarity index 81% rename from components/brave_rewards/browser/rewards_service_observer.h rename to components/brave_rewards/content/rewards_service_observer.h index a1192a605879..5c7b0e7a0774 100644 --- a/components/brave_rewards/browser/rewards_service_observer.h +++ b/components/brave_rewards/content/rewards_service_observer.h @@ -1,17 +1,17 @@ /* 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/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_SERVICE_OBSERVER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_SERVICE_OBSERVER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_SERVICE_OBSERVER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_SERVICE_OBSERVER_H_ #include #include #include #include "base/observer_list_types.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards { @@ -21,8 +21,7 @@ class RewardsServiceObserver : public base::CheckedObserver { public: ~RewardsServiceObserver() override {} - virtual void OnRewardsInitialized( - RewardsService* rewards_service) {} + virtual void OnRewardsInitialized(RewardsService* rewards_service) {} // Called when the user's Rewards wallet information has been created or // updated. @@ -32,10 +31,9 @@ class RewardsServiceObserver : public base::CheckedObserver { // service. virtual void OnTermsOfServiceUpdateAccepted() {} - virtual void OnExcludedSitesChanged( - RewardsService* rewards_service, - std::string publisher_id, - bool excluded) {} + virtual void OnExcludedSitesChanged(RewardsService* rewards_service, + std::string publisher_id, + bool excluded) {} virtual void OnReconcileComplete( RewardsService* rewards_service, @@ -88,4 +86,4 @@ class RewardsServiceObserver : public base::CheckedObserver { } // namespace brave_rewards -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_REWARDS_SERVICE_OBSERVER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_REWARDS_SERVICE_OBSERVER_H_ diff --git a/components/brave_rewards/browser/service_sandbox_type.h b/components/brave_rewards/content/service_sandbox_type.h similarity index 79% rename from components/brave_rewards/browser/service_sandbox_type.h rename to components/brave_rewards/content/service_sandbox_type.h index 9e95f0cb5719..832735a6bb50 100644 --- a/components/brave_rewards/browser/service_sandbox_type.h +++ b/components/brave_rewards/content/service_sandbox_type.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_SERVICE_SANDBOX_TYPE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_SERVICE_SANDBOX_TYPE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_SERVICE_SANDBOX_TYPE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_SERVICE_SANDBOX_TYPE_H_ #include "build/build_config.h" #include "content/public/browser/service_process_host.h" @@ -23,4 +23,4 @@ content::GetServiceSandboxType() { #endif // !BUILDFLAG(IS_ANDROID) } -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_BROWSER_SERVICE_SANDBOX_TYPE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_SERVICE_SANDBOX_TYPE_H_ diff --git a/components/brave_rewards/browser/test_util.cc b/components/brave_rewards/content/test_util.cc similarity index 95% rename from components/brave_rewards/browser/test_util.cc rename to components/brave_rewards/content/test_util.cc index 3df413288843..9e6921978c7f 100644 --- a/components/brave_rewards/browser/test_util.cc +++ b/components/brave_rewards/content/test_util.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/browser/test_util.h" +#include "brave/components/brave_rewards/content/test_util.h" #include diff --git a/components/brave_rewards/content/test_util.h b/components/brave_rewards/content/test_util.h new file mode 100644 index 000000000000..dea981a1e623 --- /dev/null +++ b/components/brave_rewards/content/test_util.h @@ -0,0 +1,21 @@ +/* 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 https://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_TEST_UTIL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_TEST_UTIL_H_ + +#include + +#include "base/files/file_path.h" + +class Profile; + +namespace brave_rewards { + +std::unique_ptr CreateBraveRewardsProfile(const base::FilePath& path); + +} // namespace brave_rewards + +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CONTENT_TEST_UTIL_H_ diff --git a/components/brave_rewards/core/BUILD.gn b/components/brave_rewards/core/BUILD.gn index 91d41bb2c0ce..4279a5e55176 100644 --- a/components/brave_rewards/core/BUILD.gn +++ b/components/brave_rewards/core/BUILD.gn @@ -1,489 +1,51 @@ -# Copyright (c) 2019 The Brave Authors. All rights reserved. +# Copyright (c) 2023 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 https://mozilla.org/MPL/2.0/. -import("//third_party/protobuf/proto_library.gni") - -import("//brave/components/brave_rewards/core/config.gni") -import("//build/buildflag_header.gni") - -if (is_android) { - import("//build/config/android/rules.gni") -} - -buildflag_header("buildflags") { - header_dir = "brave/components/brave_rewards/core" - header = "buildflags.h" - flags = [ - "BITFLYER_PRODUCTION_CLIENT_ID=\"$bitflyer_production_client_id\"", - "BITFLYER_PRODUCTION_CLIENT_SECRET=\"$bitflyer_production_client_secret\"", - "BITFLYER_PRODUCTION_FEE_ADDRESS=\"$bitflyer_production_fee_address\"", - "BITFLYER_PRODUCTION_URL=\"$bitflyer_production_url\"", - "BITFLYER_SANDBOX_CLIENT_ID=\"$bitflyer_sandbox_client_id\"", - "BITFLYER_SANDBOX_CLIENT_SECRET=\"$bitflyer_sandbox_client_secret\"", - "BITFLYER_SANDBOX_FEE_ADDRESS=\"$bitflyer_sandbox_fee_address\"", - "BITFLYER_SANDBOX_URL=\"$bitflyer_sandbox_url\"", - "GEMINI_PRODUCTION_API_URL=\"$gemini_production_api_url\"", - "GEMINI_PRODUCTION_CLIENT_ID=\"$gemini_production_client_id\"", - "GEMINI_PRODUCTION_CLIENT_SECRET=\"$gemini_production_client_secret\"", - "GEMINI_PRODUCTION_FEE_ADDRESS=\"$gemini_production_fee_address\"", - "GEMINI_PRODUCTION_OAUTH_URL=\"$gemini_production_oauth_url\"", - "GEMINI_SANDBOX_API_URL=\"$gemini_sandbox_api_url\"", - "GEMINI_SANDBOX_CLIENT_ID=\"$gemini_sandbox_client_id\"", - "GEMINI_SANDBOX_CLIENT_SECRET=\"$gemini_sandbox_client_secret\"", - "GEMINI_SANDBOX_FEE_ADDRESS=\"$gemini_sandbox_fee_address\"", - "GEMINI_SANDBOX_OAUTH_URL=\"$gemini_sandbox_oauth_url\"", - "REWARDS_GRANT_DEV_ENDPOINT=\"$rewards_grant_dev_endpoint\"", - "REWARDS_GRANT_STAGING_ENDPOINT=\"$rewards_grant_staging_endpoint\"", - "REWARDS_GRANT_PROD_ENDPOINT=\"$rewards_grant_prod_endpoint\"", - "UPHOLD_PRODUCTION_API_URL=\"$uphold_production_api_url\"", - "UPHOLD_PRODUCTION_CLIENT_ID=\"$uphold_production_client_id\"", - "UPHOLD_PRODUCTION_CLIENT_SECRET=\"$uphold_production_client_secret\"", - "UPHOLD_PRODUCTION_FEE_ADDRESS=\"$uphold_production_fee_address\"", - "UPHOLD_PRODUCTION_OAUTH_URL=\"$uphold_production_oauth_url\"", - "UPHOLD_SANDBOX_API_URL=\"$uphold_sandbox_api_url\"", - "UPHOLD_SANDBOX_CLIENT_ID=\"$uphold_sandbox_client_id\"", - "UPHOLD_SANDBOX_CLIENT_SECRET=\"$uphold_sandbox_client_secret\"", - "UPHOLD_SANDBOX_FEE_ADDRESS=\"$uphold_sandbox_fee_address\"", - "UPHOLD_SANDBOX_OAUTH_URL=\"$uphold_sandbox_oauth_url\"", - "ZEBPAY_PRODUCTION_API_URL=\"$zebpay_production_api_url\"", - "ZEBPAY_PRODUCTION_CLIENT_ID=\"$zebpay_production_client_id\"", - "ZEBPAY_PRODUCTION_CLIENT_SECRET=\"$zebpay_production_client_secret\"", - "ZEBPAY_PRODUCTION_OAUTH_URL=\"$zebpay_production_oauth_url\"", - "ZEBPAY_SANDBOX_API_URL=\"$zebpay_sandbox_api_url\"", - "ZEBPAY_SANDBOX_CLIENT_ID=\"$zebpay_sandbox_client_id\"", - "ZEBPAY_SANDBOX_CLIENT_SECRET=\"$zebpay_sandbox_client_secret\"", - "ZEBPAY_SANDBOX_OAUTH_URL=\"$zebpay_sandbox_oauth_url\"", - ] -} - -group("core") { - public_deps = [ ":engine" ] -} - -source_set("headers") { - visibility = [ - ":*", - "//brave/browser/extensions:extensions", - "//brave/browser/ui:ui", - "//brave/components/brave_rewards/browser:browser", - "//brave/components/brave_rewards/browser:testutil", - "//brave/vendor/brave-ios:rewards_db", - "//chrome/browser:browser", - ] - +source_set("features") { sources = [ - "global_constants.h", - "rewards_callbacks.h", - "rewards_database.cc", - "rewards_database.h", + "features.cc", + "features.h", ] - deps = [ "//sql:sql" ] - - public_deps = [ - ":buildflags", - "//brave/components/brave_rewards/common/mojom", - "//brave/components/brave_rewards/common/mojom:engine", - ] -} - -proto_library("publishers_proto") { - sources = [ - "publisher/protos/channel_response.proto", - "publisher/protos/publisher_prefix_list.proto", + deps = [ + "//base", + "//brave/components/brave_rewards/core/buildflags:buildflags", ] } -static_library("engine") { - visibility = [ ":*" ] - - output_name = "brave_rewards_core" - +static_library("core") { sources = [ - "bitflyer/bitflyer.cc", - "bitflyer/bitflyer.h", - "common/brotli_util.cc", - "common/brotli_util.h", - "common/callback_helpers.h", - "common/environment_config.cc", - "common/environment_config.h", - "common/random_util.cc", - "common/random_util.h", - "common/request_signer.cc", - "common/request_signer.h", - "common/signer.cc", - "common/signer.h", - "common/time_util.cc", - "common/time_util.h", - "common/url_helpers.h", - "common/url_loader.cc", - "common/url_loader.h", - "constants.h", - "contribution/contribution.cc", - "contribution/contribution.h", - "contribution/contribution_external_wallet.cc", - "contribution/contribution_external_wallet.h", - "contribution/contribution_monthly.cc", - "contribution/contribution_monthly.h", - "contribution/contribution_tip.cc", - "contribution/contribution_tip.h", - "contribution/contribution_util.cc", - "contribution/contribution_util.h", - "credentials/credentials.h", - "credentials/credentials_common.cc", - "credentials/credentials_common.h", - "credentials/credentials_redeem.cc", - "credentials/credentials_redeem.h", - "credentials/credentials_trigger.cc", - "credentials/credentials_trigger.h", - "credentials/credentials_util.cc", - "credentials/credentials_util.h", - "database/database.cc", - "database/database.h", - "database/database_activity_info.cc", - "database/database_activity_info.h", - "database/database_balance_report.cc", - "database/database_balance_report.h", - "database/database_contribution_info.cc", - "database/database_contribution_info.h", - "database/database_contribution_info_publishers.cc", - "database/database_contribution_info_publishers.h", - "database/database_contribution_queue.cc", - "database/database_contribution_queue.h", - "database/database_contribution_queue_publishers.cc", - "database/database_contribution_queue_publishers.h", - "database/database_creds_batch.cc", - "database/database_creds_batch.h", - "database/database_event_log.cc", - "database/database_event_log.h", - "database/database_external_transactions.cc", - "database/database_external_transactions.h", - "database/database_initialize.cc", - "database/database_initialize.h", - "database/database_media_publisher_info.cc", - "database/database_media_publisher_info.h", - "database/database_migration.cc", - "database/database_migration.h", - "database/database_publisher_info.cc", - "database/database_publisher_info.h", - "database/database_publisher_prefix_list.cc", - "database/database_publisher_prefix_list.h", - "database/database_recurring_tip.cc", - "database/database_recurring_tip.h", - "database/database_server_publisher_banner.cc", - "database/database_server_publisher_banner.h", - "database/database_server_publisher_info.cc", - "database/database_server_publisher_info.h", - "database/database_server_publisher_links.cc", - "database/database_server_publisher_links.h", - "database/database_sku_order.cc", - "database/database_sku_order.h", - "database/database_sku_order_items.cc", - "database/database_sku_order_items.h", - "database/database_sku_transaction.cc", - "database/database_sku_transaction.h", - "database/database_table.cc", - "database/database_table.h", - "database/database_unblinded_token.cc", - "database/database_unblinded_token.h", - "database/database_util.cc", - "database/database_util.h", - "database/migration/migration_v1.h", - "database/migration/migration_v10.h", - "database/migration/migration_v11.h", - "database/migration/migration_v12.h", - "database/migration/migration_v13.h", - "database/migration/migration_v14.h", - "database/migration/migration_v15.h", - "database/migration/migration_v16.h", - "database/migration/migration_v17.h", - "database/migration/migration_v18.h", - "database/migration/migration_v19.h", - "database/migration/migration_v2.h", - "database/migration/migration_v20.h", - "database/migration/migration_v21.h", - "database/migration/migration_v22.h", - "database/migration/migration_v23.h", - "database/migration/migration_v24.h", - "database/migration/migration_v25.h", - "database/migration/migration_v26.h", - "database/migration/migration_v27.h", - "database/migration/migration_v28.h", - "database/migration/migration_v29.h", - "database/migration/migration_v3.h", - "database/migration/migration_v30.h", - "database/migration/migration_v31.h", - "database/migration/migration_v32.h", - "database/migration/migration_v33.h", - "database/migration/migration_v34.h", - "database/migration/migration_v35.h", - "database/migration/migration_v36.h", - "database/migration/migration_v37.h", - "database/migration/migration_v38.h", - "database/migration/migration_v39.h", - "database/migration/migration_v4.h", - "database/migration/migration_v40.h", - "database/migration/migration_v5.h", - "database/migration/migration_v6.h", - "database/migration/migration_v7.h", - "database/migration/migration_v8.h", - "database/migration/migration_v9.h", - "endpoint/bitflyer/bitflyer_server.cc", - "endpoint/bitflyer/bitflyer_server.h", - "endpoint/bitflyer/get_balance/get_balance_bitflyer.cc", - "endpoint/bitflyer/get_balance/get_balance_bitflyer.h", - "endpoint/bitflyer/post_oauth/post_oauth_bitflyer.cc", - "endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h", - "endpoint/gemini/gemini_server.cc", - "endpoint/gemini/gemini_server.h", - "endpoint/gemini/post_account/post_account_gemini.cc", - "endpoint/gemini/post_account/post_account_gemini.h", - "endpoint/gemini/post_balance/post_balance_gemini.cc", - "endpoint/gemini/post_balance/post_balance_gemini.h", - "endpoint/gemini/post_oauth/post_oauth_gemini.cc", - "endpoint/gemini/post_oauth/post_oauth_gemini.h", - "endpoint/gemini/post_recipient_id/post_recipient_id_gemini.cc", - "endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h", - "endpoint/payment/get_credentials/get_credentials.cc", - "endpoint/payment/get_credentials/get_credentials.h", - "endpoint/payment/payment_server.cc", - "endpoint/payment/payment_server.h", - "endpoint/payment/post_credentials/post_credentials.cc", - "endpoint/payment/post_credentials/post_credentials.h", - "endpoint/payment/post_order/post_order.cc", - "endpoint/payment/post_order/post_order.h", - "endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.cc", - "endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h", - "endpoint/payment/post_transaction_uphold/post_transaction_uphold.cc", - "endpoint/payment/post_transaction_uphold/post_transaction_uphold.h", - "endpoint/payment/post_votes/post_votes.cc", - "endpoint/payment/post_votes/post_votes.h", - "endpoint/private_cdn/get_publisher/get_publisher.cc", - "endpoint/private_cdn/get_publisher/get_publisher.h", - "endpoint/private_cdn/private_cdn_server.cc", - "endpoint/private_cdn/private_cdn_server.h", - "endpoint/rewards/get_prefix_list/get_prefix_list.cc", - "endpoint/rewards/get_prefix_list/get_prefix_list.h", - "endpoint/rewards/rewards_server.cc", - "endpoint/rewards/rewards_server.h", - "endpoint/uphold/get_capabilities/get_capabilities.cc", - "endpoint/uphold/get_capabilities/get_capabilities.h", - "endpoint/uphold/get_card/get_card.cc", - "endpoint/uphold/get_card/get_card.h", - "endpoint/uphold/get_cards/get_cards.cc", - "endpoint/uphold/get_cards/get_cards.h", - "endpoint/uphold/get_me/get_me.cc", - "endpoint/uphold/get_me/get_me.h", - "endpoint/uphold/patch_card/patch_card.cc", - "endpoint/uphold/patch_card/patch_card.h", - "endpoint/uphold/post_cards/post_cards.cc", - "endpoint/uphold/post_cards/post_cards.h", - "endpoint/uphold/uphold_server.cc", - "endpoint/uphold/uphold_server.h", - "endpoints/bitflyer/post_commit_transaction_bitflyer.cc", - "endpoints/bitflyer/post_commit_transaction_bitflyer.h", - "endpoints/brave/get_parameters.cc", - "endpoints/brave/get_parameters.h", - "endpoints/brave/get_ui_cards.cc", - "endpoints/brave/get_ui_cards.h", - "endpoints/brave/get_wallet.cc", - "endpoints/brave/get_wallet.h", - "endpoints/brave/patch_wallets.cc", - "endpoints/brave/patch_wallets.h", - "endpoints/brave/post_challenges.cc", - "endpoints/brave/post_challenges.h", - "endpoints/brave/post_connect_bitflyer.cc", - "endpoints/brave/post_connect_bitflyer.h", - "endpoints/brave/post_connect_gemini.cc", - "endpoints/brave/post_connect_gemini.h", - "endpoints/brave/post_connect_uphold.cc", - "endpoints/brave/post_connect_uphold.h", - "endpoints/brave/post_connect_zebpay.cc", - "endpoints/brave/post_connect_zebpay.h", - "endpoints/brave/post_wallets.cc", - "endpoints/brave/post_wallets.h", - "endpoints/common/get_transaction_status.cc", - "endpoints/common/get_transaction_status.h", - "endpoints/common/post_commit_transaction.cc", - "endpoints/common/post_commit_transaction.h", - "endpoints/common/post_connect.cc", - "endpoints/common/post_connect.h", - "endpoints/common/post_create_transaction.cc", - "endpoints/common/post_create_transaction.h", - "endpoints/gemini/get_recipient_id_gemini.cc", - "endpoints/gemini/get_recipient_id_gemini.h", - "endpoints/gemini/post_commit_transaction_gemini.cc", - "endpoints/gemini/post_commit_transaction_gemini.h", - "endpoints/request_builder.cc", - "endpoints/request_builder.h", - "endpoints/request_for.h", - "endpoints/response_handler.h", - "endpoints/result_for.h", - "endpoints/uphold/get_transaction_status_uphold.cc", - "endpoints/uphold/get_transaction_status_uphold.h", - "endpoints/uphold/post_commit_transaction_uphold.cc", - "endpoints/uphold/post_commit_transaction_uphold.h", - "endpoints/uphold/post_create_transaction_uphold.cc", - "endpoints/uphold/post_create_transaction_uphold.h", - "endpoints/uphold/post_oauth_uphold.cc", - "endpoints/uphold/post_oauth_uphold.h", - "endpoints/zebpay/get_balance_zebpay.cc", - "endpoints/zebpay/get_balance_zebpay.h", - "endpoints/zebpay/post_oauth_zebpay.cc", - "endpoints/zebpay/post_oauth_zebpay.h", - "gemini/gemini.cc", - "gemini/gemini.h", - "initialization_manager.cc", - "initialization_manager.h", - "legacy/bat_state.cc", - "legacy/bat_state.h", - "legacy/bat_util.cc", - "legacy/bat_util.h", - "legacy/client_properties.cc", - "legacy/client_properties.h", - "legacy/publisher_settings_properties.cc", - "legacy/publisher_settings_properties.h", - "legacy/publisher_state.cc", - "legacy/publisher_state.h", - "legacy/report_balance_properties.cc", - "legacy/report_balance_properties.h", - "legacy/state_writer.h", - "legacy/static_values.h", - "legacy/wallet_info_properties.cc", - "legacy/wallet_info_properties.h", - "logging/event_log_keys.h", - "logging/event_log_util.cc", - "logging/event_log_util.h", - "notifications/notification_keys.h", - "parameters/rewards_parameters_provider.cc", - "parameters/rewards_parameters_provider.h", - "publisher/media/helper.cc", - "publisher/media/helper.h", - "publisher/media/media.cc", - "publisher/media/media.h", - "publisher/media/youtube.cc", - "publisher/media/youtube.h", - "publisher/prefix_iterator.h", - "publisher/prefix_list_reader.cc", - "publisher/prefix_list_reader.h", - "publisher/prefix_util.cc", - "publisher/prefix_util.h", - "publisher/publisher.cc", - "publisher/publisher.h", - "publisher/publisher_prefix_list_updater.cc", - "publisher/publisher_prefix_list_updater.h", - "publisher/publisher_status_helper.cc", - "publisher/publisher_status_helper.h", - "publisher/server_publisher_fetcher.cc", - "publisher/server_publisher_fetcher.h", - "rewards_engine.cc", - "rewards_engine.h", - "rewards_engine_helper.cc", - "rewards_engine_helper.h", - "rewards_log_stream.cc", - "rewards_log_stream.h", - "state/state.cc", - "state/state.h", - "state/state_keys.h", - "state/state_migration.cc", - "state/state_migration.h", - "state/state_migration_v1.cc", - "state/state_migration_v1.h", - "state/state_migration_v10.cc", - "state/state_migration_v10.h", - "state/state_migration_v11.cc", - "state/state_migration_v11.h", - "state/state_migration_v12.cc", - "state/state_migration_v12.h", - "state/state_migration_v13.cc", - "state/state_migration_v13.h", - "state/state_migration_v14.cc", - "state/state_migration_v14.h", - "state/state_migration_v2.cc", - "state/state_migration_v2.h", - "state/state_migration_v3.cc", - "state/state_migration_v3.h", - "state/state_migration_v4.cc", - "state/state_migration_v4.h", - "state/state_migration_v5.cc", - "state/state_migration_v5.h", - "state/state_migration_v6.cc", - "state/state_migration_v6.h", - "state/state_migration_v7.cc", - "state/state_migration_v7.h", - "state/state_migration_v8.cc", - "state/state_migration_v8.h", - "state/state_migration_v9.cc", - "state/state_migration_v9.h", - "uphold/uphold.cc", - "uphold/uphold.h", - "uphold/uphold_capabilities.h", - "uphold/uphold_card.cc", - "uphold/uphold_card.h", - "uphold/uphold_user.cc", - "uphold/uphold_user.h", - "wallet/wallet.cc", - "wallet/wallet.h", - "wallet/wallet_balance.cc", - "wallet/wallet_balance.h", - "wallet/wallet_create.cc", - "wallet/wallet_create.h", - "wallet/wallet_util.cc", - "wallet/wallet_util.h", - "wallet_provider/bitflyer/bitflyer_transfer.cc", - "wallet_provider/bitflyer/bitflyer_transfer.h", - "wallet_provider/bitflyer/connect_bitflyer_wallet.cc", - "wallet_provider/bitflyer/connect_bitflyer_wallet.h", - "wallet_provider/connect_external_wallet.cc", - "wallet_provider/connect_external_wallet.h", - "wallet_provider/gemini/connect_gemini_wallet.cc", - "wallet_provider/gemini/connect_gemini_wallet.h", - "wallet_provider/gemini/gemini_transfer.cc", - "wallet_provider/gemini/gemini_transfer.h", - "wallet_provider/linkage_checker.cc", - "wallet_provider/linkage_checker.h", - "wallet_provider/solana/solana_wallet_provider.cc", - "wallet_provider/solana/solana_wallet_provider.h", - "wallet_provider/transfer.cc", - "wallet_provider/transfer.h", - "wallet_provider/uphold/connect_uphold_wallet.cc", - "wallet_provider/uphold/connect_uphold_wallet.h", - "wallet_provider/uphold/uphold_transfer.cc", - "wallet_provider/uphold/uphold_transfer.h", - "wallet_provider/wallet_provider.cc", - "wallet_provider/wallet_provider.h", - "wallet_provider/zebpay/connect_zebpay_wallet.cc", - "wallet_provider/zebpay/connect_zebpay_wallet.h", - "zebpay/zebpay.cc", - "zebpay/zebpay.h", + "pref_names.h", + "pref_registry.cc", + "pref_registry.h", + "publisher_utils.cc", + "publisher_utils.h", + "rewards_flags.cc", + "rewards_flags.h", + "rewards_util.cc", + "rewards_util.h", ] deps = [ - ":publishers_proto", + ":features", "//base", - "//brave/components/brave_private_cdn", - "//brave/components/brave_rewards/common:features", - "//brave/components/brave_rewards/common/mojom:core", - "//brave/components/challenge_bypass_ristretto", - "//brave/third_party/bip39wally-core-native:bip39wally-core", - "//brave/third_party/rapidjson", - "//brave/vendor/bat-native-tweetnacl:tweetnacl", - "//brave/vendor/brave_base", - "//crypto", - "//net:net", - "//sql:sql", - "//third_party/abseil-cpp:absl", - "//third_party/boringssl", - "//third_party/brotli:dec", - "//third_party/protobuf:protobuf_lite", - "//third_party/re2", + "//brave/components/l10n/common", + "//components/prefs", + "//net", "//url", ] +} + +source_set("unit_tests") { + testonly = true - public_deps = [ - ":buildflags", - ":headers", + sources = [ "publisher_utils_unittest.cc" ] + + deps = [ + ":core", + "//testing/gtest", + "//url", ] } diff --git a/components/brave_rewards/core/buildflags/BUILD.gn b/components/brave_rewards/core/buildflags/BUILD.gn new file mode 100644 index 000000000000..b40cd794fc5b --- /dev/null +++ b/components/brave_rewards/core/buildflags/BUILD.gn @@ -0,0 +1,12 @@ +# Copyright (c) 2025 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 https://mozilla.org/MPL/2.0/. + +import("//brave/components/brave_rewards/core/buildflags/buildflags.gni") +import("//build/buildflag_header.gni") + +buildflag_header("buildflags") { + header = "buildflags.h" + flags = [ "ENABLE_GEMINI_WALLET=$enable_gemini_wallet" ] +} diff --git a/components/brave_rewards/core/buildflags/buildflags.gni b/components/brave_rewards/core/buildflags/buildflags.gni new file mode 100644 index 000000000000..222c5fa780ff --- /dev/null +++ b/components/brave_rewards/core/buildflags/buildflags.gni @@ -0,0 +1,8 @@ +# Copyright (c) 2025 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 https://mozilla.org/MPL/2.0/. + +declare_args() { + enable_gemini_wallet = is_mac || is_linux || is_win || is_android +} diff --git a/components/brave_rewards/common/features.cc b/components/brave_rewards/core/features.cc similarity index 93% rename from components/brave_rewards/common/features.cc rename to components/brave_rewards/core/features.cc index 1b3b0c87a9c3..5a967dda1694 100644 --- a/components/brave_rewards/common/features.cc +++ b/components/brave_rewards/core/features.cc @@ -1,9 +1,9 @@ /* Copyright (c) 2021 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/components/brave_rewards/common/features.h" +#include "brave/components/brave_rewards/core/features.h" namespace brave_rewards::features { diff --git a/components/brave_rewards/common/features.h b/components/brave_rewards/core/features.h similarity index 73% rename from components/brave_rewards/common/features.h rename to components/brave_rewards/core/features.h index 27bc8059b40a..1f028a69fe44 100644 --- a/components/brave_rewards/common/features.h +++ b/components/brave_rewards/core/features.h @@ -1,13 +1,13 @@ /* Copyright (c) 2021 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/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_FEATURES_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_FEATURES_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_FEATURES_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_FEATURES_H_ #include "base/feature_list.h" -#include "brave/components/brave_rewards/common/buildflags/buildflags.h" +#include "brave/components/brave_rewards/core/buildflags/buildflags.h" #include "build/build_config.h" namespace brave_rewards::features { @@ -34,4 +34,4 @@ BASE_DECLARE_FEATURE(kPlatformCreatorDetectionFeature); } // namespace brave_rewards::features -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_FEATURES_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_FEATURES_H_ diff --git a/components/brave_rewards/core/internal/BUILD.gn b/components/brave_rewards/core/internal/BUILD.gn new file mode 100644 index 000000000000..76003b68e0fe --- /dev/null +++ b/components/brave_rewards/core/internal/BUILD.gn @@ -0,0 +1,489 @@ +# 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 https://mozilla.org/MPL/2.0/. + +import("//third_party/protobuf/proto_library.gni") + +import("//brave/components/brave_rewards/core/internal/config.gni") +import("//build/buildflag_header.gni") + +if (is_android) { + import("//build/config/android/rules.gni") +} + +buildflag_header("buildflags") { + header_dir = "brave/components/brave_rewards/core/internal" + header = "buildflags.h" + flags = [ + "BITFLYER_PRODUCTION_CLIENT_ID=\"$bitflyer_production_client_id\"", + "BITFLYER_PRODUCTION_CLIENT_SECRET=\"$bitflyer_production_client_secret\"", + "BITFLYER_PRODUCTION_FEE_ADDRESS=\"$bitflyer_production_fee_address\"", + "BITFLYER_PRODUCTION_URL=\"$bitflyer_production_url\"", + "BITFLYER_SANDBOX_CLIENT_ID=\"$bitflyer_sandbox_client_id\"", + "BITFLYER_SANDBOX_CLIENT_SECRET=\"$bitflyer_sandbox_client_secret\"", + "BITFLYER_SANDBOX_FEE_ADDRESS=\"$bitflyer_sandbox_fee_address\"", + "BITFLYER_SANDBOX_URL=\"$bitflyer_sandbox_url\"", + "GEMINI_PRODUCTION_API_URL=\"$gemini_production_api_url\"", + "GEMINI_PRODUCTION_CLIENT_ID=\"$gemini_production_client_id\"", + "GEMINI_PRODUCTION_CLIENT_SECRET=\"$gemini_production_client_secret\"", + "GEMINI_PRODUCTION_FEE_ADDRESS=\"$gemini_production_fee_address\"", + "GEMINI_PRODUCTION_OAUTH_URL=\"$gemini_production_oauth_url\"", + "GEMINI_SANDBOX_API_URL=\"$gemini_sandbox_api_url\"", + "GEMINI_SANDBOX_CLIENT_ID=\"$gemini_sandbox_client_id\"", + "GEMINI_SANDBOX_CLIENT_SECRET=\"$gemini_sandbox_client_secret\"", + "GEMINI_SANDBOX_FEE_ADDRESS=\"$gemini_sandbox_fee_address\"", + "GEMINI_SANDBOX_OAUTH_URL=\"$gemini_sandbox_oauth_url\"", + "REWARDS_GRANT_DEV_ENDPOINT=\"$rewards_grant_dev_endpoint\"", + "REWARDS_GRANT_STAGING_ENDPOINT=\"$rewards_grant_staging_endpoint\"", + "REWARDS_GRANT_PROD_ENDPOINT=\"$rewards_grant_prod_endpoint\"", + "UPHOLD_PRODUCTION_API_URL=\"$uphold_production_api_url\"", + "UPHOLD_PRODUCTION_CLIENT_ID=\"$uphold_production_client_id\"", + "UPHOLD_PRODUCTION_CLIENT_SECRET=\"$uphold_production_client_secret\"", + "UPHOLD_PRODUCTION_FEE_ADDRESS=\"$uphold_production_fee_address\"", + "UPHOLD_PRODUCTION_OAUTH_URL=\"$uphold_production_oauth_url\"", + "UPHOLD_SANDBOX_API_URL=\"$uphold_sandbox_api_url\"", + "UPHOLD_SANDBOX_CLIENT_ID=\"$uphold_sandbox_client_id\"", + "UPHOLD_SANDBOX_CLIENT_SECRET=\"$uphold_sandbox_client_secret\"", + "UPHOLD_SANDBOX_FEE_ADDRESS=\"$uphold_sandbox_fee_address\"", + "UPHOLD_SANDBOX_OAUTH_URL=\"$uphold_sandbox_oauth_url\"", + "ZEBPAY_PRODUCTION_API_URL=\"$zebpay_production_api_url\"", + "ZEBPAY_PRODUCTION_CLIENT_ID=\"$zebpay_production_client_id\"", + "ZEBPAY_PRODUCTION_CLIENT_SECRET=\"$zebpay_production_client_secret\"", + "ZEBPAY_PRODUCTION_OAUTH_URL=\"$zebpay_production_oauth_url\"", + "ZEBPAY_SANDBOX_API_URL=\"$zebpay_sandbox_api_url\"", + "ZEBPAY_SANDBOX_CLIENT_ID=\"$zebpay_sandbox_client_id\"", + "ZEBPAY_SANDBOX_CLIENT_SECRET=\"$zebpay_sandbox_client_secret\"", + "ZEBPAY_SANDBOX_OAUTH_URL=\"$zebpay_sandbox_oauth_url\"", + ] +} + +group("internal") { + public_deps = [ ":engine" ] +} + +source_set("headers") { + visibility = [ + ":*", + "//brave/browser/extensions:extensions", + "//brave/browser/ui:ui", + "//brave/components/brave_rewards/content", + "//brave/components/brave_rewards/content:testutil", + "//brave/vendor/brave-ios:rewards_db", + "//chrome/browser:browser", + ] + + sources = [ + "global_constants.h", + "rewards_callbacks.h", + "rewards_database.cc", + "rewards_database.h", + ] + + deps = [ "//sql:sql" ] + + public_deps = [ + ":buildflags", + "//brave/components/brave_rewards/core/mojom", + "//brave/components/brave_rewards/core/mojom:engine", + ] +} + +proto_library("publishers_proto") { + sources = [ + "publisher/protos/channel_response.proto", + "publisher/protos/publisher_prefix_list.proto", + ] +} + +static_library("engine") { + visibility = [ ":*" ] + + output_name = "brave_rewards_core" + + sources = [ + "bitflyer/bitflyer.cc", + "bitflyer/bitflyer.h", + "common/brotli_util.cc", + "common/brotli_util.h", + "common/callback_helpers.h", + "common/environment_config.cc", + "common/environment_config.h", + "common/random_util.cc", + "common/random_util.h", + "common/request_signer.cc", + "common/request_signer.h", + "common/signer.cc", + "common/signer.h", + "common/time_util.cc", + "common/time_util.h", + "common/url_helpers.h", + "common/url_loader.cc", + "common/url_loader.h", + "constants.h", + "contribution/contribution.cc", + "contribution/contribution.h", + "contribution/contribution_external_wallet.cc", + "contribution/contribution_external_wallet.h", + "contribution/contribution_monthly.cc", + "contribution/contribution_monthly.h", + "contribution/contribution_tip.cc", + "contribution/contribution_tip.h", + "contribution/contribution_util.cc", + "contribution/contribution_util.h", + "credentials/credentials.h", + "credentials/credentials_common.cc", + "credentials/credentials_common.h", + "credentials/credentials_redeem.cc", + "credentials/credentials_redeem.h", + "credentials/credentials_trigger.cc", + "credentials/credentials_trigger.h", + "credentials/credentials_util.cc", + "credentials/credentials_util.h", + "database/database.cc", + "database/database.h", + "database/database_activity_info.cc", + "database/database_activity_info.h", + "database/database_balance_report.cc", + "database/database_balance_report.h", + "database/database_contribution_info.cc", + "database/database_contribution_info.h", + "database/database_contribution_info_publishers.cc", + "database/database_contribution_info_publishers.h", + "database/database_contribution_queue.cc", + "database/database_contribution_queue.h", + "database/database_contribution_queue_publishers.cc", + "database/database_contribution_queue_publishers.h", + "database/database_creds_batch.cc", + "database/database_creds_batch.h", + "database/database_event_log.cc", + "database/database_event_log.h", + "database/database_external_transactions.cc", + "database/database_external_transactions.h", + "database/database_initialize.cc", + "database/database_initialize.h", + "database/database_media_publisher_info.cc", + "database/database_media_publisher_info.h", + "database/database_migration.cc", + "database/database_migration.h", + "database/database_publisher_info.cc", + "database/database_publisher_info.h", + "database/database_publisher_prefix_list.cc", + "database/database_publisher_prefix_list.h", + "database/database_recurring_tip.cc", + "database/database_recurring_tip.h", + "database/database_server_publisher_banner.cc", + "database/database_server_publisher_banner.h", + "database/database_server_publisher_info.cc", + "database/database_server_publisher_info.h", + "database/database_server_publisher_links.cc", + "database/database_server_publisher_links.h", + "database/database_sku_order.cc", + "database/database_sku_order.h", + "database/database_sku_order_items.cc", + "database/database_sku_order_items.h", + "database/database_sku_transaction.cc", + "database/database_sku_transaction.h", + "database/database_table.cc", + "database/database_table.h", + "database/database_unblinded_token.cc", + "database/database_unblinded_token.h", + "database/database_util.cc", + "database/database_util.h", + "database/migration/migration_v1.h", + "database/migration/migration_v10.h", + "database/migration/migration_v11.h", + "database/migration/migration_v12.h", + "database/migration/migration_v13.h", + "database/migration/migration_v14.h", + "database/migration/migration_v15.h", + "database/migration/migration_v16.h", + "database/migration/migration_v17.h", + "database/migration/migration_v18.h", + "database/migration/migration_v19.h", + "database/migration/migration_v2.h", + "database/migration/migration_v20.h", + "database/migration/migration_v21.h", + "database/migration/migration_v22.h", + "database/migration/migration_v23.h", + "database/migration/migration_v24.h", + "database/migration/migration_v25.h", + "database/migration/migration_v26.h", + "database/migration/migration_v27.h", + "database/migration/migration_v28.h", + "database/migration/migration_v29.h", + "database/migration/migration_v3.h", + "database/migration/migration_v30.h", + "database/migration/migration_v31.h", + "database/migration/migration_v32.h", + "database/migration/migration_v33.h", + "database/migration/migration_v34.h", + "database/migration/migration_v35.h", + "database/migration/migration_v36.h", + "database/migration/migration_v37.h", + "database/migration/migration_v38.h", + "database/migration/migration_v39.h", + "database/migration/migration_v4.h", + "database/migration/migration_v40.h", + "database/migration/migration_v5.h", + "database/migration/migration_v6.h", + "database/migration/migration_v7.h", + "database/migration/migration_v8.h", + "database/migration/migration_v9.h", + "endpoint/bitflyer/bitflyer_server.cc", + "endpoint/bitflyer/bitflyer_server.h", + "endpoint/bitflyer/get_balance/get_balance_bitflyer.cc", + "endpoint/bitflyer/get_balance/get_balance_bitflyer.h", + "endpoint/bitflyer/post_oauth/post_oauth_bitflyer.cc", + "endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h", + "endpoint/gemini/gemini_server.cc", + "endpoint/gemini/gemini_server.h", + "endpoint/gemini/post_account/post_account_gemini.cc", + "endpoint/gemini/post_account/post_account_gemini.h", + "endpoint/gemini/post_balance/post_balance_gemini.cc", + "endpoint/gemini/post_balance/post_balance_gemini.h", + "endpoint/gemini/post_oauth/post_oauth_gemini.cc", + "endpoint/gemini/post_oauth/post_oauth_gemini.h", + "endpoint/gemini/post_recipient_id/post_recipient_id_gemini.cc", + "endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h", + "endpoint/payment/get_credentials/get_credentials.cc", + "endpoint/payment/get_credentials/get_credentials.h", + "endpoint/payment/payment_server.cc", + "endpoint/payment/payment_server.h", + "endpoint/payment/post_credentials/post_credentials.cc", + "endpoint/payment/post_credentials/post_credentials.h", + "endpoint/payment/post_order/post_order.cc", + "endpoint/payment/post_order/post_order.h", + "endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.cc", + "endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h", + "endpoint/payment/post_transaction_uphold/post_transaction_uphold.cc", + "endpoint/payment/post_transaction_uphold/post_transaction_uphold.h", + "endpoint/payment/post_votes/post_votes.cc", + "endpoint/payment/post_votes/post_votes.h", + "endpoint/private_cdn/get_publisher/get_publisher.cc", + "endpoint/private_cdn/get_publisher/get_publisher.h", + "endpoint/private_cdn/private_cdn_server.cc", + "endpoint/private_cdn/private_cdn_server.h", + "endpoint/rewards/get_prefix_list/get_prefix_list.cc", + "endpoint/rewards/get_prefix_list/get_prefix_list.h", + "endpoint/rewards/rewards_server.cc", + "endpoint/rewards/rewards_server.h", + "endpoint/uphold/get_capabilities/get_capabilities.cc", + "endpoint/uphold/get_capabilities/get_capabilities.h", + "endpoint/uphold/get_card/get_card.cc", + "endpoint/uphold/get_card/get_card.h", + "endpoint/uphold/get_cards/get_cards.cc", + "endpoint/uphold/get_cards/get_cards.h", + "endpoint/uphold/get_me/get_me.cc", + "endpoint/uphold/get_me/get_me.h", + "endpoint/uphold/patch_card/patch_card.cc", + "endpoint/uphold/patch_card/patch_card.h", + "endpoint/uphold/post_cards/post_cards.cc", + "endpoint/uphold/post_cards/post_cards.h", + "endpoint/uphold/uphold_server.cc", + "endpoint/uphold/uphold_server.h", + "endpoints/bitflyer/post_commit_transaction_bitflyer.cc", + "endpoints/bitflyer/post_commit_transaction_bitflyer.h", + "endpoints/brave/get_parameters.cc", + "endpoints/brave/get_parameters.h", + "endpoints/brave/get_ui_cards.cc", + "endpoints/brave/get_ui_cards.h", + "endpoints/brave/get_wallet.cc", + "endpoints/brave/get_wallet.h", + "endpoints/brave/patch_wallets.cc", + "endpoints/brave/patch_wallets.h", + "endpoints/brave/post_challenges.cc", + "endpoints/brave/post_challenges.h", + "endpoints/brave/post_connect_bitflyer.cc", + "endpoints/brave/post_connect_bitflyer.h", + "endpoints/brave/post_connect_gemini.cc", + "endpoints/brave/post_connect_gemini.h", + "endpoints/brave/post_connect_uphold.cc", + "endpoints/brave/post_connect_uphold.h", + "endpoints/brave/post_connect_zebpay.cc", + "endpoints/brave/post_connect_zebpay.h", + "endpoints/brave/post_wallets.cc", + "endpoints/brave/post_wallets.h", + "endpoints/common/get_transaction_status.cc", + "endpoints/common/get_transaction_status.h", + "endpoints/common/post_commit_transaction.cc", + "endpoints/common/post_commit_transaction.h", + "endpoints/common/post_connect.cc", + "endpoints/common/post_connect.h", + "endpoints/common/post_create_transaction.cc", + "endpoints/common/post_create_transaction.h", + "endpoints/gemini/get_recipient_id_gemini.cc", + "endpoints/gemini/get_recipient_id_gemini.h", + "endpoints/gemini/post_commit_transaction_gemini.cc", + "endpoints/gemini/post_commit_transaction_gemini.h", + "endpoints/request_builder.cc", + "endpoints/request_builder.h", + "endpoints/request_for.h", + "endpoints/response_handler.h", + "endpoints/result_for.h", + "endpoints/uphold/get_transaction_status_uphold.cc", + "endpoints/uphold/get_transaction_status_uphold.h", + "endpoints/uphold/post_commit_transaction_uphold.cc", + "endpoints/uphold/post_commit_transaction_uphold.h", + "endpoints/uphold/post_create_transaction_uphold.cc", + "endpoints/uphold/post_create_transaction_uphold.h", + "endpoints/uphold/post_oauth_uphold.cc", + "endpoints/uphold/post_oauth_uphold.h", + "endpoints/zebpay/get_balance_zebpay.cc", + "endpoints/zebpay/get_balance_zebpay.h", + "endpoints/zebpay/post_oauth_zebpay.cc", + "endpoints/zebpay/post_oauth_zebpay.h", + "gemini/gemini.cc", + "gemini/gemini.h", + "initialization_manager.cc", + "initialization_manager.h", + "legacy/bat_state.cc", + "legacy/bat_state.h", + "legacy/bat_util.cc", + "legacy/bat_util.h", + "legacy/client_properties.cc", + "legacy/client_properties.h", + "legacy/publisher_settings_properties.cc", + "legacy/publisher_settings_properties.h", + "legacy/publisher_state.cc", + "legacy/publisher_state.h", + "legacy/report_balance_properties.cc", + "legacy/report_balance_properties.h", + "legacy/state_writer.h", + "legacy/static_values.h", + "legacy/wallet_info_properties.cc", + "legacy/wallet_info_properties.h", + "logging/event_log_keys.h", + "logging/event_log_util.cc", + "logging/event_log_util.h", + "notifications/notification_keys.h", + "parameters/rewards_parameters_provider.cc", + "parameters/rewards_parameters_provider.h", + "publisher/media/helper.cc", + "publisher/media/helper.h", + "publisher/media/media.cc", + "publisher/media/media.h", + "publisher/media/youtube.cc", + "publisher/media/youtube.h", + "publisher/prefix_iterator.h", + "publisher/prefix_list_reader.cc", + "publisher/prefix_list_reader.h", + "publisher/prefix_util.cc", + "publisher/prefix_util.h", + "publisher/publisher.cc", + "publisher/publisher.h", + "publisher/publisher_prefix_list_updater.cc", + "publisher/publisher_prefix_list_updater.h", + "publisher/publisher_status_helper.cc", + "publisher/publisher_status_helper.h", + "publisher/server_publisher_fetcher.cc", + "publisher/server_publisher_fetcher.h", + "rewards_engine.cc", + "rewards_engine.h", + "rewards_engine_helper.cc", + "rewards_engine_helper.h", + "rewards_log_stream.cc", + "rewards_log_stream.h", + "state/state.cc", + "state/state.h", + "state/state_keys.h", + "state/state_migration.cc", + "state/state_migration.h", + "state/state_migration_v1.cc", + "state/state_migration_v1.h", + "state/state_migration_v10.cc", + "state/state_migration_v10.h", + "state/state_migration_v11.cc", + "state/state_migration_v11.h", + "state/state_migration_v12.cc", + "state/state_migration_v12.h", + "state/state_migration_v13.cc", + "state/state_migration_v13.h", + "state/state_migration_v14.cc", + "state/state_migration_v14.h", + "state/state_migration_v2.cc", + "state/state_migration_v2.h", + "state/state_migration_v3.cc", + "state/state_migration_v3.h", + "state/state_migration_v4.cc", + "state/state_migration_v4.h", + "state/state_migration_v5.cc", + "state/state_migration_v5.h", + "state/state_migration_v6.cc", + "state/state_migration_v6.h", + "state/state_migration_v7.cc", + "state/state_migration_v7.h", + "state/state_migration_v8.cc", + "state/state_migration_v8.h", + "state/state_migration_v9.cc", + "state/state_migration_v9.h", + "uphold/uphold.cc", + "uphold/uphold.h", + "uphold/uphold_capabilities.h", + "uphold/uphold_card.cc", + "uphold/uphold_card.h", + "uphold/uphold_user.cc", + "uphold/uphold_user.h", + "wallet/wallet.cc", + "wallet/wallet.h", + "wallet/wallet_balance.cc", + "wallet/wallet_balance.h", + "wallet/wallet_create.cc", + "wallet/wallet_create.h", + "wallet/wallet_util.cc", + "wallet/wallet_util.h", + "wallet_provider/bitflyer/bitflyer_transfer.cc", + "wallet_provider/bitflyer/bitflyer_transfer.h", + "wallet_provider/bitflyer/connect_bitflyer_wallet.cc", + "wallet_provider/bitflyer/connect_bitflyer_wallet.h", + "wallet_provider/connect_external_wallet.cc", + "wallet_provider/connect_external_wallet.h", + "wallet_provider/gemini/connect_gemini_wallet.cc", + "wallet_provider/gemini/connect_gemini_wallet.h", + "wallet_provider/gemini/gemini_transfer.cc", + "wallet_provider/gemini/gemini_transfer.h", + "wallet_provider/linkage_checker.cc", + "wallet_provider/linkage_checker.h", + "wallet_provider/solana/solana_wallet_provider.cc", + "wallet_provider/solana/solana_wallet_provider.h", + "wallet_provider/transfer.cc", + "wallet_provider/transfer.h", + "wallet_provider/uphold/connect_uphold_wallet.cc", + "wallet_provider/uphold/connect_uphold_wallet.h", + "wallet_provider/uphold/uphold_transfer.cc", + "wallet_provider/uphold/uphold_transfer.h", + "wallet_provider/wallet_provider.cc", + "wallet_provider/wallet_provider.h", + "wallet_provider/zebpay/connect_zebpay_wallet.cc", + "wallet_provider/zebpay/connect_zebpay_wallet.h", + "zebpay/zebpay.cc", + "zebpay/zebpay.h", + ] + + deps = [ + ":publishers_proto", + "//base", + "//brave/components/brave_private_cdn", + "//brave/components/brave_rewards/core:features", + "//brave/components/brave_rewards/core/mojom:core", + "//brave/components/challenge_bypass_ristretto", + "//brave/third_party/bip39wally-core-native:bip39wally-core", + "//brave/third_party/rapidjson", + "//brave/vendor/bat-native-tweetnacl:tweetnacl", + "//brave/vendor/brave_base", + "//crypto", + "//net:net", + "//sql:sql", + "//third_party/abseil-cpp:absl", + "//third_party/boringssl", + "//third_party/brotli:dec", + "//third_party/protobuf:protobuf_lite", + "//third_party/re2", + "//url", + ] + + public_deps = [ + ":buildflags", + ":headers", + ] +} diff --git a/components/brave_rewards/core/DEPS b/components/brave_rewards/core/internal/DEPS similarity index 100% rename from components/brave_rewards/core/DEPS rename to components/brave_rewards/core/internal/DEPS diff --git a/components/brave_rewards/core/bitflyer/bitflyer.cc b/components/brave_rewards/core/internal/bitflyer/bitflyer.cc similarity index 70% rename from components/brave_rewards/core/bitflyer/bitflyer.cc rename to components/brave_rewards/core/internal/bitflyer/bitflyer.cc index b151c89387b0..e3f1c1fb7994 100644 --- a/components/brave_rewards/core/bitflyer/bitflyer.cc +++ b/components/brave_rewards/core/internal/bitflyer/bitflyer.cc @@ -3,18 +3,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/bitflyer/bitflyer.h" +#include "brave/components/brave_rewards/core/internal/bitflyer/bitflyer.h" #include #include -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/buildflags.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet_provider/bitflyer/bitflyer_transfer.h" -#include "brave/components/brave_rewards/core/wallet_provider/bitflyer/connect_bitflyer_wallet.h" +#include "brave/components/brave_rewards/core/internal/buildflags.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/bitflyer/bitflyer_transfer.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/bitflyer/connect_bitflyer_wallet.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal::bitflyer { diff --git a/components/brave_rewards/core/bitflyer/bitflyer.h b/components/brave_rewards/core/internal/bitflyer/bitflyer.h similarity index 66% rename from components/brave_rewards/core/bitflyer/bitflyer.h rename to components/brave_rewards/core/internal/bitflyer/bitflyer.h index d79918f2a716..6cd845ba274c 100644 --- a/components/brave_rewards/core/bitflyer/bitflyer.h +++ b/components/brave_rewards/core/internal/bitflyer/bitflyer.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_BITFLYER_BITFLYER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_BITFLYER_BITFLYER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_BITFLYER_BITFLYER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_BITFLYER_BITFLYER_H_ #include #include "base/functional/callback_forward.h" #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/endpoint/bitflyer/bitflyer_server.h" -#include "brave/components/brave_rewards/core/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/internal/endpoint/bitflyer/bitflyer_server.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal { class RewardsEngine; @@ -39,4 +39,4 @@ class Bitflyer final : public wallet_provider::WalletProvider { } // namespace bitflyer } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_BITFLYER_BITFLYER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_BITFLYER_BITFLYER_H_ diff --git a/components/brave_rewards/core/common/DEPS b/components/brave_rewards/core/internal/common/DEPS similarity index 100% rename from components/brave_rewards/core/common/DEPS rename to components/brave_rewards/core/internal/common/DEPS diff --git a/components/brave_rewards/core/common/brotli_util.cc b/components/brave_rewards/core/internal/common/brotli_util.cc similarity index 97% rename from components/brave_rewards/core/common/brotli_util.cc rename to components/brave_rewards/core/internal/common/brotli_util.cc index 943040cea385..3a188e00f43b 100644 --- a/components/brave_rewards/core/common/brotli_util.cc +++ b/components/brave_rewards/core/internal/common/brotli_util.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/common/brotli_util.h" +#include "brave/components/brave_rewards/core/internal/common/brotli_util.h" #include #include diff --git a/components/brave_rewards/core/common/brotli_util.h b/components/brave_rewards/core/internal/common/brotli_util.h similarity index 76% rename from components/brave_rewards/core/common/brotli_util.h rename to components/brave_rewards/core/internal/common/brotli_util.h index 57433f14bb43..36be012c0dbb 100644 --- a/components/brave_rewards/core/common/brotli_util.h +++ b/components/brave_rewards/core/internal/common/brotli_util.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_BROTLI_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_BROTLI_UTIL_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_BROTLI_UTIL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_BROTLI_UTIL_H_ #include #include @@ -23,4 +23,4 @@ bool DecodeBrotliStringWithBuffer(std::string_view input, } // namespace util } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_BROTLI_UTIL_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_BROTLI_UTIL_H_ diff --git a/components/brave_rewards/core/common/brotli_util_unittest.cc b/components/brave_rewards/core/internal/common/brotli_util_unittest.cc similarity index 96% rename from components/brave_rewards/core/common/brotli_util_unittest.cc rename to components/brave_rewards/core/internal/common/brotli_util_unittest.cc index 64a469d19c12..fa45c170399f 100644 --- a/components/brave_rewards/core/common/brotli_util_unittest.cc +++ b/components/brave_rewards/core/internal/common/brotli_util_unittest.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/common/brotli_util.h" +#include "brave/components/brave_rewards/core/internal/common/brotli_util.h" #include diff --git a/components/brave_rewards/core/common/callback_helpers.h b/components/brave_rewards/core/internal/common/callback_helpers.h similarity index 75% rename from components/brave_rewards/core/common/callback_helpers.h rename to components/brave_rewards/core/internal/common/callback_helpers.h index bb89c4f04411..99aa42e9562f 100644 --- a/components/brave_rewards/core/common/callback_helpers.h +++ b/components/brave_rewards/core/internal/common/callback_helpers.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_CALLBACK_HELPERS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_CALLBACK_HELPERS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_CALLBACK_HELPERS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_CALLBACK_HELPERS_H_ #include @@ -23,4 +23,4 @@ void DeferCallback(base::Location location, Callback callback, Args&&... args) { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_CALLBACK_HELPERS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_CALLBACK_HELPERS_H_ diff --git a/components/brave_rewards/core/common/environment_config.cc b/components/brave_rewards/core/internal/common/environment_config.cc similarity index 98% rename from components/brave_rewards/core/common/environment_config.cc rename to components/brave_rewards/core/internal/common/environment_config.cc index 6be18e7bd5eb..3daf484d7cad 100644 --- a/components/brave_rewards/core/common/environment_config.cc +++ b/components/brave_rewards/core/internal/common/environment_config.cc @@ -3,9 +3,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" -#include "brave/components/brave_rewards/core/buildflags.h" +#include "brave/components/brave_rewards/core/internal/buildflags.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/common/environment_config.h b/components/brave_rewards/core/internal/common/environment_config.h similarity index 84% rename from components/brave_rewards/core/common/environment_config.h rename to components/brave_rewards/core/internal/common/environment_config.h index c3884ca8f30a..aede19fa4dcb 100644 --- a/components/brave_rewards/core/common/environment_config.h +++ b/components/brave_rewards/core/internal/common/environment_config.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_ENVIRONMENT_CONFIG_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_ENVIRONMENT_CONFIG_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_ENVIRONMENT_CONFIG_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_ENVIRONMENT_CONFIG_H_ #include -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/rewards_engine_helper.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine_helper.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" #include "url/gurl.h" namespace brave_rewards::internal { @@ -73,4 +73,4 @@ class EnvironmentConfig : public RewardsEngineHelper, } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_ENVIRONMENT_CONFIG_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_ENVIRONMENT_CONFIG_H_ diff --git a/components/brave_rewards/core/common/random_util.cc b/components/brave_rewards/core/internal/common/random_util.cc similarity index 90% rename from components/brave_rewards/core/common/random_util.cc rename to components/brave_rewards/core/internal/common/random_util.cc index 578377e411cb..bc12cdedb139 100644 --- a/components/brave_rewards/core/common/random_util.cc +++ b/components/brave_rewards/core/internal/common/random_util.cc @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/common/random_util.h" +#include "brave/components/brave_rewards/core/internal/common/random_util.h" #include "base/base64url.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "crypto/random.h" #include "crypto/sha2.h" diff --git a/components/brave_rewards/core/common/random_util.h b/components/brave_rewards/core/internal/common/random_util.h similarity index 76% rename from components/brave_rewards/core/common/random_util.h rename to components/brave_rewards/core/internal/common/random_util.h index 03405ac94a6f..db5fad0dfac1 100644 --- a/components/brave_rewards/core/common/random_util.h +++ b/components/brave_rewards/core/internal/common/random_util.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_RANDOM_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_RANDOM_UTIL_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_RANDOM_UTIL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_RANDOM_UTIL_H_ #include @@ -25,4 +25,4 @@ std::string GeneratePKCECodeChallenge(const std::string& code_verifier); } // namespace util } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_RANDOM_UTIL_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_RANDOM_UTIL_H_ diff --git a/components/brave_rewards/core/common/request_signer.cc b/components/brave_rewards/core/internal/common/request_signer.cc similarity index 97% rename from components/brave_rewards/core/common/request_signer.cc rename to components/brave_rewards/core/internal/common/request_signer.cc index 8ccd3016ce42..64fc0016243d 100644 --- a/components/brave_rewards/core/common/request_signer.cc +++ b/components/brave_rewards/core/internal/common/request_signer.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/common/request_signer.h" +#include "brave/components/brave_rewards/core/internal/common/request_signer.h" #include "base/base64.h" #include "base/strings/strcat.h" diff --git a/components/brave_rewards/core/common/request_signer.h b/components/brave_rewards/core/internal/common/request_signer.h similarity index 84% rename from components/brave_rewards/core/common/request_signer.h rename to components/brave_rewards/core/internal/common/request_signer.h index 10a8e370b1f6..82545dac5e81 100644 --- a/components/brave_rewards/core/common/request_signer.h +++ b/components/brave_rewards/core/internal/common/request_signer.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_REQUEST_SIGNER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_REQUEST_SIGNER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_REQUEST_SIGNER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_REQUEST_SIGNER_H_ #include #include @@ -12,8 +12,8 @@ #include #include "base/containers/span.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/common/signer.h" +#include "brave/components/brave_rewards/core/internal/common/signer.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal { @@ -62,4 +62,4 @@ class RequestSigner { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_REQUEST_SIGNER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_REQUEST_SIGNER_H_ diff --git a/components/brave_rewards/core/common/request_signer_unittest.cc b/components/brave_rewards/core/internal/common/request_signer_unittest.cc similarity index 98% rename from components/brave_rewards/core/common/request_signer_unittest.cc rename to components/brave_rewards/core/internal/common/request_signer_unittest.cc index 5fa8f523cc2a..2eb87e71ec09 100644 --- a/components/brave_rewards/core/common/request_signer_unittest.cc +++ b/components/brave_rewards/core/internal/common/request_signer_unittest.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/common/request_signer.h" +#include "brave/components/brave_rewards/core/internal/common/request_signer.h" #include "base/base64.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/components/brave_rewards/core/common/signer.cc b/components/brave_rewards/core/internal/common/signer.cc similarity index 97% rename from components/brave_rewards/core/common/signer.cc rename to components/brave_rewards/core/internal/common/signer.cc index d19fbf648046..afbb129ef9d4 100644 --- a/components/brave_rewards/core/common/signer.cc +++ b/components/brave_rewards/core/internal/common/signer.cc @@ -3,10 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/common/signer.h" +#include "brave/components/brave_rewards/core/internal/common/signer.h" #include #include + #include #include "crypto/random.h" diff --git a/components/brave_rewards/core/common/signer.h b/components/brave_rewards/core/internal/common/signer.h similarity index 87% rename from components/brave_rewards/core/common/signer.h rename to components/brave_rewards/core/internal/common/signer.h index 661e6e80b7a3..6eb43e8f8fb8 100644 --- a/components/brave_rewards/core/common/signer.h +++ b/components/brave_rewards/core/internal/common/signer.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_SIGNER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_SIGNER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_SIGNER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_SIGNER_H_ #include #include @@ -46,4 +46,4 @@ class Signer { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_SIGNER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_SIGNER_H_ diff --git a/components/brave_rewards/core/common/signer_unittest.cc b/components/brave_rewards/core/internal/common/signer_unittest.cc similarity index 95% rename from components/brave_rewards/core/common/signer_unittest.cc rename to components/brave_rewards/core/internal/common/signer_unittest.cc index 10747ac64887..bddd49c3c666 100644 --- a/components/brave_rewards/core/common/signer_unittest.cc +++ b/components/brave_rewards/core/internal/common/signer_unittest.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/common/signer.h" +#include "brave/components/brave_rewards/core/internal/common/signer.h" #include "base/base64.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/components/brave_rewards/core/common/time_util.cc b/components/brave_rewards/core/internal/common/time_util.cc similarity index 95% rename from components/brave_rewards/core/common/time_util.cc rename to components/brave_rewards/core/internal/common/time_util.cc index 63714414b7c8..319adf101f38 100644 --- a/components/brave_rewards/core/common/time_util.cc +++ b/components/brave_rewards/core/internal/common/time_util.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" #include diff --git a/components/brave_rewards/core/common/time_util.h b/components/brave_rewards/core/internal/common/time_util.h similarity index 75% rename from components/brave_rewards/core/common/time_util.h rename to components/brave_rewards/core/internal/common/time_util.h index 7ea1bfda6c38..fea4013e8cd6 100644 --- a/components/brave_rewards/core/common/time_util.h +++ b/components/brave_rewards/core/internal/common/time_util.h @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_TIME_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_TIME_UTIL_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_TIME_UTIL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_TIME_UTIL_H_ #include "base/time/time.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal { namespace util { @@ -31,4 +31,4 @@ base::TimeDelta GetRandomizedDelayWithBackoff(base::TimeDelta delay, } // namespace util } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_TIME_UTIL_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_TIME_UTIL_H_ diff --git a/components/brave_rewards/core/common/url_helpers.h b/components/brave_rewards/core/internal/common/url_helpers.h similarity index 86% rename from components/brave_rewards/core/common/url_helpers.h rename to components/brave_rewards/core/internal/common/url_helpers.h index 6b5d52812cf9..7c77a45f755a 100644 --- a/components/brave_rewards/core/common/url_helpers.h +++ b/components/brave_rewards/core/internal/common/url_helpers.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_URL_HELPERS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_URL_HELPERS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_URL_HELPERS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_URL_HELPERS_H_ #include #include @@ -43,4 +43,4 @@ GURL AppendOrReplaceQueryParameters( } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_URL_HELPERS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_URL_HELPERS_H_ diff --git a/components/brave_rewards/core/common/url_loader.cc b/components/brave_rewards/core/internal/common/url_loader.cc similarity index 88% rename from components/brave_rewards/core/common/url_loader.cc rename to components/brave_rewards/core/internal/common/url_loader.cc index c0fddd271a3b..28233a656e0e 100644 --- a/components/brave_rewards/core/common/url_loader.cc +++ b/components/brave_rewards/core/internal/common/url_loader.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" #include #include #include "base/strings/string_util.h" -#include "brave/components/brave_rewards/core/common/callback_helpers.h" -#include "brave/components/brave_rewards/core/initialization_manager.h" +#include "brave/components/brave_rewards/core/internal/common/callback_helpers.h" +#include "brave/components/brave_rewards/core/internal/initialization_manager.h" namespace brave_rewards::internal { @@ -71,8 +71,8 @@ void URLLoader::LogRequest(const mojom::UrlRequest& request, auto stream = Log(FROM_HERE); - stream << "\n[ REQUEST ]" - << "\n> URL: " << request.url << "\n> Method: " << request.method; + stream << "\n[ REQUEST ]" << "\n> URL: " << request.url + << "\n> Method: " << request.method; if (log_level == LogLevel::kBasic) { return; @@ -110,8 +110,8 @@ void URLLoader::LogResponse(const mojom::UrlResponse& response, auto stream = Log(FROM_HERE); - stream << "\n[ RESPONSE ]" - << "\n> URL: " << response.url << "\n> Result: " << result + stream << "\n[ RESPONSE ]" << "\n> URL: " << response.url + << "\n> Result: " << result << "\n> HTTP Code: " << response.status_code; if (log_level == LogLevel::kBasic) { diff --git a/components/brave_rewards/core/common/url_loader.h b/components/brave_rewards/core/internal/common/url_loader.h similarity index 85% rename from components/brave_rewards/core/common/url_loader.h rename to components/brave_rewards/core/internal/common/url_loader.h index e8578edbb07a..7488c43b9b4b 100644 --- a/components/brave_rewards/core/common/url_loader.h +++ b/components/brave_rewards/core/internal/common/url_loader.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_URL_LOADER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_URL_LOADER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_URL_LOADER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_URL_LOADER_H_ #include #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/rewards_engine_helper.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine_helper.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal { @@ -67,4 +67,4 @@ class URLLoader : public RewardsEngineHelper, public WithHelperKey { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_COMMON_URL_LOADER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_COMMON_URL_LOADER_H_ diff --git a/components/brave_rewards/core/common/url_loader_unittest.cc b/components/brave_rewards/core/internal/common/url_loader_unittest.cc similarity index 88% rename from components/brave_rewards/core/common/url_loader_unittest.cc rename to components/brave_rewards/core/internal/common/url_loader_unittest.cc index f4cc84e53ad5..756293e213ec 100644 --- a/components/brave_rewards/core/common/url_loader_unittest.cc +++ b/components/brave_rewards/core/internal/common/url_loader_unittest.cc @@ -3,10 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" + #include -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" // npm run test -- brave_unit_tests --filter=RewardsURLLoaderTest.* diff --git a/components/brave_rewards/core/config.gni b/components/brave_rewards/core/internal/config.gni similarity index 100% rename from components/brave_rewards/core/config.gni rename to components/brave_rewards/core/internal/config.gni diff --git a/components/brave_rewards/core/constants.h b/components/brave_rewards/core/internal/constants.h similarity index 82% rename from components/brave_rewards/core/constants.h rename to components/brave_rewards/core/internal/constants.h index f0e52f9480f4..d13220a56e83 100644 --- a/components/brave_rewards/core/constants.h +++ b/components/brave_rewards/core/internal/constants.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONSTANTS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONSTANTS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONSTANTS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONSTANTS_H_ #include "base/time/time.h" @@ -31,4 +31,4 @@ inline constexpr int kMinVisitTime = 8; } // namespace constant } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONSTANTS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONSTANTS_H_ diff --git a/components/brave_rewards/core/contribution/contribution.cc b/components/brave_rewards/core/internal/contribution/contribution.cc similarity index 96% rename from components/brave_rewards/core/contribution/contribution.cc rename to components/brave_rewards/core/internal/contribution/contribution.cc index c124c4812221..f2b1da80aeaf 100644 --- a/components/brave_rewards/core/contribution/contribution.cc +++ b/components/brave_rewards/core/internal/contribution/contribution.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/contribution/contribution.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution.h" #include @@ -18,18 +18,18 @@ #include "base/functional/callback.h" #include "base/time/time.h" #include "base/uuid.h" -#include "brave/components/brave_rewards/core/bitflyer/bitflyer.h" -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/contribution/contribution_util.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/gemini/gemini.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/publisher/publisher_status_helper.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state.h" -#include "brave/components/brave_rewards/core/uphold/uphold.h" -#include "brave/components/brave_rewards/core/wallet/wallet.h" -#include "brave/components/brave_rewards/core/wallet/wallet_balance.h" +#include "brave/components/brave_rewards/core/internal/bitflyer/bitflyer.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution_util.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/gemini/gemini.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher_status_helper.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_balance.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/contribution/contribution.h b/components/brave_rewards/core/internal/contribution/contribution.h similarity index 87% rename from components/brave_rewards/core/contribution/contribution.h rename to components/brave_rewards/core/internal/contribution/contribution.h index b5a63364dc63..e198e3eef541 100644 --- a/components/brave_rewards/core/contribution/contribution.h +++ b/components/brave_rewards/core/internal/contribution/contribution.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_H_ #include @@ -20,12 +20,12 @@ #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "base/timer/timer.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/contribution/contribution_external_wallet.h" -#include "brave/components/brave_rewards/core/contribution/contribution_monthly.h" -#include "brave/components/brave_rewards/core/contribution/contribution_tip.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution_external_wallet.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution_monthly.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution_tip.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" namespace brave_rewards::internal { class RewardsEngine; @@ -174,4 +174,4 @@ class Contribution { } // namespace contribution } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_H_ diff --git a/components/brave_rewards/core/contribution/contribution_external_wallet.cc b/components/brave_rewards/core/internal/contribution/contribution_external_wallet.cc similarity index 89% rename from components/brave_rewards/core/contribution/contribution_external_wallet.cc rename to components/brave_rewards/core/internal/contribution/contribution_external_wallet.cc index afdc91b1d786..f3ac4f7d1776 100644 --- a/components/brave_rewards/core/contribution/contribution_external_wallet.cc +++ b/components/brave_rewards/core/internal/contribution/contribution_external_wallet.cc @@ -3,18 +3,19 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/contribution/contribution_external_wallet.h" + #include #include -#include "brave/components/brave_rewards/core/bitflyer/bitflyer.h" -#include "brave/components/brave_rewards/core/contribution/contribution.h" -#include "brave/components/brave_rewards/core/contribution/contribution_external_wallet.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/gemini/gemini.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/publisher/publisher.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/uphold/uphold.h" +#include "brave/components/brave_rewards/core/internal/bitflyer/bitflyer.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/gemini/gemini.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold.h" namespace brave_rewards::internal::contribution { diff --git a/components/brave_rewards/core/contribution/contribution_external_wallet.h b/components/brave_rewards/core/internal/contribution/contribution_external_wallet.h similarity index 81% rename from components/brave_rewards/core/contribution/contribution_external_wallet.h rename to components/brave_rewards/core/internal/contribution/contribution_external_wallet.h index 895afd2fe53a..f797dad14bb2 100644 --- a/components/brave_rewards/core/contribution/contribution_external_wallet.h +++ b/components/brave_rewards/core/internal/contribution/contribution_external_wallet.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_EXTERNAL_WALLET_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_EXTERNAL_WALLET_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_EXTERNAL_WALLET_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_EXTERNAL_WALLET_H_ #include #include #include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -51,4 +51,4 @@ class ContributionExternalWallet { } // namespace contribution } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_EXTERNAL_WALLET_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_EXTERNAL_WALLET_H_ diff --git a/components/brave_rewards/core/contribution/contribution_monthly.cc b/components/brave_rewards/core/internal/contribution/contribution_monthly.cc similarity index 79% rename from components/brave_rewards/core/contribution/contribution_monthly.cc rename to components/brave_rewards/core/internal/contribution/contribution_monthly.cc index 6e4d7776b260..0b3a41bf9db5 100644 --- a/components/brave_rewards/core/contribution/contribution_monthly.cc +++ b/components/brave_rewards/core/internal/contribution/contribution_monthly.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/contribution/contribution_monthly.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution_monthly.h" #include #include @@ -12,10 +12,10 @@ #include "base/functional/bind.h" #include "base/uuid.h" -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/contribution/contribution.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::contribution { @@ -36,16 +36,15 @@ void ContributionMonthly::AdvanceContributionDates( ResultCallback callback, std::vector publishers) { // Remove any contributions whose next contribution date is in the future. - std::erase_if(publishers, - [cutoff_time](const mojom::PublisherInfoPtr& publisher) { - if (!publisher || publisher->id.empty()) { - return true; - } - base::Time next_contribution = - base::Time::FromSecondsSinceUnixEpoch( - static_cast(publisher->reconcile_stamp)); - return cutoff_time && next_contribution > cutoff_time; - }); + std::erase_if( + publishers, [cutoff_time](const mojom::PublisherInfoPtr& publisher) { + if (!publisher || publisher->id.empty()) { + return true; + } + base::Time next_contribution = base::Time::FromSecondsSinceUnixEpoch( + static_cast(publisher->reconcile_stamp)); + return cutoff_time && next_contribution > cutoff_time; + }); std::vector publisher_ids; for (const auto& publisher_info : publishers) { diff --git a/components/brave_rewards/core/contribution/contribution_monthly.h b/components/brave_rewards/core/internal/contribution/contribution_monthly.h similarity index 77% rename from components/brave_rewards/core/contribution/contribution_monthly.h rename to components/brave_rewards/core/internal/contribution/contribution_monthly.h index 84b2ae75414a..8241e20d65e0 100644 --- a/components/brave_rewards/core/contribution/contribution_monthly.h +++ b/components/brave_rewards/core/internal/contribution/contribution_monthly.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_MONTHLY_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_MONTHLY_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_MONTHLY_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_MONTHLY_H_ #include #include @@ -12,7 +12,7 @@ #include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -44,4 +44,4 @@ class ContributionMonthly { } // namespace contribution } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_MONTHLY_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_MONTHLY_H_ diff --git a/components/brave_rewards/core/contribution/contribution_tip.cc b/components/brave_rewards/core/internal/contribution/contribution_tip.cc similarity index 87% rename from components/brave_rewards/core/contribution/contribution_tip.cc rename to components/brave_rewards/core/internal/contribution/contribution_tip.cc index 09a64a4b6aab..a287d5b893c3 100644 --- a/components/brave_rewards/core/contribution/contribution_tip.cc +++ b/components/brave_rewards/core/internal/contribution/contribution_tip.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/contribution/contribution_tip.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution_tip.h" #include #include @@ -12,10 +12,10 @@ #include "base/functional/bind.h" #include "base/functional/callback.h" #include "base/uuid.h" -#include "brave/components/brave_rewards/core/contribution/contribution.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/publisher/publisher.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::contribution { diff --git a/components/brave_rewards/core/contribution/contribution_tip.h b/components/brave_rewards/core/internal/contribution/contribution_tip.h similarity index 80% rename from components/brave_rewards/core/contribution/contribution_tip.h rename to components/brave_rewards/core/internal/contribution/contribution_tip.h index 1562e17a09cf..9ec137db6d6f 100644 --- a/components/brave_rewards/core/contribution/contribution_tip.h +++ b/components/brave_rewards/core/internal/contribution/contribution_tip.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_TIP_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_TIP_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_TIP_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_TIP_H_ #include #include @@ -12,7 +12,7 @@ #include "base/functional/callback_forward.h" #include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { @@ -51,4 +51,4 @@ class ContributionTip { } // namespace contribution } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_TIP_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_TIP_H_ diff --git a/components/brave_rewards/core/contribution/contribution_util.cc b/components/brave_rewards/core/internal/contribution/contribution_util.cc similarity index 90% rename from components/brave_rewards/core/contribution/contribution_util.cc rename to components/brave_rewards/core/internal/contribution/contribution_util.cc index fad1ad181a96..19ab66be5427 100644 --- a/components/brave_rewards/core/contribution/contribution_util.cc +++ b/components/brave_rewards/core/internal/contribution/contribution_util.cc @@ -3,11 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/contribution/contribution_util.h" + #include -#include "brave/components/brave_rewards/core/constants.h" -#include "brave/components/brave_rewards/core/contribution/contribution_util.h" -#include "brave/components/brave_rewards/core/global_constants.h" +#include "brave/components/brave_rewards/core/internal/constants.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" namespace brave_rewards::internal::contribution { diff --git a/components/brave_rewards/core/contribution/contribution_util.h b/components/brave_rewards/core/internal/contribution/contribution_util.h similarity index 72% rename from components/brave_rewards/core/contribution/contribution_util.h rename to components/brave_rewards/core/internal/contribution/contribution_util.h index 14ec08722157..d9b6fd53db5a 100644 --- a/components/brave_rewards/core/contribution/contribution_util.h +++ b/components/brave_rewards/core/internal/contribution/contribution_util.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_UTIL_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_UTIL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_UTIL_H_ #include #include -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal { namespace contribution { @@ -29,4 +29,4 @@ int32_t GetVotesFromAmount(const double amount); } // namespace contribution } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CONTRIBUTION_CONTRIBUTION_UTIL_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CONTRIBUTION_CONTRIBUTION_UTIL_H_ diff --git a/components/brave_rewards/core/contribution/contribution_util_unittest.cc b/components/brave_rewards/core/internal/contribution/contribution_util_unittest.cc similarity index 91% rename from components/brave_rewards/core/contribution/contribution_util_unittest.cc rename to components/brave_rewards/core/internal/contribution/contribution_util_unittest.cc index 31019f774399..159c310b8b1a 100644 --- a/components/brave_rewards/core/contribution/contribution_util_unittest.cc +++ b/components/brave_rewards/core/internal/contribution/contribution_util_unittest.cc @@ -3,9 +3,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/contribution/contribution_util.h" -#include "brave/components/brave_rewards/core/constants.h" -#include "brave/components/brave_rewards/core/global_constants.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution_util.h" + +#include "brave/components/brave_rewards/core/internal/constants.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" #include "testing/gtest/include/gtest/gtest.h" namespace brave_rewards::internal::contribution { diff --git a/components/brave_rewards/core/credentials/credentials.h b/components/brave_rewards/core/internal/credentials/credentials.h similarity index 69% rename from components/brave_rewards/core/credentials/credentials.h rename to components/brave_rewards/core/internal/credentials/credentials.h index 4161cf93c253..0230ce7de596 100644 --- a/components/brave_rewards/core/credentials/credentials.h +++ b/components/brave_rewards/core/internal/credentials/credentials.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_H_ -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/credentials/credentials_redeem.h" -#include "brave/components/brave_rewards/core/credentials/credentials_trigger.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/credentials/credentials_redeem.h" +#include "brave/components/brave_rewards/core/internal/credentials/credentials_trigger.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" namespace brave_rewards::internal { namespace credential { @@ -44,4 +44,4 @@ class Credentials { } // namespace credential } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_H_ diff --git a/components/brave_rewards/core/credentials/credentials_common.cc b/components/brave_rewards/core/internal/credentials/credentials_common.cc similarity index 92% rename from components/brave_rewards/core/credentials/credentials_common.cc rename to components/brave_rewards/core/internal/credentials/credentials_common.cc index 0c51a55bd38e..418cb10869b3 100644 --- a/components/brave_rewards/core/credentials/credentials_common.cc +++ b/components/brave_rewards/core/internal/credentials/credentials_common.cc @@ -3,16 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/credentials/credentials_common.h" + #include #include #include "base/json/json_writer.h" #include "base/strings/string_number_conversions.h" #include "base/uuid.h" -#include "brave/components/brave_rewards/core/credentials/credentials_common.h" -#include "brave/components/brave_rewards/core/credentials/credentials_util.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/credentials/credentials_util.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::credential { diff --git a/components/brave_rewards/core/credentials/credentials_common.h b/components/brave_rewards/core/internal/credentials/credentials_common.h similarity index 73% rename from components/brave_rewards/core/credentials/credentials_common.h rename to components/brave_rewards/core/internal/credentials/credentials_common.h index 71f6d0c7e70d..91da46dc05b7 100644 --- a/components/brave_rewards/core/credentials/credentials_common.h +++ b/components/brave_rewards/core/internal/credentials/credentials_common.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_COMMON_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_COMMON_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_COMMON_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_COMMON_H_ #include @@ -14,9 +14,9 @@ #include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/credentials/credentials.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/credentials/credentials.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" namespace brave_rewards::internal { class RewardsEngine; @@ -53,4 +53,4 @@ class CredentialsCommon { } // namespace credential } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_COMMON_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_COMMON_H_ diff --git a/components/brave_rewards/core/credentials/credentials_redeem.cc b/components/brave_rewards/core/internal/credentials/credentials_redeem.cc similarity index 86% rename from components/brave_rewards/core/credentials/credentials_redeem.cc rename to components/brave_rewards/core/internal/credentials/credentials_redeem.cc index 2032829037c9..cdf41f45292b 100644 --- a/components/brave_rewards/core/credentials/credentials_redeem.cc +++ b/components/brave_rewards/core/internal/credentials/credentials_redeem.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/credentials/credentials_redeem.h" +#include "brave/components/brave_rewards/core/internal/credentials/credentials_redeem.h" namespace brave_rewards::internal::credential { diff --git a/components/brave_rewards/core/credentials/credentials_redeem.h b/components/brave_rewards/core/internal/credentials/credentials_redeem.h similarity index 65% rename from components/brave_rewards/core/credentials/credentials_redeem.h rename to components/brave_rewards/core/internal/credentials/credentials_redeem.h index 450a60c4f83d..e342c7bee4a8 100644 --- a/components/brave_rewards/core/credentials/credentials_redeem.h +++ b/components/brave_rewards/core/internal/credentials/credentials_redeem.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_REDEEM_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_REDEEM_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_REDEEM_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_REDEEM_H_ #include #include -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" namespace brave_rewards::internal { namespace credential { @@ -31,4 +31,4 @@ struct CredentialsRedeem { } // namespace credential } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_REDEEM_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_REDEEM_H_ diff --git a/components/brave_rewards/core/credentials/credentials_trigger.cc b/components/brave_rewards/core/internal/credentials/credentials_trigger.cc similarity index 86% rename from components/brave_rewards/core/credentials/credentials_trigger.cc rename to components/brave_rewards/core/internal/credentials/credentials_trigger.cc index e57275e5c4c2..ae3fcd264225 100644 --- a/components/brave_rewards/core/credentials/credentials_trigger.cc +++ b/components/brave_rewards/core/internal/credentials/credentials_trigger.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/credentials/credentials_trigger.h" +#include "brave/components/brave_rewards/core/internal/credentials/credentials_trigger.h" namespace brave_rewards::internal::credential { diff --git a/components/brave_rewards/core/credentials/credentials_trigger.h b/components/brave_rewards/core/internal/credentials/credentials_trigger.h similarity index 66% rename from components/brave_rewards/core/credentials/credentials_trigger.h rename to components/brave_rewards/core/internal/credentials/credentials_trigger.h index 8ea4c997f028..962a3e592d31 100644 --- a/components/brave_rewards/core/credentials/credentials_trigger.h +++ b/components/brave_rewards/core/internal/credentials/credentials_trigger.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_TRIGGER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_TRIGGER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_TRIGGER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_TRIGGER_H_ #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" namespace brave_rewards::internal { namespace credential { @@ -28,4 +28,4 @@ struct CredentialsTrigger { } // namespace credential } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_TRIGGER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_TRIGGER_H_ diff --git a/components/brave_rewards/core/credentials/credentials_util.cc b/components/brave_rewards/core/internal/credentials/credentials_util.cc similarity index 97% rename from components/brave_rewards/core/credentials/credentials_util.cc rename to components/brave_rewards/core/internal/credentials/credentials_util.cc index 0d38aa6cc898..6d71ad0d07fd 100644 --- a/components/brave_rewards/core/credentials/credentials_util.cc +++ b/components/brave_rewards/core/internal/credentials/credentials_util.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/credentials/credentials_util.h" +#include "brave/components/brave_rewards/core/internal/credentials/credentials_util.h" #include #include #include "base/json/json_reader.h" #include "base/json/json_writer.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "brave/components/challenge_bypass_ristretto/batch_dleq_proof.h" #include "brave/components/challenge_bypass_ristretto/public_key.h" #include "brave/components/challenge_bypass_ristretto/signed_token.h" diff --git a/components/brave_rewards/core/credentials/credentials_util.h b/components/brave_rewards/core/internal/credentials/credentials_util.h similarity index 82% rename from components/brave_rewards/core/credentials/credentials_util.h rename to components/brave_rewards/core/internal/credentials/credentials_util.h index d2eb8880f409..d92f30b46833 100644 --- a/components/brave_rewards/core/credentials/credentials_util.h +++ b/components/brave_rewards/core/internal/credentials/credentials_util.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_UTIL_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_UTIL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_UTIL_H_ #include #include @@ -12,8 +12,8 @@ #include "base/types/expected.h" #include "base/values.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/credentials/credentials_redeem.h" +#include "brave/components/brave_rewards/core/internal/credentials/credentials_redeem.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" #include "brave/components/challenge_bypass_ristretto/blinded_token.h" #include "brave/components/challenge_bypass_ristretto/token.h" @@ -61,4 +61,4 @@ base::Value::Dict GenerateSuggestionMock(const std::string& token_value, } // namespace credential } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_CREDENTIALS_CREDENTIALS_UTIL_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_CREDENTIALS_CREDENTIALS_UTIL_H_ diff --git a/components/brave_rewards/core/credentials/credentials_util_unittest.cc b/components/brave_rewards/core/internal/credentials/credentials_util_unittest.cc similarity index 97% rename from components/brave_rewards/core/credentials/credentials_util_unittest.cc rename to components/brave_rewards/core/internal/credentials/credentials_util_unittest.cc index 47d5627d8269..59c803e44b2b 100644 --- a/components/brave_rewards/core/credentials/credentials_util_unittest.cc +++ b/components/brave_rewards/core/internal/credentials/credentials_util_unittest.cc @@ -3,13 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/credentials/credentials_util.h" + #include #include #include #include -#include "brave/components/brave_rewards/core/credentials/credentials_util.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" #include "testing/gtest/include/gtest/gtest.h" namespace brave_rewards::internal::credential { diff --git a/components/brave_rewards/core/database/DEPS b/components/brave_rewards/core/internal/database/DEPS similarity index 100% rename from components/brave_rewards/core/database/DEPS rename to components/brave_rewards/core/internal/database/DEPS diff --git a/components/brave_rewards/core/database/database.cc b/components/brave_rewards/core/internal/database/database.cc similarity index 98% rename from components/brave_rewards/core/database/database.cc rename to components/brave_rewards/core/internal/database/database.cc index d39da6743aa5..a26df3454425 100644 --- a/components/brave_rewards/core/database/database.cc +++ b/components/brave_rewards/core/internal/database/database.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/database/database.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" #include #include -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/logging/event_log_keys.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/logging/event_log_keys.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database.h b/components/brave_rewards/core/internal/database/database.h similarity index 85% rename from components/brave_rewards/core/database/database.h rename to components/brave_rewards/core/internal/database/database.h index fd62276de941..81bad6a01735 100644 --- a/components/brave_rewards/core/database/database.h +++ b/components/brave_rewards/core/internal/database/database.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_H_ #include @@ -16,24 +16,24 @@ #include "base/functional/callback_forward.h" #include "base/memory/raw_ref.h" #include "base/time/time.h" -#include "brave/components/brave_rewards/core/database/database_activity_info.h" -#include "brave/components/brave_rewards/core/database/database_balance_report.h" -#include "brave/components/brave_rewards/core/database/database_contribution_info.h" -#include "brave/components/brave_rewards/core/database/database_contribution_queue.h" -#include "brave/components/brave_rewards/core/database/database_creds_batch.h" -#include "brave/components/brave_rewards/core/database/database_event_log.h" -#include "brave/components/brave_rewards/core/database/database_external_transactions.h" -#include "brave/components/brave_rewards/core/database/database_initialize.h" -#include "brave/components/brave_rewards/core/database/database_media_publisher_info.h" -#include "brave/components/brave_rewards/core/database/database_publisher_info.h" -#include "brave/components/brave_rewards/core/database/database_publisher_prefix_list.h" -#include "brave/components/brave_rewards/core/database/database_recurring_tip.h" -#include "brave/components/brave_rewards/core/database/database_server_publisher_info.h" -#include "brave/components/brave_rewards/core/database/database_sku_order.h" -#include "brave/components/brave_rewards/core/database/database_sku_transaction.h" -#include "brave/components/brave_rewards/core/database/database_unblinded_token.h" -#include "brave/components/brave_rewards/core/publisher/prefix_list_reader.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/database/database_activity_info.h" +#include "brave/components/brave_rewards/core/internal/database/database_balance_report.h" +#include "brave/components/brave_rewards/core/internal/database/database_contribution_info.h" +#include "brave/components/brave_rewards/core/internal/database/database_contribution_queue.h" +#include "brave/components/brave_rewards/core/internal/database/database_creds_batch.h" +#include "brave/components/brave_rewards/core/internal/database/database_event_log.h" +#include "brave/components/brave_rewards/core/internal/database/database_external_transactions.h" +#include "brave/components/brave_rewards/core/internal/database/database_initialize.h" +#include "brave/components/brave_rewards/core/internal/database/database_media_publisher_info.h" +#include "brave/components/brave_rewards/core/internal/database/database_publisher_info.h" +#include "brave/components/brave_rewards/core/internal/database/database_publisher_prefix_list.h" +#include "brave/components/brave_rewards/core/internal/database/database_recurring_tip.h" +#include "brave/components/brave_rewards/core/internal/database/database_server_publisher_info.h" +#include "brave/components/brave_rewards/core/internal/database/database_sku_order.h" +#include "brave/components/brave_rewards/core/internal/database/database_sku_transaction.h" +#include "brave/components/brave_rewards/core/internal/database/database_unblinded_token.h" +#include "brave/components/brave_rewards/core/internal/publisher/prefix_list_reader.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -328,4 +328,4 @@ class Database { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_H_ diff --git a/components/brave_rewards/core/database/database_activity_info.cc b/components/brave_rewards/core/internal/database/database_activity_info.cc similarity index 96% rename from components/brave_rewards/core/database/database_activity_info.cc rename to components/brave_rewards/core/internal/database/database_activity_info.cc index 9834c6e1ab3b..01c3ba3fce12 100644 --- a/components/brave_rewards/core/database/database_activity_info.cc +++ b/components/brave_rewards/core/internal/database/database_activity_info.cc @@ -3,15 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_activity_info.h" + #include #include +#include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "base/types/cxx23_to_underlying.h" -#include "brave/components/brave_rewards/core/database/database_activity_info.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" namespace brave_rewards::internal { @@ -69,10 +71,10 @@ std::string GenerateActivityFilterQuery(const int start, } if (limit > 0) { - query += " LIMIT " + std::to_string(limit); + query += " LIMIT " + base::NumberToString(limit); if (start > 1) { - query += " OFFSET " + std::to_string(start); + query += " OFFSET " + base::NumberToString(start); } } diff --git a/components/brave_rewards/core/database/database_activity_info.h b/components/brave_rewards/core/internal/database/database_activity_info.h similarity index 81% rename from components/brave_rewards/core/database/database_activity_info.h rename to components/brave_rewards/core/internal/database/database_activity_info.h index 6ed251823d9a..99e0de6c51b7 100644 --- a/components/brave_rewards/core/database/database_activity_info.h +++ b/components/brave_rewards/core/internal/database/database_activity_info.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_ACTIVITY_INFO_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_ACTIVITY_INFO_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_ACTIVITY_INFO_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_ACTIVITY_INFO_H_ #include #include -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -48,4 +48,4 @@ class DatabaseActivityInfo : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_ACTIVITY_INFO_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_ACTIVITY_INFO_H_ diff --git a/components/brave_rewards/core/database/database_balance_report.cc b/components/brave_rewards/core/internal/database/database_balance_report.cc similarity index 97% rename from components/brave_rewards/core/database/database_balance_report.cc rename to components/brave_rewards/core/internal/database/database_balance_report.cc index 9d51fc9c261a..1b9f3d32f185 100644 --- a/components/brave_rewards/core/database/database_balance_report.cc +++ b/components/brave_rewards/core/internal/database/database_balance_report.cc @@ -3,15 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_balance_report.h" + #include #include #include "base/strings/stringprintf.h" #include "base/types/cxx23_to_underlying.h" -#include "brave/components/brave_rewards/core/database/database_balance_report.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/database/database_balance_report.h b/components/brave_rewards/core/internal/database/database_balance_report.h similarity index 81% rename from components/brave_rewards/core/database/database_balance_report.h rename to components/brave_rewards/core/internal/database/database_balance_report.h index 453fbe30ff50..8023b8b096ce 100644 --- a/components/brave_rewards/core/database/database_balance_report.h +++ b/components/brave_rewards/core/internal/database/database_balance_report.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_BALANCE_REPORT_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_BALANCE_REPORT_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_BALANCE_REPORT_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_BALANCE_REPORT_H_ #include #include -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -50,4 +50,4 @@ class DatabaseBalanceReport : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_BALANCE_REPORT_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_BALANCE_REPORT_H_ diff --git a/components/brave_rewards/core/database/database_contribution_info.cc b/components/brave_rewards/core/internal/database/database_contribution_info.cc similarity index 97% rename from components/brave_rewards/core/database/database_contribution_info.cc rename to components/brave_rewards/core/internal/database/database_contribution_info.cc index b9dac8d32cc0..97a2d77dfaf9 100644 --- a/components/brave_rewards/core/database/database_contribution_info.cc +++ b/components/brave_rewards/core/internal/database/database_contribution_info.cc @@ -3,16 +3,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_contribution_info.h" + #include #include #include +#include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" #include "base/types/cxx23_to_underlying.h" -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/database/database_contribution_info.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { @@ -216,7 +218,7 @@ void DatabaseContributionInfo::GetOneTimeTips(const mojom::ActivityMonth month, base::StringPrintf("%02d", base::to_underlying(month)); BindString(command.get(), 0, formatted_month); - BindString(command.get(), 1, std::to_string(year)); + BindString(command.get(), 1, base::NumberToString(year)); BindInt(command.get(), 2, static_cast(mojom::RewardsType::ONE_TIME_TIP)); BindInt(command.get(), 3, static_cast(mojom::ContributionStep::STEP_COMPLETED)); diff --git a/components/brave_rewards/core/database/database_contribution_info.h b/components/brave_rewards/core/internal/database/database_contribution_info.h similarity index 85% rename from components/brave_rewards/core/database/database_contribution_info.h rename to components/brave_rewards/core/internal/database/database_contribution_info.h index 8831aeab0597..3424c659748b 100644 --- a/components/brave_rewards/core/database/database_contribution_info.h +++ b/components/brave_rewards/core/internal/database/database_contribution_info.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CONTRIBUTION_INFO_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CONTRIBUTION_INFO_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CONTRIBUTION_INFO_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CONTRIBUTION_INFO_H_ #include #include #include #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/database/database_contribution_info_publishers.h" -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_contribution_info_publishers.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -79,4 +79,4 @@ class DatabaseContributionInfo : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CONTRIBUTION_INFO_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CONTRIBUTION_INFO_H_ diff --git a/components/brave_rewards/core/database/database_contribution_info_publishers.cc b/components/brave_rewards/core/internal/database/database_contribution_info_publishers.cc similarity index 97% rename from components/brave_rewards/core/database/database_contribution_info_publishers.cc rename to components/brave_rewards/core/internal/database/database_contribution_info_publishers.cc index fc9690deea9a..fedd17c51a4f 100644 --- a/components/brave_rewards/core/database/database_contribution_info_publishers.cc +++ b/components/brave_rewards/core/internal/database/database_contribution_info_publishers.cc @@ -3,13 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_contribution_info_publishers.h" + #include #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/database/database_contribution_info_publishers.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_contribution_info_publishers.h b/components/brave_rewards/core/internal/database/database_contribution_info_publishers.h similarity index 79% rename from components/brave_rewards/core/database/database_contribution_info_publishers.h rename to components/brave_rewards/core/internal/database/database_contribution_info_publishers.h index cb8e4b1e7a5a..f4ea1c87ff2e 100644 --- a/components/brave_rewards/core/database/database_contribution_info_publishers.h +++ b/components/brave_rewards/core/internal/database/database_contribution_info_publishers.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CONTRIBUTION_INFO_PUBLISHERS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CONTRIBUTION_INFO_PUBLISHERS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CONTRIBUTION_INFO_PUBLISHERS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CONTRIBUTION_INFO_PUBLISHERS_H_ #include #include -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -46,4 +46,4 @@ class DatabaseContributionInfoPublishers : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CONTRIBUTION_INFO_PUBLISHERS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CONTRIBUTION_INFO_PUBLISHERS_H_ diff --git a/components/brave_rewards/core/database/database_contribution_queue.cc b/components/brave_rewards/core/internal/database/database_contribution_queue.cc similarity index 94% rename from components/brave_rewards/core/database/database_contribution_queue.cc rename to components/brave_rewards/core/internal/database/database_contribution_queue.cc index 329009e35b8b..2492fc99f214 100644 --- a/components/brave_rewards/core/database/database_contribution_queue.cc +++ b/components/brave_rewards/core/internal/database/database_contribution_queue.cc @@ -3,15 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_contribution_queue.h" + #include #include #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/database/database_contribution_queue.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_contribution_queue.h b/components/brave_rewards/core/internal/database/database_contribution_queue.h similarity index 77% rename from components/brave_rewards/core/database/database_contribution_queue.h rename to components/brave_rewards/core/internal/database/database_contribution_queue.h index 81339e2ba45f..b2a9f72165a2 100644 --- a/components/brave_rewards/core/database/database_contribution_queue.h +++ b/components/brave_rewards/core/internal/database/database_contribution_queue.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CONTRIBUTION_QUEUE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CONTRIBUTION_QUEUE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CONTRIBUTION_QUEUE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CONTRIBUTION_QUEUE_H_ #include #include #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/database/database_contribution_queue_publishers.h" -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_contribution_queue_publishers.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -50,4 +50,4 @@ class DatabaseContributionQueue : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CONTRIBUTION_QUEUE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CONTRIBUTION_QUEUE_H_ diff --git a/components/brave_rewards/core/database/database_contribution_queue_publishers.cc b/components/brave_rewards/core/internal/database/database_contribution_queue_publishers.cc similarity index 91% rename from components/brave_rewards/core/database/database_contribution_queue_publishers.cc rename to components/brave_rewards/core/internal/database/database_contribution_queue_publishers.cc index a0ced5d5cd8e..39f916a37093 100644 --- a/components/brave_rewards/core/database/database_contribution_queue_publishers.cc +++ b/components/brave_rewards/core/internal/database/database_contribution_queue_publishers.cc @@ -3,14 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_contribution_queue_publishers.h" + #include #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/database/database_contribution_queue_publishers.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_contribution_queue_publishers.h b/components/brave_rewards/core/internal/database/database_contribution_queue_publishers.h similarity index 73% rename from components/brave_rewards/core/database/database_contribution_queue_publishers.h rename to components/brave_rewards/core/internal/database/database_contribution_queue_publishers.h index f71e6398637e..c373757e7129 100644 --- a/components/brave_rewards/core/database/database_contribution_queue_publishers.h +++ b/components/brave_rewards/core/internal/database/database_contribution_queue_publishers.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CONTRIBUTION_QUEUE_PUBLISHERS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CONTRIBUTION_QUEUE_PUBLISHERS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CONTRIBUTION_QUEUE_PUBLISHERS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CONTRIBUTION_QUEUE_PUBLISHERS_H_ #include #include -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -34,4 +34,4 @@ class DatabaseContributionQueuePublishers : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CONTRIBUTION_QUEUE_PUBLISHERS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CONTRIBUTION_QUEUE_PUBLISHERS_H_ diff --git a/components/brave_rewards/core/database/database_creds_batch.cc b/components/brave_rewards/core/internal/database/database_creds_batch.cc similarity index 98% rename from components/brave_rewards/core/database/database_creds_batch.cc rename to components/brave_rewards/core/internal/database/database_creds_batch.cc index 0523d55cd30a..a6d42114a5d0 100644 --- a/components/brave_rewards/core/database/database_creds_batch.cc +++ b/components/brave_rewards/core/internal/database/database_creds_batch.cc @@ -3,12 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_creds_batch.h" + #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/database/database_creds_batch.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_creds_batch.h b/components/brave_rewards/core/internal/database/database_creds_batch.h similarity index 85% rename from components/brave_rewards/core/database/database_creds_batch.h rename to components/brave_rewards/core/internal/database/database_creds_batch.h index b02ba58930b2..48e6ca393dc1 100644 --- a/components/brave_rewards/core/database/database_creds_batch.h +++ b/components/brave_rewards/core/internal/database/database_creds_batch.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CREDS_BATCH_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CREDS_BATCH_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CREDS_BATCH_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CREDS_BATCH_H_ #include #include -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -57,4 +57,4 @@ class DatabaseCredsBatch : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_CREDS_BATCH_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_CREDS_BATCH_H_ diff --git a/components/brave_rewards/core/database/database_event_log.cc b/components/brave_rewards/core/internal/database/database_event_log.cc similarity index 93% rename from components/brave_rewards/core/database/database_event_log.cc rename to components/brave_rewards/core/internal/database/database_event_log.cc index 9566a3b684cb..b16b452f343b 100644 --- a/components/brave_rewards/core/database/database_event_log.cc +++ b/components/brave_rewards/core/internal/database/database_event_log.cc @@ -3,16 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_event_log.h" + #include #include #include "base/functional/callback_helpers.h" #include "base/strings/stringprintf.h" #include "base/uuid.h" -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/database/database_event_log.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_event_log.h b/components/brave_rewards/core/internal/database/database_event_log.h similarity index 74% rename from components/brave_rewards/core/database/database_event_log.h rename to components/brave_rewards/core/internal/database/database_event_log.h index 2bfe2fbba3de..fb858fbd98d7 100644 --- a/components/brave_rewards/core/database/database_event_log.h +++ b/components/brave_rewards/core/internal/database/database_event_log.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_EVENT_LOG_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_EVENT_LOG_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_EVENT_LOG_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_EVENT_LOG_H_ #include #include -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -35,4 +35,4 @@ class DatabaseEventLog : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_EVENT_LOG_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_EVENT_LOG_H_ diff --git a/components/brave_rewards/core/database/database_external_transactions.cc b/components/brave_rewards/core/internal/database/database_external_transactions.cc similarity index 95% rename from components/brave_rewards/core/database/database_external_transactions.cc rename to components/brave_rewards/core/internal/database/database_external_transactions.cc index a9045ac87581..9104b64b411c 100644 --- a/components/brave_rewards/core/database/database_external_transactions.cc +++ b/components/brave_rewards/core/internal/database/database_external_transactions.cc @@ -3,13 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_external_transactions.h" + #include #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/database/database_external_transactions.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_external_transactions.h b/components/brave_rewards/core/internal/database/database_external_transactions.h similarity index 77% rename from components/brave_rewards/core/database/database_external_transactions.h rename to components/brave_rewards/core/internal/database/database_external_transactions.h index f75c7a0a4e71..342d17d4101f 100644 --- a/components/brave_rewards/core/database/database_external_transactions.h +++ b/components/brave_rewards/core/internal/database/database_external_transactions.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_EXTERNAL_TRANSACTIONS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_EXTERNAL_TRANSACTIONS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_EXTERNAL_TRANSACTIONS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_EXTERNAL_TRANSACTIONS_H_ #include #include "base/types/expected.h" -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal::database { @@ -37,4 +37,4 @@ class DatabaseExternalTransactions : public DatabaseTable { } // namespace brave_rewards::internal::database -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_EXTERNAL_TRANSACTIONS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_EXTERNAL_TRANSACTIONS_H_ diff --git a/components/brave_rewards/core/database/database_initialize.cc b/components/brave_rewards/core/internal/database/database_initialize.cc similarity index 85% rename from components/brave_rewards/core/database/database_initialize.cc rename to components/brave_rewards/core/internal/database/database_initialize.cc index 211eee21c3c8..aa79af3cc44a 100644 --- a/components/brave_rewards/core/database/database_initialize.cc +++ b/components/brave_rewards/core/internal/database/database_initialize.cc @@ -3,12 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_initialize.h" + #include -#include "brave/components/brave_rewards/core/database/database_initialize.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_initialize.h b/components/brave_rewards/core/internal/database/database_initialize.h similarity index 65% rename from components/brave_rewards/core/database/database_initialize.h rename to components/brave_rewards/core/internal/database/database_initialize.h index 29f4f1b11bbd..d4f96d533dad 100644 --- a/components/brave_rewards/core/database/database_initialize.h +++ b/components/brave_rewards/core/internal/database/database_initialize.h @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_INITIALIZE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_INITIALIZE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_INITIALIZE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_INITIALIZE_H_ #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/database/database_migration.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/database/database_migration.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -33,4 +33,4 @@ class DatabaseInitialize { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_INITIALIZE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_INITIALIZE_H_ diff --git a/components/brave_rewards/core/database/database_media_publisher_info.cc b/components/brave_rewards/core/internal/database/database_media_publisher_info.cc similarity index 94% rename from components/brave_rewards/core/database/database_media_publisher_info.cc rename to components/brave_rewards/core/internal/database/database_media_publisher_info.cc index c15d7b6f9aad..1d5099b82d03 100644 --- a/components/brave_rewards/core/database/database_media_publisher_info.cc +++ b/components/brave_rewards/core/internal/database/database_media_publisher_info.cc @@ -3,13 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_media_publisher_info.h" + #include #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/database/database_media_publisher_info.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_media_publisher_info.h b/components/brave_rewards/core/internal/database/database_media_publisher_info.h similarity index 71% rename from components/brave_rewards/core/database/database_media_publisher_info.h rename to components/brave_rewards/core/internal/database/database_media_publisher_info.h index d298b9778009..c0bd4cb8ff67 100644 --- a/components/brave_rewards/core/database/database_media_publisher_info.h +++ b/components/brave_rewards/core/internal/database/database_media_publisher_info.h @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_MEDIA_PUBLISHER_INFO_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_MEDIA_PUBLISHER_INFO_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_MEDIA_PUBLISHER_INFO_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_MEDIA_PUBLISHER_INFO_H_ #include -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -32,4 +32,4 @@ class DatabaseMediaPublisherInfo : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_MEDIA_PUBLISHER_INFO_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_MEDIA_PUBLISHER_INFO_H_ diff --git a/components/brave_rewards/core/database/database_migration.cc b/components/brave_rewards/core/internal/database/database_migration.cc similarity index 62% rename from components/brave_rewards/core/database/database_migration.cc rename to components/brave_rewards/core/internal/database/database_migration.cc index 90043c01e9ed..b2991fa55fde 100644 --- a/components/brave_rewards/core/database/database_migration.cc +++ b/components/brave_rewards/core/internal/database/database_migration.cc @@ -3,56 +3,57 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_migration.h" + #include #include #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/database/database_migration.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v1.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v10.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v11.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v12.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v13.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v14.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v15.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v16.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v17.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v18.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v19.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v2.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v20.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v21.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v22.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v23.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v24.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v25.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v26.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v27.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v28.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v29.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v3.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v30.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v31.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v32.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v33.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v34.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v35.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v36.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v37.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v38.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v39.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v4.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v40.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v5.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v6.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v7.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v8.h" -#include "brave/components/brave_rewards/core/database/migration/migration_v9.h" -#include "brave/components/brave_rewards/core/logging/event_log_keys.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v1.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v10.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v11.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v12.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v13.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v14.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v15.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v16.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v17.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v18.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v19.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v2.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v20.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v21.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v22.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v23.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v24.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v25.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v26.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v27.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v28.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v29.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v3.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v30.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v31.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v32.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v33.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v34.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v35.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v36.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v37.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v38.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v39.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v4.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v40.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v5.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v6.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v7.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v8.h" +#include "brave/components/brave_rewards/core/internal/database/migration/migration_v9.h" +#include "brave/components/brave_rewards/core/internal/logging/event_log_keys.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "third_party/re2/src/re2/re2.h" // NOTICE!! diff --git a/components/brave_rewards/core/database/database_migration.h b/components/brave_rewards/core/internal/database/database_migration.h similarity index 77% rename from components/brave_rewards/core/database/database_migration.h rename to components/brave_rewards/core/internal/database/database_migration.h index 49920756dca0..04ad6769d6ed 100644 --- a/components/brave_rewards/core/database/database_migration.h +++ b/components/brave_rewards/core/internal/database/database_migration.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_MIGRATION_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_MIGRATION_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_MIGRATION_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_MIGRATION_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -40,4 +40,4 @@ class DatabaseMigration { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_MIGRATION_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_MIGRATION_H_ diff --git a/components/brave_rewards/core/database/database_migration_unittest.cc b/components/brave_rewards/core/internal/database/database_migration_unittest.cc similarity index 98% rename from components/brave_rewards/core/database/database_migration_unittest.cc rename to components/brave_rewards/core/internal/database/database_migration_unittest.cc index 32fbb64d24f7..278fb45d0726 100644 --- a/components/brave_rewards/core/database/database_migration_unittest.cc +++ b/components/brave_rewards/core/internal/database/database_migration_unittest.cc @@ -3,6 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_migration.h" + #include #include @@ -12,14 +14,13 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/test/task_environment.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_engine.mojom-test-utils.h" -#include "brave/components/brave_rewards/core/database/database_migration.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" -#include "brave/components/brave_rewards/core/test/test_rewards_engine_client.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/test/test_rewards_engine_client.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_engine.mojom-test-utils.h" #include "build/build_config.h" #include "sql/statement.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/components/brave_rewards/core/database/database_mock.cc b/components/brave_rewards/core/internal/database/database_mock.cc similarity index 85% rename from components/brave_rewards/core/database/database_mock.cc rename to components/brave_rewards/core/internal/database/database_mock.cc index eca32e715770..501b98f102e9 100644 --- a/components/brave_rewards/core/database/database_mock.cc +++ b/components/brave_rewards/core/internal/database/database_mock.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/database/database_mock.h" +#include "brave/components/brave_rewards/core/internal/database/database_mock.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_mock.h b/components/brave_rewards/core/internal/database/database_mock.h similarity index 70% rename from components/brave_rewards/core/database/database_mock.h rename to components/brave_rewards/core/internal/database/database_mock.h index 5311ff14a13e..d7fca0f1f306 100644 --- a/components/brave_rewards/core/database/database_mock.h +++ b/components/brave_rewards/core/internal/database/database_mock.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_MOCK_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_MOCK_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_MOCK_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_MOCK_H_ #include #include -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" #include "testing/gmock/include/gmock/gmock.h" namespace brave_rewards::internal { @@ -34,4 +34,4 @@ class MockDatabase : public Database { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_MOCK_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_MOCK_H_ diff --git a/components/brave_rewards/core/database/database_publisher_info.cc b/components/brave_rewards/core/internal/database/database_publisher_info.cc similarity index 96% rename from components/brave_rewards/core/database/database_publisher_info.cc rename to components/brave_rewards/core/internal/database/database_publisher_info.cc index d802f38403c4..f2a89b206b00 100644 --- a/components/brave_rewards/core/database/database_publisher_info.cc +++ b/components/brave_rewards/core/internal/database/database_publisher_info.cc @@ -3,17 +3,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_publisher_info.h" + #include #include #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/constants.h" -#include "brave/components/brave_rewards/core/database/database_publisher_info.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/publisher/publisher.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/constants.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace { diff --git a/components/brave_rewards/core/database/database_publisher_info.h b/components/brave_rewards/core/internal/database/database_publisher_info.h similarity index 80% rename from components/brave_rewards/core/database/database_publisher_info.h rename to components/brave_rewards/core/internal/database/database_publisher_info.h index 5c8b460c0a79..4fc1015f9a06 100644 --- a/components/brave_rewards/core/database/database_publisher_info.h +++ b/components/brave_rewards/core/internal/database/database_publisher_info.h @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_PUBLISHER_INFO_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_PUBLISHER_INFO_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_PUBLISHER_INFO_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_PUBLISHER_INFO_H_ #include -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -47,4 +47,4 @@ class DatabasePublisherInfo : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_PUBLISHER_INFO_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_PUBLISHER_INFO_H_ diff --git a/components/brave_rewards/core/database/database_publisher_prefix_list.cc b/components/brave_rewards/core/internal/database/database_publisher_prefix_list.cc similarity index 94% rename from components/brave_rewards/core/database/database_publisher_prefix_list.cc rename to components/brave_rewards/core/internal/database/database_publisher_prefix_list.cc index 73ffa2a9fd53..d040381194aa 100644 --- a/components/brave_rewards/core/database/database_publisher_prefix_list.cc +++ b/components/brave_rewards/core/internal/database/database_publisher_prefix_list.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/database/database_publisher_prefix_list.h" +#include "brave/components/brave_rewards/core/internal/database/database_publisher_prefix_list.h" #include #include @@ -11,9 +11,9 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/publisher/prefix_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/publisher/prefix_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/database/database_publisher_prefix_list.h b/components/brave_rewards/core/internal/database/database_publisher_prefix_list.h similarity index 73% rename from components/brave_rewards/core/database/database_publisher_prefix_list.h rename to components/brave_rewards/core/internal/database/database_publisher_prefix_list.h index 8a213f7f5f06..dba9413ed50a 100644 --- a/components/brave_rewards/core/database/database_publisher_prefix_list.h +++ b/components/brave_rewards/core/internal/database/database_publisher_prefix_list.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_PUBLISHER_PREFIX_LIST_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_PUBLISHER_PREFIX_LIST_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_PUBLISHER_PREFIX_LIST_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_PUBLISHER_PREFIX_LIST_H_ #include #include -#include "brave/components/brave_rewards/core/database/database_table.h" -#include "brave/components/brave_rewards/core/publisher/prefix_list_reader.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/publisher/prefix_list_reader.h" namespace brave_rewards::internal { namespace database { @@ -43,4 +43,4 @@ class DatabasePublisherPrefixList : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_PUBLISHER_PREFIX_LIST_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_PUBLISHER_PREFIX_LIST_H_ diff --git a/components/brave_rewards/core/database/database_publisher_prefix_list_unittest.cc b/components/brave_rewards/core/internal/database/database_publisher_prefix_list_unittest.cc similarity index 91% rename from components/brave_rewards/core/database/database_publisher_prefix_list_unittest.cc rename to components/brave_rewards/core/internal/database/database_publisher_prefix_list_unittest.cc index f6ad407e269d..16047d74e05c 100644 --- a/components/brave_rewards/core/database/database_publisher_prefix_list_unittest.cc +++ b/components/brave_rewards/core/internal/database/database_publisher_prefix_list_unittest.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/database/database_publisher_prefix_list.h" +#include "brave/components/brave_rewards/core/internal/database/database_publisher_prefix_list.h" #include #include @@ -12,8 +12,8 @@ #include "base/containers/span.h" #include "base/numerics/byte_conversions.h" -#include "brave/components/brave_rewards/core/publisher/protos/publisher_prefix_list.pb.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/publisher/protos/publisher_prefix_list.pb.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/database/database_recurring_tip.cc b/components/brave_rewards/core/internal/database/database_recurring_tip.cc similarity index 96% rename from components/brave_rewards/core/database/database_recurring_tip.cc rename to components/brave_rewards/core/internal/database/database_recurring_tip.cc index 77fcb4b4c4b8..dd9a037f2817 100644 --- a/components/brave_rewards/core/database/database_recurring_tip.cc +++ b/components/brave_rewards/core/internal/database/database_recurring_tip.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/database/database_recurring_tip.h" +#include "brave/components/brave_rewards/core/internal/database/database_recurring_tip.h" #include #include @@ -12,10 +12,10 @@ #include "base/functional/bind.h" #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/constants.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state.h" +#include "brave/components/brave_rewards/core/internal/constants.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_recurring_tip.h b/components/brave_rewards/core/internal/database/database_recurring_tip.h similarity index 80% rename from components/brave_rewards/core/database/database_recurring_tip.h rename to components/brave_rewards/core/internal/database/database_recurring_tip.h index 33bba16b6ff8..cc24ffd4b215 100644 --- a/components/brave_rewards/core/database/database_recurring_tip.h +++ b/components/brave_rewards/core/internal/database/database_recurring_tip.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_RECURRING_TIP_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_RECURRING_TIP_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_RECURRING_TIP_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_RECURRING_TIP_H_ #include #include @@ -12,7 +12,7 @@ #include "base/functional/callback_forward.h" #include "base/time/time.h" -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -48,4 +48,4 @@ class DatabaseRecurringTip : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_RECURRING_TIP_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_RECURRING_TIP_H_ diff --git a/components/brave_rewards/core/database/database_server_publisher_banner.cc b/components/brave_rewards/core/internal/database/database_server_publisher_banner.cc similarity index 95% rename from components/brave_rewards/core/database/database_server_publisher_banner.cc rename to components/brave_rewards/core/internal/database/database_server_publisher_banner.cc index 78921cd321a0..bad051eed1ed 100644 --- a/components/brave_rewards/core/database/database_server_publisher_banner.cc +++ b/components/brave_rewards/core/internal/database/database_server_publisher_banner.cc @@ -3,12 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_server_publisher_banner.h" + #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/database/database_server_publisher_banner.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace { diff --git a/components/brave_rewards/core/database/database_server_publisher_banner.h b/components/brave_rewards/core/internal/database/database_server_publisher_banner.h similarity index 75% rename from components/brave_rewards/core/database/database_server_publisher_banner.h rename to components/brave_rewards/core/internal/database/database_server_publisher_banner.h index d08f36856ac0..49732cf1036c 100644 --- a/components/brave_rewards/core/database/database_server_publisher_banner.h +++ b/components/brave_rewards/core/internal/database/database_server_publisher_banner.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SERVER_PUBLISHER_BANNER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SERVER_PUBLISHER_BANNER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SERVER_PUBLISHER_BANNER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SERVER_PUBLISHER_BANNER_H_ #include #include #include #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/database/database_server_publisher_links.h" -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_server_publisher_links.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -47,4 +47,4 @@ class DatabaseServerPublisherBanner : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SERVER_PUBLISHER_BANNER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SERVER_PUBLISHER_BANNER_H_ diff --git a/components/brave_rewards/core/database/database_server_publisher_info.cc b/components/brave_rewards/core/internal/database/database_server_publisher_info.cc similarity index 95% rename from components/brave_rewards/core/database/database_server_publisher_info.cc rename to components/brave_rewards/core/internal/database/database_server_publisher_info.cc index 2e7063bd0d4f..c1a21aad4c7c 100644 --- a/components/brave_rewards/core/database/database_server_publisher_info.cc +++ b/components/brave_rewards/core/internal/database/database_server_publisher_info.cc @@ -3,13 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_server_publisher_info.h" + #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/database/database_server_publisher_info.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace { diff --git a/components/brave_rewards/core/database/database_server_publisher_info.h b/components/brave_rewards/core/internal/database/database_server_publisher_info.h similarity index 77% rename from components/brave_rewards/core/database/database_server_publisher_info.h rename to components/brave_rewards/core/internal/database/database_server_publisher_info.h index e5b2b240cb67..1096c65e8987 100644 --- a/components/brave_rewards/core/database/database_server_publisher_info.h +++ b/components/brave_rewards/core/internal/database/database_server_publisher_info.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SERVER_PUBLISHER_INFO_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SERVER_PUBLISHER_INFO_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SERVER_PUBLISHER_INFO_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SERVER_PUBLISHER_INFO_H_ #include #include #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/database/database_server_publisher_banner.h" -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_server_publisher_banner.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -49,4 +49,4 @@ class DatabaseServerPublisherInfo : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SERVER_PUBLISHER_INFO_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SERVER_PUBLISHER_INFO_H_ diff --git a/components/brave_rewards/core/database/database_server_publisher_links.cc b/components/brave_rewards/core/internal/database/database_server_publisher_links.cc similarity index 93% rename from components/brave_rewards/core/database/database_server_publisher_links.cc rename to components/brave_rewards/core/internal/database/database_server_publisher_links.cc index da74528ddac0..4ad3d84e420b 100644 --- a/components/brave_rewards/core/database/database_server_publisher_links.cc +++ b/components/brave_rewards/core/internal/database/database_server_publisher_links.cc @@ -3,12 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_server_publisher_links.h" + #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/database/database_server_publisher_links.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace { diff --git a/components/brave_rewards/core/database/database_server_publisher_links.h b/components/brave_rewards/core/internal/database/database_server_publisher_links.h similarity index 74% rename from components/brave_rewards/core/database/database_server_publisher_links.h rename to components/brave_rewards/core/internal/database/database_server_publisher_links.h index 86b2496d2bb9..a72ef904ef37 100644 --- a/components/brave_rewards/core/database/database_server_publisher_links.h +++ b/components/brave_rewards/core/internal/database/database_server_publisher_links.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SERVER_PUBLISHER_LINKS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SERVER_PUBLISHER_LINKS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SERVER_PUBLISHER_LINKS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SERVER_PUBLISHER_LINKS_H_ #include #include #include -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -37,4 +37,4 @@ class DatabaseServerPublisherLinks : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SERVER_PUBLISHER_LINKS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SERVER_PUBLISHER_LINKS_H_ diff --git a/components/brave_rewards/core/database/database_sku_order.cc b/components/brave_rewards/core/internal/database/database_sku_order.cc similarity index 97% rename from components/brave_rewards/core/database/database_sku_order.cc rename to components/brave_rewards/core/internal/database/database_sku_order.cc index c23f7e58e564..c899386593b3 100644 --- a/components/brave_rewards/core/database/database_sku_order.cc +++ b/components/brave_rewards/core/internal/database/database_sku_order.cc @@ -3,13 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_sku_order.h" + #include #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/database/database_sku_order.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_sku_order.h b/components/brave_rewards/core/internal/database/database_sku_order.h similarity index 80% rename from components/brave_rewards/core/database/database_sku_order.h rename to components/brave_rewards/core/internal/database/database_sku_order.h index 39d46b1326e4..d18eb110a93b 100644 --- a/components/brave_rewards/core/database/database_sku_order.h +++ b/components/brave_rewards/core/internal/database/database_sku_order.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SKU_ORDER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SKU_ORDER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SKU_ORDER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SKU_ORDER_H_ #include #include #include #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/database/database_sku_order_items.h" -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_sku_order_items.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -54,4 +54,4 @@ class DatabaseSKUOrder : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SKU_ORDER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SKU_ORDER_H_ diff --git a/components/brave_rewards/core/database/database_sku_order_items.cc b/components/brave_rewards/core/internal/database/database_sku_order_items.cc similarity index 94% rename from components/brave_rewards/core/database/database_sku_order_items.cc rename to components/brave_rewards/core/internal/database/database_sku_order_items.cc index 93d951bd292c..75c617a28852 100644 --- a/components/brave_rewards/core/database/database_sku_order_items.cc +++ b/components/brave_rewards/core/internal/database/database_sku_order_items.cc @@ -3,13 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_sku_order_items.h" + #include #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/database/database_sku_order_items.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_sku_order_items.h b/components/brave_rewards/core/internal/database/database_sku_order_items.h similarity index 75% rename from components/brave_rewards/core/database/database_sku_order_items.h rename to components/brave_rewards/core/internal/database/database_sku_order_items.h index 9e44ceadf6d2..0ef352022fda 100644 --- a/components/brave_rewards/core/database/database_sku_order_items.h +++ b/components/brave_rewards/core/internal/database/database_sku_order_items.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SKU_ORDER_ITEMS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SKU_ORDER_ITEMS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SKU_ORDER_ITEMS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SKU_ORDER_ITEMS_H_ #include #include #include -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -37,4 +37,4 @@ class DatabaseSKUOrderItems : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SKU_ORDER_ITEMS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SKU_ORDER_ITEMS_H_ diff --git a/components/brave_rewards/core/database/database_sku_transaction.cc b/components/brave_rewards/core/internal/database/database_sku_transaction.cc similarity index 95% rename from components/brave_rewards/core/database/database_sku_transaction.cc rename to components/brave_rewards/core/internal/database/database_sku_transaction.cc index 10bd365422c9..67e67c976b9b 100644 --- a/components/brave_rewards/core/database/database_sku_transaction.cc +++ b/components/brave_rewards/core/internal/database/database_sku_transaction.cc @@ -3,13 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_sku_transaction.h" + #include #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/database/database_sku_transaction.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_sku_transaction.h b/components/brave_rewards/core/internal/database/database_sku_transaction.h similarity index 79% rename from components/brave_rewards/core/database/database_sku_transaction.h rename to components/brave_rewards/core/internal/database/database_sku_transaction.h index a62db30789e0..a925205f8d34 100644 --- a/components/brave_rewards/core/database/database_sku_transaction.h +++ b/components/brave_rewards/core/internal/database/database_sku_transaction.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SKU_TRANSACTION_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SKU_TRANSACTION_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SKU_TRANSACTION_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SKU_TRANSACTION_H_ #include #include "base/types/expected.h" -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -41,4 +41,4 @@ class DatabaseSKUTransaction : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_SKU_TRANSACTION_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_SKU_TRANSACTION_H_ diff --git a/components/brave_rewards/core/database/database_table.cc b/components/brave_rewards/core/internal/database/database_table.cc similarity index 75% rename from components/brave_rewards/core/database/database_table.cc rename to components/brave_rewards/core/internal/database/database_table.cc index aa8549cee77f..2db1cef45afa 100644 --- a/components/brave_rewards/core/database/database_table.cc +++ b/components/brave_rewards/core/internal/database/database_table.cc @@ -3,8 +3,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/database/database_table.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" + +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/database_table.h b/components/brave_rewards/core/internal/database/database_table.h similarity index 71% rename from components/brave_rewards/core/database/database_table.h rename to components/brave_rewards/core/internal/database/database_table.h index d104d1979956..6e4d519d54cc 100644 --- a/components/brave_rewards/core/database/database_table.h +++ b/components/brave_rewards/core/internal/database/database_table.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_TABLE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_TABLE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_TABLE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_TABLE_H_ #include #include @@ -12,10 +12,10 @@ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_database.mojom.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_database.mojom.h" namespace brave_rewards::internal { class RewardsEngine; @@ -52,4 +52,4 @@ class DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_TABLE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_TABLE_H_ diff --git a/components/brave_rewards/core/database/database_unblinded_token.cc b/components/brave_rewards/core/internal/database/database_unblinded_token.cc similarity index 96% rename from components/brave_rewards/core/database/database_unblinded_token.cc rename to components/brave_rewards/core/internal/database/database_unblinded_token.cc index c6edb52af888..e6c157859748 100644 --- a/components/brave_rewards/core/database/database_unblinded_token.cc +++ b/components/brave_rewards/core/internal/database/database_unblinded_token.cc @@ -3,17 +3,19 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_unblinded_token.h" + #include #include #include +#include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/database/database_unblinded_token.h" -#include "brave/components/brave_rewards/core/database/database_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::database { @@ -330,7 +332,7 @@ void DatabaseUnblindedToken::GetSpendableRecordListByBatchTypes( std::vector in_case; for (const auto& type : batch_types) { - in_case.push_back(std::to_string(static_cast(type))); + in_case.push_back(base::NumberToString(static_cast(type))); } auto transaction = mojom::DBTransaction::New(); diff --git a/components/brave_rewards/core/database/database_unblinded_token.h b/components/brave_rewards/core/internal/database/database_unblinded_token.h similarity index 85% rename from components/brave_rewards/core/database/database_unblinded_token.h rename to components/brave_rewards/core/internal/database/database_unblinded_token.h index 4613db39fa5e..86eb27338eb8 100644 --- a/components/brave_rewards/core/database/database_unblinded_token.h +++ b/components/brave_rewards/core/internal/database/database_unblinded_token.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_UNBLINDED_TOKEN_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_UNBLINDED_TOKEN_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_UNBLINDED_TOKEN_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_UNBLINDED_TOKEN_H_ #include #include -#include "brave/components/brave_rewards/core/database/database_table.h" +#include "brave/components/brave_rewards/core/internal/database/database_table.h" namespace brave_rewards::internal { namespace database { @@ -58,4 +58,4 @@ class DatabaseUnblindedToken : public DatabaseTable { } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_UNBLINDED_TOKEN_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_UNBLINDED_TOKEN_H_ diff --git a/components/brave_rewards/core/database/database_util.cc b/components/brave_rewards/core/internal/database/database_util.cc similarity index 99% rename from components/brave_rewards/core/database/database_util.cc rename to components/brave_rewards/core/internal/database/database_util.cc index 6e725d4e06b1..824feed212c8 100644 --- a/components/brave_rewards/core/database/database_util.cc +++ b/components/brave_rewards/core/internal/database/database_util.cc @@ -3,11 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/database/database_util.h" + #include #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/database/database_util.h" namespace { diff --git a/components/brave_rewards/core/database/database_util.h b/components/brave_rewards/core/internal/database/database_util.h similarity index 83% rename from components/brave_rewards/core/database/database_util.h rename to components/brave_rewards/core/internal/database/database_util.h index 85dd185ce335..9b48d209a71a 100644 --- a/components/brave_rewards/core/database/database_util.h +++ b/components/brave_rewards/core/internal/database/database_util.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_UTIL_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_UTIL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_UTIL_H_ #include #include #include -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" #include "sql/database.h" namespace brave_rewards::internal { @@ -78,4 +78,4 @@ mojom::SKUTransactionType SKUTransactionTypeFromInt(int value); } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_DATABASE_UTIL_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_DATABASE_UTIL_H_ diff --git a/components/brave_rewards/core/database/database_util_unittest.cc b/components/brave_rewards/core/internal/database/database_util_unittest.cc similarity index 91% rename from components/brave_rewards/core/database/database_util_unittest.cc rename to components/brave_rewards/core/internal/database/database_util_unittest.cc index 0414aeb1b2da..5f713987adcb 100644 --- a/components/brave_rewards/core/database/database_util_unittest.cc +++ b/components/brave_rewards/core/internal/database/database_util_unittest.cc @@ -3,7 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/database/database_util.h" +#include "brave/components/brave_rewards/core/internal/database/database_util.h" + #include "testing/gtest/include/gtest/gtest.h" namespace brave_rewards::internal::database { diff --git a/components/brave_rewards/core/database/migration/migration_v1.h b/components/brave_rewards/core/internal/database/migration/migration_v1.h similarity index 87% rename from components/brave_rewards/core/database/migration/migration_v1.h rename to components/brave_rewards/core/internal/database/migration/migration_v1.h index 11dab792c5bb..f3126a5ff0f6 100644 --- a/components/brave_rewards/core/database/migration/migration_v1.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v1.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V1_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V1_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V1_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V1_H_ namespace brave_rewards::internal { namespace database { @@ -62,4 +62,4 @@ const char v1[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V1_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V1_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v10.h b/components/brave_rewards/core/internal/database/migration/migration_v10.h similarity index 89% rename from components/brave_rewards/core/database/migration/migration_v10.h rename to components/brave_rewards/core/internal/database/migration/migration_v10.h index c7ec0938d963..8dd0504cb4ff 100644 --- a/components/brave_rewards/core/database/migration/migration_v10.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v10.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V10_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V10_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V10_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V10_H_ namespace brave_rewards::internal { namespace database { @@ -75,4 +75,4 @@ const char v10[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V10_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V10_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v11.h b/components/brave_rewards/core/internal/database/migration/migration_v11.h similarity index 90% rename from components/brave_rewards/core/database/migration/migration_v11.h rename to components/brave_rewards/core/internal/database/migration/migration_v11.h index efdadb50e45e..0a69a2dcd08c 100644 --- a/components/brave_rewards/core/database/migration/migration_v11.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v11.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V11_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V11_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V11_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V11_H_ namespace brave_rewards::internal { namespace database { @@ -78,4 +78,4 @@ const char v11[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V11_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V11_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v12.h b/components/brave_rewards/core/internal/database/migration/migration_v12.h similarity index 84% rename from components/brave_rewards/core/database/migration/migration_v12.h rename to components/brave_rewards/core/internal/database/migration/migration_v12.h index dceb929061da..8875c67933a2 100644 --- a/components/brave_rewards/core/database/migration/migration_v12.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v12.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V12_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V12_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V12_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V12_H_ namespace brave_rewards::internal { namespace database { @@ -44,4 +44,4 @@ const char v12[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V12_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V12_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v13.h b/components/brave_rewards/core/internal/database/migration/migration_v13.h similarity index 65% rename from components/brave_rewards/core/database/migration/migration_v13.h rename to components/brave_rewards/core/internal/database/migration/migration_v13.h index d923065886ff..611f4bb9fe96 100644 --- a/components/brave_rewards/core/database/migration/migration_v13.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v13.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V13_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V13_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V13_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V13_H_ namespace brave_rewards::internal { namespace database { @@ -18,4 +18,4 @@ const char v13[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V13_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V13_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v14.h b/components/brave_rewards/core/internal/database/migration/migration_v14.h similarity index 70% rename from components/brave_rewards/core/database/migration/migration_v14.h rename to components/brave_rewards/core/internal/database/migration/migration_v14.h index 4f87e2242b06..ca480867f97e 100644 --- a/components/brave_rewards/core/database/migration/migration_v14.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v14.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V14_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V14_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V14_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V14_H_ namespace brave_rewards::internal { namespace database { @@ -21,4 +21,4 @@ const char v14[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V14_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V14_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v15.h b/components/brave_rewards/core/internal/database/migration/migration_v15.h similarity index 97% rename from components/brave_rewards/core/database/migration/migration_v15.h rename to components/brave_rewards/core/internal/database/migration/migration_v15.h index 569af28840ce..dd4b1727ec00 100644 --- a/components/brave_rewards/core/database/migration/migration_v15.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v15.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V15_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V15_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V15_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V15_H_ namespace brave_rewards::internal { namespace database { @@ -276,4 +276,4 @@ const char v15[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V15_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V15_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v16.h b/components/brave_rewards/core/internal/database/migration/migration_v16.h similarity index 70% rename from components/brave_rewards/core/database/migration/migration_v16.h rename to components/brave_rewards/core/internal/database/migration/migration_v16.h index cf4a85788f34..7c6a0c0b7229 100644 --- a/components/brave_rewards/core/database/migration/migration_v16.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v16.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V16_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V16_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V16_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V16_H_ namespace brave_rewards::internal { namespace database { @@ -23,4 +23,4 @@ const char v16[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V16_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V16_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v17.h b/components/brave_rewards/core/internal/database/migration/migration_v17.h similarity index 66% rename from components/brave_rewards/core/database/migration/migration_v17.h rename to components/brave_rewards/core/internal/database/migration/migration_v17.h index 28b5397cccc3..d3304b845b44 100644 --- a/components/brave_rewards/core/database/migration/migration_v17.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v17.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V17_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V17_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V17_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V17_H_ namespace brave_rewards::internal { namespace database { @@ -18,4 +18,4 @@ const char v17[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V17_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V17_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v18.h b/components/brave_rewards/core/internal/database/migration/migration_v18.h similarity index 91% rename from components/brave_rewards/core/database/migration/migration_v18.h rename to components/brave_rewards/core/internal/database/migration/migration_v18.h index 9a35bd2e6cbc..2245dc2ea8a2 100644 --- a/components/brave_rewards/core/database/migration/migration_v18.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v18.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V18_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V18_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V18_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V18_H_ namespace brave_rewards::internal { namespace database { @@ -92,4 +92,4 @@ const char v18[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V18_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V18_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v19.h b/components/brave_rewards/core/internal/database/migration/migration_v19.h similarity index 87% rename from components/brave_rewards/core/database/migration/migration_v19.h rename to components/brave_rewards/core/internal/database/migration/migration_v19.h index 9d206b16161d..6f5dea143248 100644 --- a/components/brave_rewards/core/database/migration/migration_v19.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v19.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V19_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V19_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V19_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V19_H_ namespace brave_rewards::internal { namespace database { @@ -70,4 +70,4 @@ const char v19[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V19_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V19_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v2.h b/components/brave_rewards/core/internal/database/migration/migration_v2.h similarity index 86% rename from components/brave_rewards/core/database/migration/migration_v2.h rename to components/brave_rewards/core/internal/database/migration/migration_v2.h index c01ea7a77a0f..19d140b13ffb 100644 --- a/components/brave_rewards/core/database/migration/migration_v2.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v2.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V2_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V2_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V2_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V2_H_ namespace brave_rewards::internal { namespace database { @@ -55,4 +55,4 @@ const char v2[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V2_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V2_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v20.h b/components/brave_rewards/core/internal/database/migration/migration_v20.h similarity index 76% rename from components/brave_rewards/core/database/migration/migration_v20.h rename to components/brave_rewards/core/internal/database/migration/migration_v20.h index 1dcc76a5c3fe..95765ec6a263 100644 --- a/components/brave_rewards/core/database/migration/migration_v20.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v20.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V20_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V20_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V20_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V20_H_ namespace brave_rewards::internal { namespace database { @@ -28,4 +28,4 @@ const char v20[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V20_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V20_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v21.h b/components/brave_rewards/core/internal/database/migration/migration_v21.h similarity index 85% rename from components/brave_rewards/core/database/migration/migration_v21.h rename to components/brave_rewards/core/internal/database/migration/migration_v21.h index 987cd473acfb..c6029ee7cbff 100644 --- a/components/brave_rewards/core/database/migration/migration_v21.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v21.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V21_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V21_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V21_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V21_H_ namespace brave_rewards::internal { namespace database { @@ -47,4 +47,4 @@ const char v21[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V21_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V21_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v22.h b/components/brave_rewards/core/internal/database/migration/migration_v22.h similarity index 82% rename from components/brave_rewards/core/database/migration/migration_v22.h rename to components/brave_rewards/core/internal/database/migration/migration_v22.h index 3ee5e0342cfa..ae4151bbea4e 100644 --- a/components/brave_rewards/core/database/migration/migration_v22.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v22.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V22_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V22_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V22_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V22_H_ namespace brave_rewards::internal { namespace database { @@ -41,4 +41,4 @@ const char v22[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V22_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V22_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v23.h b/components/brave_rewards/core/internal/database/migration/migration_v23.h similarity index 88% rename from components/brave_rewards/core/database/migration/migration_v23.h rename to components/brave_rewards/core/internal/database/migration/migration_v23.h index b2c75b2934c8..d70b13fd4174 100644 --- a/components/brave_rewards/core/database/migration/migration_v23.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v23.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V23_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V23_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V23_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V23_H_ namespace brave_rewards::internal { namespace database { @@ -62,4 +62,4 @@ const char v23[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V23_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V23_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v24.h b/components/brave_rewards/core/internal/database/migration/migration_v24.h similarity index 67% rename from components/brave_rewards/core/database/migration/migration_v24.h rename to components/brave_rewards/core/internal/database/migration/migration_v24.h index 843a7f4bcfb5..3347a1745c16 100644 --- a/components/brave_rewards/core/database/migration/migration_v24.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v24.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V24_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V24_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V24_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V24_H_ namespace brave_rewards::internal { namespace database { @@ -18,4 +18,4 @@ const char v24[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V24_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V24_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v25.h b/components/brave_rewards/core/internal/database/migration/migration_v25.h similarity index 66% rename from components/brave_rewards/core/database/migration/migration_v25.h rename to components/brave_rewards/core/internal/database/migration/migration_v25.h index f9181563a017..8fc10e7e9e44 100644 --- a/components/brave_rewards/core/database/migration/migration_v25.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v25.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V25_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V25_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V25_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V25_H_ namespace brave_rewards::internal { namespace database { @@ -18,4 +18,4 @@ const char v25[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V25_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V25_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v26.h b/components/brave_rewards/core/internal/database/migration/migration_v26.h similarity index 86% rename from components/brave_rewards/core/database/migration/migration_v26.h rename to components/brave_rewards/core/internal/database/migration/migration_v26.h index 1e0ea7c33fd8..bae4e1faaf22 100644 --- a/components/brave_rewards/core/database/migration/migration_v26.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v26.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V26_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V26_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V26_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V26_H_ namespace brave_rewards::internal { namespace database { @@ -50,4 +50,4 @@ const char v26[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V26_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V26_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v27.h b/components/brave_rewards/core/internal/database/migration/migration_v27.h similarity index 66% rename from components/brave_rewards/core/database/migration/migration_v27.h rename to components/brave_rewards/core/internal/database/migration/migration_v27.h index 66ed7c2f4e61..d66f3179631e 100644 --- a/components/brave_rewards/core/database/migration/migration_v27.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v27.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V27_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V27_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V27_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V27_H_ namespace brave_rewards::internal { namespace database { @@ -18,4 +18,4 @@ const char v27[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V27_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V27_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v28.h b/components/brave_rewards/core/internal/database/migration/migration_v28.h similarity index 86% rename from components/brave_rewards/core/database/migration/migration_v28.h rename to components/brave_rewards/core/internal/database/migration/migration_v28.h index 9e962f8023c9..067e64025023 100644 --- a/components/brave_rewards/core/database/migration/migration_v28.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v28.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V28_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V28_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V28_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V28_H_ namespace brave_rewards::internal { namespace database { @@ -54,4 +54,4 @@ const char v28[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V28_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V28_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v29.h b/components/brave_rewards/core/internal/database/migration/migration_v29.h similarity index 72% rename from components/brave_rewards/core/database/migration/migration_v29.h rename to components/brave_rewards/core/internal/database/migration/migration_v29.h index 683ecd038aaf..e6548449dfd1 100644 --- a/components/brave_rewards/core/database/migration/migration_v29.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v29.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V29_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V29_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V29_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V29_H_ namespace brave_rewards::internal { namespace database { @@ -27,4 +27,4 @@ const char v29[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V29_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V29_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v3.h b/components/brave_rewards/core/internal/database/migration/migration_v3.h similarity index 79% rename from components/brave_rewards/core/database/migration/migration_v3.h rename to components/brave_rewards/core/internal/database/migration/migration_v3.h index 2bfe793efada..330868f31d3f 100644 --- a/components/brave_rewards/core/database/migration/migration_v3.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v3.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V3_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V3_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V3_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V3_H_ namespace brave_rewards::internal { namespace database { @@ -35,4 +35,4 @@ const char v3[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V3_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V3_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v30.h b/components/brave_rewards/core/internal/database/migration/migration_v30.h similarity index 73% rename from components/brave_rewards/core/database/migration/migration_v30.h rename to components/brave_rewards/core/internal/database/migration/migration_v30.h index ae5c9f35c132..1679244b122f 100644 --- a/components/brave_rewards/core/database/migration/migration_v30.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v30.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V30_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V30_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V30_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V30_H_ namespace brave_rewards::internal { namespace database { @@ -22,4 +22,4 @@ const char v30[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V30_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V30_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v31.h b/components/brave_rewards/core/internal/database/migration/migration_v31.h similarity index 73% rename from components/brave_rewards/core/database/migration/migration_v31.h rename to components/brave_rewards/core/internal/database/migration/migration_v31.h index 1124af307c71..a0449030a8c2 100644 --- a/components/brave_rewards/core/database/migration/migration_v31.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v31.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V31_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V31_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V31_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V31_H_ namespace brave_rewards::internal { namespace database { @@ -21,4 +21,4 @@ const char v31[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V31_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V31_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v32.h b/components/brave_rewards/core/internal/database/migration/migration_v32.h similarity index 72% rename from components/brave_rewards/core/database/migration/migration_v32.h rename to components/brave_rewards/core/internal/database/migration/migration_v32.h index 8b6e6daf2ee6..ba03b1b2fd92 100644 --- a/components/brave_rewards/core/database/migration/migration_v32.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v32.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V32_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V32_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V32_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V32_H_ namespace brave_rewards::internal { namespace database { @@ -21,4 +21,4 @@ const char v32[] = R"sql( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V32_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V32_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v33.h b/components/brave_rewards/core/internal/database/migration/migration_v33.h similarity index 72% rename from components/brave_rewards/core/database/migration/migration_v33.h rename to components/brave_rewards/core/internal/database/migration/migration_v33.h index 2cb4c35e8619..fd33c965b2b9 100644 --- a/components/brave_rewards/core/database/migration/migration_v33.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v33.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V33_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V33_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V33_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V33_H_ namespace brave_rewards::internal { namespace database { @@ -22,4 +22,4 @@ const char v33[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V33_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V33_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v34.h b/components/brave_rewards/core/internal/database/migration/migration_v34.h similarity index 71% rename from components/brave_rewards/core/database/migration/migration_v34.h rename to components/brave_rewards/core/internal/database/migration/migration_v34.h index d6c5e5df0ff6..52a9080c25cf 100644 --- a/components/brave_rewards/core/database/migration/migration_v34.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v34.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V34_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V34_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V34_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V34_H_ namespace brave_rewards::internal { namespace database { @@ -20,4 +20,4 @@ const char v34[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V34_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V34_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v35.h b/components/brave_rewards/core/internal/database/migration/migration_v35.h similarity index 73% rename from components/brave_rewards/core/database/migration/migration_v35.h rename to components/brave_rewards/core/internal/database/migration/migration_v35.h index a2cd2eb2be37..28725c89fee7 100644 --- a/components/brave_rewards/core/database/migration/migration_v35.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v35.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V35_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V35_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V35_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V35_H_ namespace brave_rewards::internal { namespace database { @@ -23,4 +23,4 @@ const char v35[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V35_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V35_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v36.h b/components/brave_rewards/core/internal/database/migration/migration_v36.h similarity index 68% rename from components/brave_rewards/core/database/migration/migration_v36.h rename to components/brave_rewards/core/internal/database/migration/migration_v36.h index dd3a5b9580a0..3805c9dbe8b4 100644 --- a/components/brave_rewards/core/database/migration/migration_v36.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v36.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V36_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V36_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V36_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V36_H_ namespace brave_rewards::internal::database::migration { @@ -16,4 +16,4 @@ const char v36[] = R"( } // namespace brave_rewards::internal::database::migration -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V36_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V36_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v37.h b/components/brave_rewards/core/internal/database/migration/migration_v37.h similarity index 78% rename from components/brave_rewards/core/database/migration/migration_v37.h rename to components/brave_rewards/core/internal/database/migration/migration_v37.h index 167b409f821b..fe55c560a93c 100644 --- a/components/brave_rewards/core/database/migration/migration_v37.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v37.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V37_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V37_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V37_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V37_H_ namespace brave_rewards::internal::database::migration { @@ -25,4 +25,4 @@ inline constexpr char v37[] = } // namespace brave_rewards::internal::database::migration -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V37_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V37_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v38.h b/components/brave_rewards/core/internal/database/migration/migration_v38.h similarity index 73% rename from components/brave_rewards/core/database/migration/migration_v38.h rename to components/brave_rewards/core/internal/database/migration/migration_v38.h index 1b09d144a52c..2fed966d01c4 100644 --- a/components/brave_rewards/core/database/migration/migration_v38.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v38.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V38_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V38_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V38_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V38_H_ namespace brave_rewards::internal::database::migration { @@ -17,4 +17,4 @@ inline constexpr char v38[] = R"sql( } // namespace brave_rewards::internal::database::migration -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V38_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V38_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v39.h b/components/brave_rewards/core/internal/database/migration/migration_v39.h similarity index 69% rename from components/brave_rewards/core/database/migration/migration_v39.h rename to components/brave_rewards/core/internal/database/migration/migration_v39.h index eb70e34b5a4c..a7cd267d6247 100644 --- a/components/brave_rewards/core/database/migration/migration_v39.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v39.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V39_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V39_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V39_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V39_H_ namespace brave_rewards::internal::database::migration { @@ -16,4 +16,4 @@ inline constexpr char v39[] = R"sql( } // namespace brave_rewards::internal::database::migration -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V39_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V39_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v4.h b/components/brave_rewards/core/internal/database/migration/migration_v4.h similarity index 86% rename from components/brave_rewards/core/database/migration/migration_v4.h rename to components/brave_rewards/core/internal/database/migration/migration_v4.h index 97266b96fabd..1628c9e3ee5f 100644 --- a/components/brave_rewards/core/database/migration/migration_v4.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v4.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V4_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V4_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V4_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V4_H_ namespace brave_rewards::internal { namespace database { @@ -51,4 +51,4 @@ const char v4[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V4_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V4_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v40.h b/components/brave_rewards/core/internal/database/migration/migration_v40.h similarity index 68% rename from components/brave_rewards/core/database/migration/migration_v40.h rename to components/brave_rewards/core/internal/database/migration/migration_v40.h index d5cffe163bd5..b85e81168ae5 100644 --- a/components/brave_rewards/core/database/migration/migration_v40.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v40.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V40_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V40_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V40_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V40_H_ namespace brave_rewards::internal::database::migration { @@ -16,4 +16,4 @@ inline constexpr char v40[] = R"sql( } // namespace brave_rewards::internal::database::migration -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V40_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V40_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v5.h b/components/brave_rewards/core/internal/database/migration/migration_v5.h similarity index 66% rename from components/brave_rewards/core/database/migration/migration_v5.h rename to components/brave_rewards/core/internal/database/migration/migration_v5.h index 66e3d98d8bf0..b46b7a06d982 100644 --- a/components/brave_rewards/core/database/migration/migration_v5.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v5.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V5_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V5_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V5_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V5_H_ namespace brave_rewards::internal { namespace database { @@ -18,4 +18,4 @@ const char v5[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V5_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V5_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v6.h b/components/brave_rewards/core/internal/database/migration/migration_v6.h similarity index 86% rename from components/brave_rewards/core/database/migration/migration_v6.h rename to components/brave_rewards/core/internal/database/migration/migration_v6.h index 50cdb78f208e..00ada64a8122 100644 --- a/components/brave_rewards/core/database/migration/migration_v6.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v6.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V6_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V6_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V6_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V6_H_ namespace brave_rewards::internal { namespace database { @@ -49,4 +49,4 @@ const char v6[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V6_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V6_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v7.h b/components/brave_rewards/core/internal/database/migration/migration_v7.h similarity index 92% rename from components/brave_rewards/core/database/migration/migration_v7.h rename to components/brave_rewards/core/internal/database/migration/migration_v7.h index 40dea79154cb..a521d504c75c 100644 --- a/components/brave_rewards/core/database/migration/migration_v7.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v7.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V7_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V7_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V7_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V7_H_ namespace brave_rewards::internal { namespace database { @@ -105,4 +105,4 @@ const char v7[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V7_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V7_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v8.h b/components/brave_rewards/core/internal/database/migration/migration_v8.h similarity index 89% rename from components/brave_rewards/core/database/migration/migration_v8.h rename to components/brave_rewards/core/internal/database/migration/migration_v8.h index 5e869af72c1f..f23ee25657ef 100644 --- a/components/brave_rewards/core/database/migration/migration_v8.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v8.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V8_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V8_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V8_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V8_H_ namespace brave_rewards::internal { namespace database { @@ -71,4 +71,4 @@ const char v8[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V8_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V8_H_ diff --git a/components/brave_rewards/core/database/migration/migration_v9.h b/components/brave_rewards/core/internal/database/migration/migration_v9.h similarity index 84% rename from components/brave_rewards/core/database/migration/migration_v9.h rename to components/brave_rewards/core/internal/database/migration/migration_v9.h index 7a1d4afc85c7..d1bf42fe8cb7 100644 --- a/components/brave_rewards/core/database/migration/migration_v9.h +++ b/components/brave_rewards/core/internal/database/migration/migration_v9.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V9_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V9_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V9_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V9_H_ namespace brave_rewards::internal { namespace database { @@ -45,4 +45,4 @@ const char v9[] = R"( } // namespace database } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_DATABASE_MIGRATION_MIGRATION_V9_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_DATABASE_MIGRATION_MIGRATION_V9_H_ diff --git a/components/brave_rewards/core/endpoint/bitflyer/bitflyer_server.cc b/components/brave_rewards/core/internal/endpoint/bitflyer/bitflyer_server.cc similarity index 75% rename from components/brave_rewards/core/endpoint/bitflyer/bitflyer_server.cc rename to components/brave_rewards/core/internal/endpoint/bitflyer/bitflyer_server.cc index e39fefb2ab46..66b9a9462c4b 100644 --- a/components/brave_rewards/core/endpoint/bitflyer/bitflyer_server.cc +++ b/components/brave_rewards/core/internal/endpoint/bitflyer/bitflyer_server.cc @@ -3,9 +3,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/bitflyer/bitflyer_server.h" +#include "brave/components/brave_rewards/core/internal/endpoint/bitflyer/bitflyer_server.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::endpoint { diff --git a/components/brave_rewards/core/endpoint/bitflyer/bitflyer_server.h b/components/brave_rewards/core/internal/endpoint/bitflyer/bitflyer_server.h similarity index 59% rename from components/brave_rewards/core/endpoint/bitflyer/bitflyer_server.h rename to components/brave_rewards/core/internal/endpoint/bitflyer/bitflyer_server.h index ea119812e5d5..60fae9a4db74 100644 --- a/components/brave_rewards/core/endpoint/bitflyer/bitflyer_server.h +++ b/components/brave_rewards/core/internal/endpoint/bitflyer/bitflyer_server.h @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_BITFLYER_BITFLYER_SERVER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_BITFLYER_BITFLYER_SERVER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_BITFLYER_BITFLYER_SERVER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_BITFLYER_BITFLYER_SERVER_H_ -#include "brave/components/brave_rewards/core/endpoint/bitflyer/get_balance/get_balance_bitflyer.h" -#include "brave/components/brave_rewards/core/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h" +#include "brave/components/brave_rewards/core/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.h" +#include "brave/components/brave_rewards/core/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h" namespace brave_rewards::internal { class RewardsEngine; @@ -31,4 +31,4 @@ class BitflyerServer { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_BITFLYER_BITFLYER_SERVER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_BITFLYER_BITFLYER_SERVER_H_ diff --git a/components/brave_rewards/core/endpoint/bitflyer/get_balance/get_balance_bitflyer.cc b/components/brave_rewards/core/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.cc similarity index 91% rename from components/brave_rewards/core/endpoint/bitflyer/get_balance/get_balance_bitflyer.cc rename to components/brave_rewards/core/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.cc index 63b22de52ea4..5ccf9f9b1d4b 100644 --- a/components/brave_rewards/core/endpoint/bitflyer/get_balance/get_balance_bitflyer.cc +++ b/components/brave_rewards/core/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.cc @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/bitflyer/get_balance/get_balance_bitflyer.h" +#include "brave/components/brave_rewards/core/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.h" #include #include #include "base/json/json_reader.h" #include "base/strings/string_number_conversions.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::bitflyer { diff --git a/components/brave_rewards/core/endpoint/bitflyer/get_balance/get_balance_bitflyer.h b/components/brave_rewards/core/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.h similarity index 81% rename from components/brave_rewards/core/endpoint/bitflyer/get_balance/get_balance_bitflyer.h rename to components/brave_rewards/core/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.h index 3bd6d310c9c8..ab73633beb9e 100644 --- a/components/brave_rewards/core/endpoint/bitflyer/get_balance/get_balance_bitflyer.h +++ b/components/brave_rewards/core/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_BITFLYER_GET_BALANCE_GET_BALANCE_BITFLYER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_BITFLYER_GET_BALANCE_GET_BALANCE_BITFLYER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_BITFLYER_GET_BALANCE_GET_BALANCE_BITFLYER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_BITFLYER_GET_BALANCE_GET_BALANCE_BITFLYER_H_ #include #include "base/functional/callback_forward.h" #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" // GET https://bitflyer.com/api/link/v1/account/inventory // @@ -74,4 +74,4 @@ class GetBalance { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_BITFLYER_GET_BALANCE_GET_BALANCE_BITFLYER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_BITFLYER_GET_BALANCE_GET_BALANCE_BITFLYER_H_ diff --git a/components/brave_rewards/core/endpoint/bitflyer/get_balance/get_balance_bitflyer_unittest.cc b/components/brave_rewards/core/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer_unittest.cc similarity index 92% rename from components/brave_rewards/core/endpoint/bitflyer/get_balance/get_balance_bitflyer_unittest.cc rename to components/brave_rewards/core/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer_unittest.cc index 8c848e248543..e7ac3ac279ee 100644 --- a/components/brave_rewards/core/endpoint/bitflyer/get_balance/get_balance_bitflyer_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer_unittest.cc @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/bitflyer/get_balance/get_balance_bitflyer.h" +#include "brave/components/brave_rewards/core/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer.h" #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.cc b/components/brave_rewards/core/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.cc similarity index 93% rename from components/brave_rewards/core/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.cc rename to components/brave_rewards/core/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.cc index 503263df725b..afeb99015077 100644 --- a/components/brave_rewards/core/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.cc +++ b/components/brave_rewards/core/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h" +#include "brave/components/brave_rewards/core/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h" #include #include @@ -13,9 +13,9 @@ #include "base/json/json_writer.h" #include "base/strings/strcat.h" #include "base/uuid.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::bitflyer { diff --git a/components/brave_rewards/core/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h b/components/brave_rewards/core/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h similarity index 86% rename from components/brave_rewards/core/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h rename to components/brave_rewards/core/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h index 6b3902905015..c90a16243521 100644 --- a/components/brave_rewards/core/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h +++ b/components/brave_rewards/core/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_BITFLYER_POST_OAUTH_POST_OAUTH_BITFLYER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_BITFLYER_POST_OAUTH_POST_OAUTH_BITFLYER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_BITFLYER_POST_OAUTH_POST_OAUTH_BITFLYER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_BITFLYER_POST_OAUTH_POST_OAUTH_BITFLYER_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" // POST https://bitflyer.com/api/link/v1/token // @@ -85,4 +85,4 @@ class PostOauth { } // namespace endpoint::bitflyer } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_BITFLYER_POST_OAUTH_POST_OAUTH_BITFLYER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_BITFLYER_POST_OAUTH_POST_OAUTH_BITFLYER_H_ diff --git a/components/brave_rewards/core/endpoint/bitflyer/post_oauth/post_oauth_bitflyer_unittest.cc b/components/brave_rewards/core/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer_unittest.cc similarity index 89% rename from components/brave_rewards/core/endpoint/bitflyer/post_oauth/post_oauth_bitflyer_unittest.cc rename to components/brave_rewards/core/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer_unittest.cc index e70bceac3dd3..ff28ac012771 100644 --- a/components/brave_rewards/core/endpoint/bitflyer/post_oauth/post_oauth_bitflyer_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h" +#include "brave/components/brave_rewards/core/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/gemini/gemini_server.cc b/components/brave_rewards/core/internal/endpoint/gemini/gemini_server.cc similarity index 78% rename from components/brave_rewards/core/endpoint/gemini/gemini_server.cc rename to components/brave_rewards/core/internal/endpoint/gemini/gemini_server.cc index 20ba752c03f8..beed948570bd 100644 --- a/components/brave_rewards/core/endpoint/gemini/gemini_server.cc +++ b/components/brave_rewards/core/internal/endpoint/gemini/gemini_server.cc @@ -3,9 +3,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/gemini/gemini_server.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/gemini_server.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::endpoint { diff --git a/components/brave_rewards/core/endpoint/gemini/gemini_server.h b/components/brave_rewards/core/internal/endpoint/gemini/gemini_server.h similarity index 57% rename from components/brave_rewards/core/endpoint/gemini/gemini_server.h rename to components/brave_rewards/core/internal/endpoint/gemini/gemini_server.h index 763b909746ef..e66d02358044 100644 --- a/components/brave_rewards/core/endpoint/gemini/gemini_server.h +++ b/components/brave_rewards/core/internal/endpoint/gemini/gemini_server.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_GEMINI_SERVER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_GEMINI_SERVER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_GEMINI_SERVER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_GEMINI_SERVER_H_ -#include "brave/components/brave_rewards/core/endpoint/gemini/post_account/post_account_gemini.h" -#include "brave/components/brave_rewards/core/endpoint/gemini/post_balance/post_balance_gemini.h" -#include "brave/components/brave_rewards/core/endpoint/gemini/post_oauth/post_oauth_gemini.h" -#include "brave/components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/post_account/post_account_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/post_balance/post_balance_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/post_oauth/post_oauth_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h" namespace brave_rewards::internal { class RewardsEngine; @@ -39,4 +39,4 @@ class GeminiServer { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_GEMINI_SERVER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_GEMINI_SERVER_H_ diff --git a/components/brave_rewards/core/endpoint/gemini/post_account/post_account_gemini.cc b/components/brave_rewards/core/internal/endpoint/gemini/post_account/post_account_gemini.cc similarity index 91% rename from components/brave_rewards/core/endpoint/gemini/post_account/post_account_gemini.cc rename to components/brave_rewards/core/internal/endpoint/gemini/post_account/post_account_gemini.cc index 6ac1bcb70529..4709a4760125 100644 --- a/components/brave_rewards/core/endpoint/gemini/post_account/post_account_gemini.cc +++ b/components/brave_rewards/core/internal/endpoint/gemini/post_account/post_account_gemini.cc @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/gemini/post_account/post_account_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/post_account/post_account_gemini.h" #include #include #include "base/json/json_reader.h" #include "base/strings/string_number_conversions.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::gemini { diff --git a/components/brave_rewards/core/endpoint/gemini/post_account/post_account_gemini.h b/components/brave_rewards/core/internal/endpoint/gemini/post_account/post_account_gemini.h similarity index 82% rename from components/brave_rewards/core/endpoint/gemini/post_account/post_account_gemini.h rename to components/brave_rewards/core/internal/endpoint/gemini/post_account/post_account_gemini.h index 157032c56d9f..7b99122b99f5 100644 --- a/components/brave_rewards/core/endpoint/gemini/post_account/post_account_gemini.h +++ b/components/brave_rewards/core/internal/endpoint/gemini/post_account/post_account_gemini.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_POST_ACCOUNT_POST_ACCOUNT_GEMINI_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_POST_ACCOUNT_POST_ACCOUNT_GEMINI_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_POST_ACCOUNT_POST_ACCOUNT_GEMINI_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_POST_ACCOUNT_POST_ACCOUNT_GEMINI_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" // POST https://api.sandbox.gemini.com/v1/account // @@ -71,4 +71,4 @@ class PostAccount { } // namespace endpoint::gemini } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_POST_ACCOUNT_POST_ACCOUNT_GEMINI_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_POST_ACCOUNT_POST_ACCOUNT_GEMINI_H_ diff --git a/components/brave_rewards/core/endpoint/gemini/post_account/post_account_gemini_unittest.cc b/components/brave_rewards/core/internal/endpoint/gemini/post_account/post_account_gemini_unittest.cc similarity index 91% rename from components/brave_rewards/core/endpoint/gemini/post_account/post_account_gemini_unittest.cc rename to components/brave_rewards/core/internal/endpoint/gemini/post_account/post_account_gemini_unittest.cc index 17a0a332012f..4fbf9d5813b2 100644 --- a/components/brave_rewards/core/endpoint/gemini/post_account/post_account_gemini_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/gemini/post_account/post_account_gemini_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/gemini/post_account/post_account_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/post_account/post_account_gemini.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/gemini/post_balance/post_balance_gemini.cc b/components/brave_rewards/core/internal/endpoint/gemini/post_balance/post_balance_gemini.cc similarity index 90% rename from components/brave_rewards/core/endpoint/gemini/post_balance/post_balance_gemini.cc rename to components/brave_rewards/core/internal/endpoint/gemini/post_balance/post_balance_gemini.cc index 8097ec9213a6..0c93fdc97823 100644 --- a/components/brave_rewards/core/endpoint/gemini/post_balance/post_balance_gemini.cc +++ b/components/brave_rewards/core/internal/endpoint/gemini/post_balance/post_balance_gemini.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/gemini/post_balance/post_balance_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/post_balance/post_balance_gemini.h" #include #include @@ -11,9 +11,9 @@ #include "base/json/json_reader.h" #include "base/strings/string_number_conversions.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::gemini { diff --git a/components/brave_rewards/core/endpoint/gemini/post_balance/post_balance_gemini.h b/components/brave_rewards/core/internal/endpoint/gemini/post_balance/post_balance_gemini.h similarity index 80% rename from components/brave_rewards/core/endpoint/gemini/post_balance/post_balance_gemini.h rename to components/brave_rewards/core/internal/endpoint/gemini/post_balance/post_balance_gemini.h index 36b29bb5cff8..b5e4502ae152 100644 --- a/components/brave_rewards/core/endpoint/gemini/post_balance/post_balance_gemini.h +++ b/components/brave_rewards/core/internal/endpoint/gemini/post_balance/post_balance_gemini.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_POST_BALANCE_POST_BALANCE_GEMINI_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_POST_BALANCE_POST_BALANCE_GEMINI_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_POST_BALANCE_POST_BALANCE_GEMINI_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_POST_BALANCE_POST_BALANCE_GEMINI_H_ #include #include "base/functional/callback_forward.h" #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" // GET https://gemini.jp/api/link/v1/account/inventory // @@ -72,4 +72,4 @@ class PostBalance { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_POST_BALANCE_POST_BALANCE_GEMINI_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_POST_BALANCE_POST_BALANCE_GEMINI_H_ diff --git a/components/brave_rewards/core/endpoint/gemini/post_balance/post_balance_gemini_unittest.cc b/components/brave_rewards/core/internal/endpoint/gemini/post_balance/post_balance_gemini_unittest.cc similarity index 91% rename from components/brave_rewards/core/endpoint/gemini/post_balance/post_balance_gemini_unittest.cc rename to components/brave_rewards/core/internal/endpoint/gemini/post_balance/post_balance_gemini_unittest.cc index c2e91d3abac0..58808f3ce31c 100644 --- a/components/brave_rewards/core/endpoint/gemini/post_balance/post_balance_gemini_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/gemini/post_balance/post_balance_gemini_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/gemini/post_balance/post_balance_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/post_balance/post_balance_gemini.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/gemini/post_oauth/post_oauth_gemini.cc b/components/brave_rewards/core/internal/endpoint/gemini/post_oauth/post_oauth_gemini.cc similarity index 90% rename from components/brave_rewards/core/endpoint/gemini/post_oauth/post_oauth_gemini.cc rename to components/brave_rewards/core/internal/endpoint/gemini/post_oauth/post_oauth_gemini.cc index 68bf120704ec..3ed593dcff2e 100644 --- a/components/brave_rewards/core/endpoint/gemini/post_oauth/post_oauth_gemini.cc +++ b/components/brave_rewards/core/internal/endpoint/gemini/post_oauth/post_oauth_gemini.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/gemini/post_oauth/post_oauth_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/post_oauth/post_oauth_gemini.h" #include #include @@ -11,9 +11,9 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/uuid.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::gemini { diff --git a/components/brave_rewards/core/endpoint/gemini/post_oauth/post_oauth_gemini.h b/components/brave_rewards/core/internal/endpoint/gemini/post_oauth/post_oauth_gemini.h similarity index 82% rename from components/brave_rewards/core/endpoint/gemini/post_oauth/post_oauth_gemini.h rename to components/brave_rewards/core/internal/endpoint/gemini/post_oauth/post_oauth_gemini.h index d859eaa31855..cbfd8f5c6e15 100644 --- a/components/brave_rewards/core/endpoint/gemini/post_oauth/post_oauth_gemini.h +++ b/components/brave_rewards/core/internal/endpoint/gemini/post_oauth/post_oauth_gemini.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_POST_OAUTH_POST_OAUTH_GEMINI_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_POST_OAUTH_POST_OAUTH_GEMINI_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_POST_OAUTH_POST_OAUTH_GEMINI_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_POST_OAUTH_POST_OAUTH_GEMINI_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" // POST https://exchange.sandbox.gemini.com/auth/token // @@ -71,4 +71,4 @@ class PostOauth { } // namespace endpoint::gemini } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_POST_OAUTH_POST_OAUTH_GEMINI_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_POST_OAUTH_POST_OAUTH_GEMINI_H_ diff --git a/components/brave_rewards/core/endpoint/gemini/post_oauth/post_oauth_gemini_unittest.cc b/components/brave_rewards/core/internal/endpoint/gemini/post_oauth/post_oauth_gemini_unittest.cc similarity index 86% rename from components/brave_rewards/core/endpoint/gemini/post_oauth/post_oauth_gemini_unittest.cc rename to components/brave_rewards/core/internal/endpoint/gemini/post_oauth/post_oauth_gemini_unittest.cc index cb40807eeaec..c1ed1c848297 100644 --- a/components/brave_rewards/core/endpoint/gemini/post_oauth/post_oauth_gemini_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/gemini/post_oauth/post_oauth_gemini_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/gemini/post_oauth/post_oauth_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/post_oauth/post_oauth_gemini.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.cc b/components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.cc similarity index 90% rename from components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.cc rename to components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.cc index 25aa1911f838..d42b91174617 100644 --- a/components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.cc +++ b/components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h" #include #include @@ -12,9 +12,9 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/uuid.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::gemini { diff --git a/components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h b/components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h similarity index 78% rename from components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h rename to components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h index d234c50da369..bd4e84cc793a 100644 --- a/components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h +++ b/components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_POST_RECIPIENT_ID_POST_RECIPIENT_ID_GEMINI_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_POST_RECIPIENT_ID_POST_RECIPIENT_ID_GEMINI_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_POST_RECIPIENT_ID_POST_RECIPIENT_ID_GEMINI_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_POST_RECIPIENT_ID_POST_RECIPIENT_ID_GEMINI_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" // POST https://api.gemini.com/v1/payments/recipientIds // Payload: @@ -69,4 +69,4 @@ class PostRecipientId { } // namespace endpoint::gemini } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_GEMINI_POST_RECIPIENT_ID_POST_RECIPIENT_ID_GEMINI_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_GEMINI_POST_RECIPIENT_ID_POST_RECIPIENT_ID_GEMINI_H_ diff --git a/components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini_unittest.cc b/components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini_unittest.cc similarity index 91% rename from components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini_unittest.cc rename to components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini_unittest.cc index 872b9816a85c..9d2f9dfdd4ef 100644 --- a/components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/payment/get_credentials/get_credentials.cc b/components/brave_rewards/core/internal/endpoint/payment/get_credentials/get_credentials.cc similarity index 91% rename from components/brave_rewards/core/endpoint/payment/get_credentials/get_credentials.cc rename to components/brave_rewards/core/internal/endpoint/payment/get_credentials/get_credentials.cc index 93e93b947ccb..f3e5bcf03a84 100644 --- a/components/brave_rewards/core/endpoint/payment/get_credentials/get_credentials.cc +++ b/components/brave_rewards/core/internal/endpoint/payment/get_credentials/get_credentials.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/payment/get_credentials/get_credentials.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/get_credentials/get_credentials.h" #include #include @@ -11,9 +11,9 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::payment { diff --git a/components/brave_rewards/core/endpoint/payment/get_credentials/get_credentials.h b/components/brave_rewards/core/internal/endpoint/payment/get_credentials/get_credentials.h similarity index 82% rename from components/brave_rewards/core/endpoint/payment/get_credentials/get_credentials.h rename to components/brave_rewards/core/internal/endpoint/payment/get_credentials/get_credentials.h index dac8ff57b800..340a2b190570 100644 --- a/components/brave_rewards/core/endpoint/payment/get_credentials/get_credentials.h +++ b/components/brave_rewards/core/internal/endpoint/payment/get_credentials/get_credentials.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_GET_CREDENTIALS_GET_CREDENTIALS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_GET_CREDENTIALS_GET_CREDENTIALS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_GET_CREDENTIALS_GET_CREDENTIALS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_GET_CREDENTIALS_GET_CREDENTIALS_H_ #include #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // GET /v1/promotions/{promotion_id}/claims/{claim_id} // @@ -80,4 +80,4 @@ class GetCredentials { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_GET_CREDENTIALS_GET_CREDENTIALS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_GET_CREDENTIALS_GET_CREDENTIALS_H_ diff --git a/components/brave_rewards/core/endpoint/payment/get_credentials/get_credentials_unittest.cc b/components/brave_rewards/core/internal/endpoint/payment/get_credentials/get_credentials_unittest.cc similarity index 92% rename from components/brave_rewards/core/endpoint/payment/get_credentials/get_credentials_unittest.cc rename to components/brave_rewards/core/internal/endpoint/payment/get_credentials/get_credentials_unittest.cc index c7d6b74a9866..5a52d8d08e35 100644 --- a/components/brave_rewards/core/endpoint/payment/get_credentials/get_credentials_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/payment/get_credentials/get_credentials_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/payment/get_credentials/get_credentials.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/get_credentials/get_credentials.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/payment/payment_server.cc b/components/brave_rewards/core/internal/endpoint/payment/payment_server.cc similarity index 80% rename from components/brave_rewards/core/endpoint/payment/payment_server.cc rename to components/brave_rewards/core/internal/endpoint/payment/payment_server.cc index 20c55282f454..773476ebb0a3 100644 --- a/components/brave_rewards/core/endpoint/payment/payment_server.cc +++ b/components/brave_rewards/core/internal/endpoint/payment/payment_server.cc @@ -3,9 +3,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/payment/payment_server.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/payment_server.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::endpoint { diff --git a/components/brave_rewards/core/endpoint/payment/payment_server.h b/components/brave_rewards/core/internal/endpoint/payment/payment_server.h similarity index 58% rename from components/brave_rewards/core/endpoint/payment/payment_server.h rename to components/brave_rewards/core/internal/endpoint/payment/payment_server.h index ae7fa75d3503..2bdb8dd2f8ec 100644 --- a/components/brave_rewards/core/endpoint/payment/payment_server.h +++ b/components/brave_rewards/core/internal/endpoint/payment/payment_server.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_PAYMENT_SERVER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_PAYMENT_SERVER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_PAYMENT_SERVER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_PAYMENT_SERVER_H_ -#include "brave/components/brave_rewards/core/endpoint/payment/get_credentials/get_credentials.h" -#include "brave/components/brave_rewards/core/endpoint/payment/post_credentials/post_credentials.h" -#include "brave/components/brave_rewards/core/endpoint/payment/post_order/post_order.h" -#include "brave/components/brave_rewards/core/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h" -#include "brave/components/brave_rewards/core/endpoint/payment/post_transaction_uphold/post_transaction_uphold.h" -#include "brave/components/brave_rewards/core/endpoint/payment/post_votes/post_votes.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/get_credentials/get_credentials.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_credentials/post_credentials.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_order/post_order.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_votes/post_votes.h" namespace brave_rewards::internal { class RewardsEngine; @@ -51,4 +51,4 @@ class PaymentServer { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_PAYMENT_SERVER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_PAYMENT_SERVER_H_ diff --git a/components/brave_rewards/core/endpoint/payment/post_credentials/post_credentials.cc b/components/brave_rewards/core/internal/endpoint/payment/post_credentials/post_credentials.cc similarity index 89% rename from components/brave_rewards/core/endpoint/payment/post_credentials/post_credentials.cc rename to components/brave_rewards/core/internal/endpoint/payment/post_credentials/post_credentials.cc index e8d620babe01..4d0a3cef1d39 100644 --- a/components/brave_rewards/core/endpoint/payment/post_credentials/post_credentials.cc +++ b/components/brave_rewards/core/internal/endpoint/payment/post_credentials/post_credentials.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/payment/post_credentials/post_credentials.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_credentials/post_credentials.h" #include #include "base/json/json_writer.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::payment { diff --git a/components/brave_rewards/core/endpoint/payment/post_credentials/post_credentials.h b/components/brave_rewards/core/internal/endpoint/payment/post_credentials/post_credentials.h similarity index 82% rename from components/brave_rewards/core/endpoint/payment/post_credentials/post_credentials.h rename to components/brave_rewards/core/internal/endpoint/payment/post_credentials/post_credentials.h index 9bbb000d8306..7246065e22dd 100644 --- a/components/brave_rewards/core/endpoint/payment/post_credentials/post_credentials.h +++ b/components/brave_rewards/core/internal/endpoint/payment/post_credentials/post_credentials.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_CREDENTIALS_POST_CREDENTIALS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_CREDENTIALS_POST_CREDENTIALS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_CREDENTIALS_POST_CREDENTIALS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_CREDENTIALS_POST_CREDENTIALS_H_ #include #include #include "base/memory/raw_ref.h" #include "base/values.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" // POST /v1/orders/{order_id}/credentials // @@ -74,4 +74,4 @@ class PostCredentials { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_CREDENTIALS_POST_CREDENTIALS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_CREDENTIALS_POST_CREDENTIALS_H_ diff --git a/components/brave_rewards/core/endpoint/payment/post_credentials/post_credentials_unittest.cc b/components/brave_rewards/core/internal/endpoint/payment/post_credentials/post_credentials_unittest.cc similarity index 89% rename from components/brave_rewards/core/endpoint/payment/post_credentials/post_credentials_unittest.cc rename to components/brave_rewards/core/internal/endpoint/payment/post_credentials/post_credentials_unittest.cc index e20133acc7ac..1a229e079737 100644 --- a/components/brave_rewards/core/endpoint/payment/post_credentials/post_credentials_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/payment/post_credentials/post_credentials_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/payment/post_credentials/post_credentials.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_credentials/post_credentials.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/payment/post_order/post_order.cc b/components/brave_rewards/core/internal/endpoint/payment/post_order/post_order.cc similarity index 94% rename from components/brave_rewards/core/endpoint/payment/post_order/post_order.cc rename to components/brave_rewards/core/internal/endpoint/payment/post_order/post_order.cc index 59cbbbeff91c..234a408b578a 100644 --- a/components/brave_rewards/core/endpoint/payment/post_order/post_order.cc +++ b/components/brave_rewards/core/internal/endpoint/payment/post_order/post_order.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/payment/post_order/post_order.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_order/post_order.h" #include #include @@ -11,9 +11,9 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/strings/string_number_conversions.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::payment { diff --git a/components/brave_rewards/core/endpoint/payment/post_order/post_order.h b/components/brave_rewards/core/internal/endpoint/payment/post_order/post_order.h similarity index 85% rename from components/brave_rewards/core/endpoint/payment/post_order/post_order.h rename to components/brave_rewards/core/internal/endpoint/payment/post_order/post_order.h index cb9a62a3d722..74fd2aa94387 100644 --- a/components/brave_rewards/core/endpoint/payment/post_order/post_order.h +++ b/components/brave_rewards/core/internal/endpoint/payment/post_order/post_order.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_ORDER_POST_ORDER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_ORDER_POST_ORDER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_ORDER_POST_ORDER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_ORDER_POST_ORDER_H_ #include #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // POST /v1/orders // @@ -97,4 +97,4 @@ class PostOrder { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_ORDER_POST_ORDER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_ORDER_POST_ORDER_H_ diff --git a/components/brave_rewards/core/endpoint/payment/post_order/post_order_unittest.cc b/components/brave_rewards/core/internal/endpoint/payment/post_order/post_order_unittest.cc similarity index 93% rename from components/brave_rewards/core/endpoint/payment/post_order/post_order_unittest.cc rename to components/brave_rewards/core/internal/endpoint/payment/post_order/post_order_unittest.cc index 1e86dfd8fa97..7f327bd4a564 100644 --- a/components/brave_rewards/core/endpoint/payment/post_order/post_order_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/payment/post_order/post_order_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/payment/post_order/post_order.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_order/post_order.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.cc b/components/brave_rewards/core/internal/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.cc similarity index 90% rename from components/brave_rewards/core/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.cc rename to components/brave_rewards/core/internal/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.cc index ddbd83b0294d..6ba4af5676cb 100644 --- a/components/brave_rewards/core/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.cc +++ b/components/brave_rewards/core/internal/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h" #include #include "base/json/json_writer.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::payment { diff --git a/components/brave_rewards/core/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h b/components/brave_rewards/core/internal/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h similarity index 78% rename from components/brave_rewards/core/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h rename to components/brave_rewards/core/internal/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h index 5b04be18fd2c..2b3e938e0a2a 100644 --- a/components/brave_rewards/core/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h +++ b/components/brave_rewards/core/internal/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_TRANSACTION_GEMINI_POST_TRANSACTION_SKU_GEMINI_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_TRANSACTION_GEMINI_POST_TRANSACTION_SKU_GEMINI_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_TRANSACTION_GEMINI_POST_TRANSACTION_SKU_GEMINI_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_TRANSACTION_GEMINI_POST_TRANSACTION_SKU_GEMINI_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // POST /v1/orders/{order_id}/transactions/gemini // @@ -76,4 +76,4 @@ class PostTransactionGemini { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_TRANSACTION_GEMINI_POST_TRANSACTION_SKU_GEMINI_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_TRANSACTION_GEMINI_POST_TRANSACTION_SKU_GEMINI_H_ diff --git a/components/brave_rewards/core/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini_unittest.cc b/components/brave_rewards/core/internal/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini_unittest.cc similarity index 89% rename from components/brave_rewards/core/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini_unittest.cc rename to components/brave_rewards/core/internal/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini_unittest.cc index e1227422f27d..1251498dc995 100644 --- a/components/brave_rewards/core/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/payment/post_transaction_uphold/post_transaction_uphold.cc b/components/brave_rewards/core/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold.cc similarity index 89% rename from components/brave_rewards/core/endpoint/payment/post_transaction_uphold/post_transaction_uphold.cc rename to components/brave_rewards/core/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold.cc index c77ee2073637..f40a111bd64b 100644 --- a/components/brave_rewards/core/endpoint/payment/post_transaction_uphold/post_transaction_uphold.cc +++ b/components/brave_rewards/core/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/payment/post_transaction_uphold/post_transaction_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold.h" #include #include "base/json/json_writer.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::payment { diff --git a/components/brave_rewards/core/endpoint/payment/post_transaction_uphold/post_transaction_uphold.h b/components/brave_rewards/core/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold.h similarity index 79% rename from components/brave_rewards/core/endpoint/payment/post_transaction_uphold/post_transaction_uphold.h rename to components/brave_rewards/core/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold.h index d0415d16871e..5924a15bb5e2 100644 --- a/components/brave_rewards/core/endpoint/payment/post_transaction_uphold/post_transaction_uphold.h +++ b/components/brave_rewards/core/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_TRANSACTION_UPHOLD_POST_TRANSACTION_UPHOLD_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_TRANSACTION_UPHOLD_POST_TRANSACTION_UPHOLD_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_TRANSACTION_UPHOLD_POST_TRANSACTION_UPHOLD_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_TRANSACTION_UPHOLD_POST_TRANSACTION_UPHOLD_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // POST /v1/orders/{order_id}/transactions/uphold // @@ -76,4 +76,4 @@ class PostTransactionUphold { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_TRANSACTION_UPHOLD_POST_TRANSACTION_UPHOLD_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_TRANSACTION_UPHOLD_POST_TRANSACTION_UPHOLD_H_ diff --git a/components/brave_rewards/core/endpoint/payment/post_transaction_uphold/post_transaction_uphold_unittest.cc b/components/brave_rewards/core/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold_unittest.cc similarity index 89% rename from components/brave_rewards/core/endpoint/payment/post_transaction_uphold/post_transaction_uphold_unittest.cc rename to components/brave_rewards/core/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold_unittest.cc index fa28f9d5639d..586eca6d89c0 100644 --- a/components/brave_rewards/core/endpoint/payment/post_transaction_uphold/post_transaction_uphold_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/payment/post_transaction_uphold/post_transaction_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/payment/post_votes/post_votes.cc b/components/brave_rewards/core/internal/endpoint/payment/post_votes/post_votes.cc similarity index 87% rename from components/brave_rewards/core/endpoint/payment/post_votes/post_votes.cc rename to components/brave_rewards/core/internal/endpoint/payment/post_votes/post_votes.cc index 7362411da2c6..b5980843c460 100644 --- a/components/brave_rewards/core/endpoint/payment/post_votes/post_votes.cc +++ b/components/brave_rewards/core/internal/endpoint/payment/post_votes/post_votes.cc @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/payment/post_votes/post_votes.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_votes/post_votes.h" #include #include "base/base64.h" #include "base/json/json_writer.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/credentials/credentials_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/credentials/credentials_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::payment { diff --git a/components/brave_rewards/core/endpoint/payment/post_votes/post_votes.h b/components/brave_rewards/core/internal/endpoint/payment/post_votes/post_votes.h similarity index 76% rename from components/brave_rewards/core/endpoint/payment/post_votes/post_votes.h rename to components/brave_rewards/core/internal/endpoint/payment/post_votes/post_votes.h index b76902154e9a..2df11c5af496 100644 --- a/components/brave_rewards/core/endpoint/payment/post_votes/post_votes.h +++ b/components/brave_rewards/core/internal/endpoint/payment/post_votes/post_votes.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_VOTES_POST_VOTES_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_VOTES_POST_VOTES_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_VOTES_POST_VOTES_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_VOTES_POST_VOTES_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/credentials/credentials_redeem.h" +#include "brave/components/brave_rewards/core/internal/credentials/credentials_redeem.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" // POST /v1/votes // @@ -68,4 +68,4 @@ class PostVotes { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PAYMENT_POST_VOTES_POST_VOTES_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PAYMENT_POST_VOTES_POST_VOTES_H_ diff --git a/components/brave_rewards/core/endpoint/payment/post_votes/post_votes_unittest.cc b/components/brave_rewards/core/internal/endpoint/payment/post_votes/post_votes_unittest.cc similarity index 90% rename from components/brave_rewards/core/endpoint/payment/post_votes/post_votes_unittest.cc rename to components/brave_rewards/core/internal/endpoint/payment/post_votes/post_votes_unittest.cc index a70c05fb8f6b..44b2c3ac5262 100644 --- a/components/brave_rewards/core/endpoint/payment/post_votes/post_votes_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/payment/post_votes/post_votes_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/payment/post_votes/post_votes.h" +#include "brave/components/brave_rewards/core/internal/endpoint/payment/post_votes/post_votes.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/private_cdn/get_publisher/get_publisher.cc b/components/brave_rewards/core/internal/endpoint/private_cdn/get_publisher/get_publisher.cc similarity index 93% rename from components/brave_rewards/core/endpoint/private_cdn/get_publisher/get_publisher.cc rename to components/brave_rewards/core/internal/endpoint/private_cdn/get_publisher/get_publisher.cc index 952660dcc09e..effab9bc8cc9 100644 --- a/components/brave_rewards/core/endpoint/private_cdn/get_publisher/get_publisher.cc +++ b/components/brave_rewards/core/internal/endpoint/private_cdn/get_publisher/get_publisher.cc @@ -2,7 +2,7 @@ * 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 https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/private_cdn/get_publisher/get_publisher.h" +#include "brave/components/brave_rewards/core/internal/endpoint/private_cdn/get_publisher/get_publisher.h" #include #include @@ -10,12 +10,12 @@ #include "base/strings/strcat.h" #include "base/strings/string_util.h" #include "brave/components/brave_private_cdn/private_cdn_helper.h" -#include "brave/components/brave_rewards/core/common/brotli_util.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/publisher/protos/channel_response.pb.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/brotli_util.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/publisher/protos/channel_response.pb.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/base/load_flags.h" #include "net/http/http_status_code.h" diff --git a/components/brave_rewards/core/endpoint/private_cdn/get_publisher/get_publisher.h b/components/brave_rewards/core/internal/endpoint/private_cdn/get_publisher/get_publisher.h similarity index 78% rename from components/brave_rewards/core/endpoint/private_cdn/get_publisher/get_publisher.h rename to components/brave_rewards/core/internal/endpoint/private_cdn/get_publisher/get_publisher.h index c9272d133389..f89c8d15c651 100644 --- a/components/brave_rewards/core/endpoint/private_cdn/get_publisher/get_publisher.h +++ b/components/brave_rewards/core/internal/endpoint/private_cdn/get_publisher/get_publisher.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PRIVATE_CDN_GET_PUBLISHER_GET_PUBLISHER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PRIVATE_CDN_GET_PUBLISHER_GET_PUBLISHER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PRIVATE_CDN_GET_PUBLISHER_GET_PUBLISHER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PRIVATE_CDN_GET_PUBLISHER_GET_PUBLISHER_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" // GET /publishers/prefixes/{prefix} // @@ -21,7 +21,7 @@ // // Response body: // See -// https://github.com/brave/brave-core/blob/master/components/brave_rewards/core/publisher/protos/channel_response.proto +// https://github.com/brave/brave-core/blob/master/components/brave_rewards/core/internal/publisher/protos/channel_response.proto namespace brave_rewards::internal { class RewardsEngine; @@ -62,4 +62,4 @@ class GetPublisher { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PRIVATE_CDN_GET_PUBLISHER_GET_PUBLISHER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PRIVATE_CDN_GET_PUBLISHER_GET_PUBLISHER_H_ diff --git a/components/brave_rewards/core/endpoint/private_cdn/get_publisher/get_publisher_unittest.cc b/components/brave_rewards/core/internal/endpoint/private_cdn/get_publisher/get_publisher_unittest.cc similarity index 92% rename from components/brave_rewards/core/endpoint/private_cdn/get_publisher/get_publisher_unittest.cc rename to components/brave_rewards/core/internal/endpoint/private_cdn/get_publisher/get_publisher_unittest.cc index 4309436d3f30..de7f5788a4e7 100644 --- a/components/brave_rewards/core/endpoint/private_cdn/get_publisher/get_publisher_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/private_cdn/get_publisher/get_publisher_unittest.cc @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/private_cdn/get_publisher/get_publisher.h" +#include "brave/components/brave_rewards/core/internal/endpoint/private_cdn/get_publisher/get_publisher.h" #include #include #include "base/containers/span.h" #include "base/numerics/byte_conversions.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/publisher/protos/channel_response.pb.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/publisher/protos/channel_response.pb.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/private_cdn/private_cdn_server.cc b/components/brave_rewards/core/internal/endpoint/private_cdn/private_cdn_server.cc similarity index 74% rename from components/brave_rewards/core/endpoint/private_cdn/private_cdn_server.cc rename to components/brave_rewards/core/internal/endpoint/private_cdn/private_cdn_server.cc index 0e6a7f12246c..8042efe9013b 100644 --- a/components/brave_rewards/core/endpoint/private_cdn/private_cdn_server.cc +++ b/components/brave_rewards/core/internal/endpoint/private_cdn/private_cdn_server.cc @@ -2,9 +2,9 @@ * 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 https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/private_cdn/private_cdn_server.h" +#include "brave/components/brave_rewards/core/internal/endpoint/private_cdn/private_cdn_server.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::endpoint { diff --git a/components/brave_rewards/core/endpoint/private_cdn/private_cdn_server.h b/components/brave_rewards/core/internal/endpoint/private_cdn/private_cdn_server.h similarity index 62% rename from components/brave_rewards/core/endpoint/private_cdn/private_cdn_server.h rename to components/brave_rewards/core/internal/endpoint/private_cdn/private_cdn_server.h index d6e9f0cef31a..d3dd919011ba 100644 --- a/components/brave_rewards/core/endpoint/private_cdn/private_cdn_server.h +++ b/components/brave_rewards/core/internal/endpoint/private_cdn/private_cdn_server.h @@ -3,10 +3,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PRIVATE_CDN_PRIVATE_CDN_SERVER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PRIVATE_CDN_PRIVATE_CDN_SERVER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PRIVATE_CDN_PRIVATE_CDN_SERVER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PRIVATE_CDN_PRIVATE_CDN_SERVER_H_ -#include "brave/components/brave_rewards/core/endpoint/private_cdn/get_publisher/get_publisher.h" +#include "brave/components/brave_rewards/core/internal/endpoint/private_cdn/get_publisher/get_publisher.h" namespace brave_rewards::internal { class RewardsEngine; @@ -27,4 +27,4 @@ class PrivateCDNServer { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_PRIVATE_CDN_PRIVATE_CDN_SERVER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_PRIVATE_CDN_PRIVATE_CDN_SERVER_H_ diff --git a/components/brave_rewards/core/endpoint/rewards/get_prefix_list/get_prefix_list.cc b/components/brave_rewards/core/internal/endpoint/rewards/get_prefix_list/get_prefix_list.cc similarity index 84% rename from components/brave_rewards/core/endpoint/rewards/get_prefix_list/get_prefix_list.cc rename to components/brave_rewards/core/internal/endpoint/rewards/get_prefix_list/get_prefix_list.cc index d9680af1de99..72866fa556a9 100644 --- a/components/brave_rewards/core/endpoint/rewards/get_prefix_list/get_prefix_list.cc +++ b/components/brave_rewards/core/internal/endpoint/rewards/get_prefix_list/get_prefix_list.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/rewards/get_prefix_list/get_prefix_list.h" +#include "brave/components/brave_rewards/core/internal/endpoint/rewards/get_prefix_list/get_prefix_list.h" #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::rewards { diff --git a/components/brave_rewards/core/endpoint/rewards/get_prefix_list/get_prefix_list.h b/components/brave_rewards/core/internal/endpoint/rewards/get_prefix_list/get_prefix_list.h similarity index 73% rename from components/brave_rewards/core/endpoint/rewards/get_prefix_list/get_prefix_list.h rename to components/brave_rewards/core/internal/endpoint/rewards/get_prefix_list/get_prefix_list.h index 1b710a844857..9917e2b2024b 100644 --- a/components/brave_rewards/core/endpoint/rewards/get_prefix_list/get_prefix_list.h +++ b/components/brave_rewards/core/internal/endpoint/rewards/get_prefix_list/get_prefix_list.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_REWARDS_GET_PREFIX_LIST_GET_PREFIX_LIST_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_REWARDS_GET_PREFIX_LIST_GET_PREFIX_LIST_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_REWARDS_GET_PREFIX_LIST_GET_PREFIX_LIST_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_REWARDS_GET_PREFIX_LIST_GET_PREFIX_LIST_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" // GET /publishers/prefix-list // @@ -50,4 +50,4 @@ class GetPrefixList { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_REWARDS_GET_PREFIX_LIST_GET_PREFIX_LIST_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_REWARDS_GET_PREFIX_LIST_GET_PREFIX_LIST_H_ diff --git a/components/brave_rewards/core/endpoint/rewards/get_prefix_list/get_prefix_list_unittest.cc b/components/brave_rewards/core/internal/endpoint/rewards/get_prefix_list/get_prefix_list_unittest.cc similarity index 86% rename from components/brave_rewards/core/endpoint/rewards/get_prefix_list/get_prefix_list_unittest.cc rename to components/brave_rewards/core/internal/endpoint/rewards/get_prefix_list/get_prefix_list_unittest.cc index 5014143ff7e0..eb474918d281 100644 --- a/components/brave_rewards/core/endpoint/rewards/get_prefix_list/get_prefix_list_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/rewards/get_prefix_list/get_prefix_list_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/rewards/get_prefix_list/get_prefix_list.h" +#include "brave/components/brave_rewards/core/internal/endpoint/rewards/get_prefix_list/get_prefix_list.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/rewards/rewards_server.cc b/components/brave_rewards/core/internal/endpoint/rewards/rewards_server.cc similarity index 75% rename from components/brave_rewards/core/endpoint/rewards/rewards_server.cc rename to components/brave_rewards/core/internal/endpoint/rewards/rewards_server.cc index 944dde239384..f5fa26f638f1 100644 --- a/components/brave_rewards/core/endpoint/rewards/rewards_server.cc +++ b/components/brave_rewards/core/internal/endpoint/rewards/rewards_server.cc @@ -2,9 +2,9 @@ * 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 https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/rewards/rewards_server.h" +#include "brave/components/brave_rewards/core/internal/endpoint/rewards/rewards_server.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::endpoint { diff --git a/components/brave_rewards/core/endpoint/rewards/rewards_server.h b/components/brave_rewards/core/internal/endpoint/rewards/rewards_server.h similarity index 63% rename from components/brave_rewards/core/endpoint/rewards/rewards_server.h rename to components/brave_rewards/core/internal/endpoint/rewards/rewards_server.h index e075f7063e26..3915fd934cbe 100644 --- a/components/brave_rewards/core/endpoint/rewards/rewards_server.h +++ b/components/brave_rewards/core/internal/endpoint/rewards/rewards_server.h @@ -3,10 +3,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_REWARDS_REWARDS_SERVER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_REWARDS_REWARDS_SERVER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_REWARDS_REWARDS_SERVER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_REWARDS_REWARDS_SERVER_H_ -#include "brave/components/brave_rewards/core/endpoint/rewards/get_prefix_list/get_prefix_list.h" +#include "brave/components/brave_rewards/core/internal/endpoint/rewards/get_prefix_list/get_prefix_list.h" namespace brave_rewards::internal { class RewardsEngine; @@ -27,4 +27,4 @@ class RewardsServer { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_REWARDS_REWARDS_SERVER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_REWARDS_REWARDS_SERVER_H_ diff --git a/components/brave_rewards/core/endpoint/uphold/get_capabilities/get_capabilities.cc b/components/brave_rewards/core/internal/endpoint/uphold/get_capabilities/get_capabilities.cc similarity index 91% rename from components/brave_rewards/core/endpoint/uphold/get_capabilities/get_capabilities.cc rename to components/brave_rewards/core/internal/endpoint/uphold/get_capabilities/get_capabilities.cc index c4f5dccb4506..3a2106f8f5df 100644 --- a/components/brave_rewards/core/endpoint/uphold/get_capabilities/get_capabilities.cc +++ b/components/brave_rewards/core/internal/endpoint/uphold/get_capabilities/get_capabilities.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/uphold/get_capabilities/get_capabilities.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/get_capabilities/get_capabilities.h" #include #include "base/json/json_reader.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/uphold/get_capabilities/get_capabilities.h b/components/brave_rewards/core/internal/endpoint/uphold/get_capabilities/get_capabilities.h similarity index 90% rename from components/brave_rewards/core/endpoint/uphold/get_capabilities/get_capabilities.h rename to components/brave_rewards/core/internal/endpoint/uphold/get_capabilities/get_capabilities.h index 832e17f13324..8736d98da982 100644 --- a/components/brave_rewards/core/endpoint/uphold/get_capabilities/get_capabilities.h +++ b/components/brave_rewards/core/internal/endpoint/uphold/get_capabilities/get_capabilities.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_GET_CAPABILITIES_GET_CAPABILITIES_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_GET_CAPABILITIES_GET_CAPABILITIES_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_GET_CAPABILITIES_GET_CAPABILITIES_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_GET_CAPABILITIES_GET_CAPABILITIES_H_ #include #include #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/uphold/uphold_capabilities.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold_capabilities.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" // GET https://api.uphold.com/v0/me/capabilities // @@ -206,4 +206,4 @@ class GetCapabilities { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_GET_CAPABILITIES_GET_CAPABILITIES_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_GET_CAPABILITIES_GET_CAPABILITIES_H_ diff --git a/components/brave_rewards/core/endpoint/uphold/get_capabilities/get_capabilities_unittest.cc b/components/brave_rewards/core/internal/endpoint/uphold/get_capabilities/get_capabilities_unittest.cc similarity index 95% rename from components/brave_rewards/core/endpoint/uphold/get_capabilities/get_capabilities_unittest.cc rename to components/brave_rewards/core/internal/endpoint/uphold/get_capabilities/get_capabilities_unittest.cc index aadd5cf6e8e5..e8736eaf5b05 100644 --- a/components/brave_rewards/core/endpoint/uphold/get_capabilities/get_capabilities_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/uphold/get_capabilities/get_capabilities_unittest.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/uphold/get_capabilities/get_capabilities.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/get_capabilities/get_capabilities.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" -#include "brave/components/brave_rewards/core/uphold/uphold_capabilities.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold_capabilities.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/uphold/get_card/get_card.cc b/components/brave_rewards/core/internal/endpoint/uphold/get_card/get_card.cc similarity index 88% rename from components/brave_rewards/core/endpoint/uphold/get_card/get_card.cc rename to components/brave_rewards/core/internal/endpoint/uphold/get_card/get_card.cc index 4eb09cbc8729..a038c3d850e6 100644 --- a/components/brave_rewards/core/endpoint/uphold/get_card/get_card.cc +++ b/components/brave_rewards/core/internal/endpoint/uphold/get_card/get_card.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/uphold/get_card/get_card.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/get_card/get_card.h" #include #include @@ -11,10 +11,10 @@ #include "base/json/json_reader.h" #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/uphold/uphold_card.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold_card.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::uphold { diff --git a/components/brave_rewards/core/endpoint/uphold/get_card/get_card.h b/components/brave_rewards/core/internal/endpoint/uphold/get_card/get_card.h similarity index 88% rename from components/brave_rewards/core/endpoint/uphold/get_card/get_card.h rename to components/brave_rewards/core/internal/endpoint/uphold/get_card/get_card.h index fec1a2b023bc..e05fa7f778ef 100644 --- a/components/brave_rewards/core/endpoint/uphold/get_card/get_card.h +++ b/components/brave_rewards/core/internal/endpoint/uphold/get_card/get_card.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_GET_CARD_GET_CARD_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_GET_CARD_GET_CARD_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_GET_CARD_GET_CARD_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_GET_CARD_GET_CARD_H_ #include #include "base/functional/callback_forward.h" #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" // GET https://api.uphold.com/v0/me/cards/{wallet_address} // @@ -106,4 +106,4 @@ class GetCard { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_GET_CARD_GET_CARD_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_GET_CARD_GET_CARD_H_ diff --git a/components/brave_rewards/core/endpoint/uphold/get_card/get_card_unittest.cc b/components/brave_rewards/core/internal/endpoint/uphold/get_card/get_card_unittest.cc similarity index 93% rename from components/brave_rewards/core/endpoint/uphold/get_card/get_card_unittest.cc rename to components/brave_rewards/core/internal/endpoint/uphold/get_card/get_card_unittest.cc index 4e778d3687bf..e236b3ef868c 100644 --- a/components/brave_rewards/core/endpoint/uphold/get_card/get_card_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/uphold/get_card/get_card_unittest.cc @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/uphold/get_card/get_card.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/get_card/get_card.h" #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/uphold/get_cards/get_cards.cc b/components/brave_rewards/core/internal/endpoint/uphold/get_cards/get_cards.cc similarity index 87% rename from components/brave_rewards/core/endpoint/uphold/get_cards/get_cards.cc rename to components/brave_rewards/core/internal/endpoint/uphold/get_cards/get_cards.cc index 96a1cb62320d..b22705cb4251 100644 --- a/components/brave_rewards/core/endpoint/uphold/get_cards/get_cards.cc +++ b/components/brave_rewards/core/internal/endpoint/uphold/get_cards/get_cards.cc @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/uphold/get_cards/get_cards.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/get_cards/get_cards.h" #include #include #include "base/json/json_reader.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/uphold/uphold_card.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold_card.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::uphold { diff --git a/components/brave_rewards/core/endpoint/uphold/get_cards/get_cards.h b/components/brave_rewards/core/internal/endpoint/uphold/get_cards/get_cards.h similarity index 88% rename from components/brave_rewards/core/endpoint/uphold/get_cards/get_cards.h rename to components/brave_rewards/core/internal/endpoint/uphold/get_cards/get_cards.h index fca4fa24f0a6..94b3da205f2e 100644 --- a/components/brave_rewards/core/endpoint/uphold/get_cards/get_cards.h +++ b/components/brave_rewards/core/internal/endpoint/uphold/get_cards/get_cards.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_GET_CARDS_GET_CARDS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_GET_CARDS_GET_CARDS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_GET_CARDS_GET_CARDS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_GET_CARDS_GET_CARDS_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" // GET https://api.uphold.com/v0/me/cards?q=currency:BAT // @@ -103,4 +103,4 @@ class GetCards { } // namespace endpoint::uphold } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_GET_CARDS_GET_CARDS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_GET_CARDS_GET_CARDS_H_ diff --git a/components/brave_rewards/core/endpoint/uphold/get_cards/get_cards_unittest.cc b/components/brave_rewards/core/internal/endpoint/uphold/get_cards/get_cards_unittest.cc similarity index 95% rename from components/brave_rewards/core/endpoint/uphold/get_cards/get_cards_unittest.cc rename to components/brave_rewards/core/internal/endpoint/uphold/get_cards/get_cards_unittest.cc index 37faac837358..e3d48320120f 100644 --- a/components/brave_rewards/core/endpoint/uphold/get_cards/get_cards_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/uphold/get_cards/get_cards_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/uphold/get_cards/get_cards.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/get_cards/get_cards.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/uphold/get_me/get_me.cc b/components/brave_rewards/core/internal/endpoint/uphold/get_me/get_me.cc similarity index 90% rename from components/brave_rewards/core/endpoint/uphold/get_me/get_me.cc rename to components/brave_rewards/core/internal/endpoint/uphold/get_me/get_me.cc index a071d0aea5a9..e954e0e9b4cf 100644 --- a/components/brave_rewards/core/endpoint/uphold/get_me/get_me.cc +++ b/components/brave_rewards/core/internal/endpoint/uphold/get_me/get_me.cc @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/uphold/get_me/get_me.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/get_me/get_me.h" #include #include #include "base/containers/contains.h" #include "base/json/json_reader.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::uphold { diff --git a/components/brave_rewards/core/endpoint/uphold/get_me/get_me.h b/components/brave_rewards/core/internal/endpoint/uphold/get_me/get_me.h similarity index 88% rename from components/brave_rewards/core/endpoint/uphold/get_me/get_me.h rename to components/brave_rewards/core/internal/endpoint/uphold/get_me/get_me.h index c426089da765..1f27ae409de9 100644 --- a/components/brave_rewards/core/endpoint/uphold/get_me/get_me.h +++ b/components/brave_rewards/core/internal/endpoint/uphold/get_me/get_me.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_GET_ME_GET_ME_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_GET_ME_GET_ME_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_GET_ME_GET_ME_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_GET_ME_GET_ME_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/uphold/uphold_user.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold_user.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" // GET https://api.uphold.com/v0/me // @@ -143,4 +143,4 @@ class GetMe { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_GET_ME_GET_ME_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_GET_ME_GET_ME_H_ diff --git a/components/brave_rewards/core/endpoint/uphold/get_me/get_me_unittest.cc b/components/brave_rewards/core/internal/endpoint/uphold/get_me/get_me_unittest.cc similarity index 94% rename from components/brave_rewards/core/endpoint/uphold/get_me/get_me_unittest.cc rename to components/brave_rewards/core/internal/endpoint/uphold/get_me/get_me_unittest.cc index df086c4be2f5..c4d7365a1381 100644 --- a/components/brave_rewards/core/endpoint/uphold/get_me/get_me_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/uphold/get_me/get_me_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/uphold/get_me/get_me.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/get_me/get_me.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/uphold/patch_card/patch_card.cc b/components/brave_rewards/core/internal/endpoint/uphold/patch_card/patch_card.cc similarity index 87% rename from components/brave_rewards/core/endpoint/uphold/patch_card/patch_card.cc rename to components/brave_rewards/core/internal/endpoint/uphold/patch_card/patch_card.cc index 2cc72e2a8df6..f110e4dda04f 100644 --- a/components/brave_rewards/core/endpoint/uphold/patch_card/patch_card.cc +++ b/components/brave_rewards/core/internal/endpoint/uphold/patch_card/patch_card.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/uphold/patch_card/patch_card.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/patch_card/patch_card.h" #include #include "base/json/json_writer.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::uphold { diff --git a/components/brave_rewards/core/endpoint/uphold/patch_card/patch_card.h b/components/brave_rewards/core/internal/endpoint/uphold/patch_card/patch_card.h similarity index 88% rename from components/brave_rewards/core/endpoint/uphold/patch_card/patch_card.h rename to components/brave_rewards/core/internal/endpoint/uphold/patch_card/patch_card.h index 97387b3a0f01..bc6380a2f28a 100644 --- a/components/brave_rewards/core/endpoint/uphold/patch_card/patch_card.h +++ b/components/brave_rewards/core/internal/endpoint/uphold/patch_card/patch_card.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_PATCH_CARD_PATCH_CARD_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_PATCH_CARD_PATCH_CARD_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_PATCH_CARD_PATCH_CARD_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_PATCH_CARD_PATCH_CARD_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" // PATCH https://api.uphold.com/v0/me/cards/{wallet_address} // @@ -111,4 +111,4 @@ class PatchCard { } // namespace endpoint::uphold } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_PATCH_CARD_PATCH_CARD_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_PATCH_CARD_PATCH_CARD_H_ diff --git a/components/brave_rewards/core/endpoint/uphold/patch_card/patch_card_unittest.cc b/components/brave_rewards/core/internal/endpoint/uphold/patch_card/patch_card_unittest.cc similarity index 93% rename from components/brave_rewards/core/endpoint/uphold/patch_card/patch_card_unittest.cc rename to components/brave_rewards/core/internal/endpoint/uphold/patch_card/patch_card_unittest.cc index 7ea18d4060bd..1595aedf1244 100644 --- a/components/brave_rewards/core/endpoint/uphold/patch_card/patch_card_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/uphold/patch_card/patch_card_unittest.cc @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/uphold/patch_card/patch_card.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/patch_card/patch_card.h" #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/uphold/post_cards/post_cards.cc b/components/brave_rewards/core/internal/endpoint/uphold/post_cards/post_cards.cc similarity index 88% rename from components/brave_rewards/core/endpoint/uphold/post_cards/post_cards.cc rename to components/brave_rewards/core/internal/endpoint/uphold/post_cards/post_cards.cc index 0836f3931962..cfe5050d563a 100644 --- a/components/brave_rewards/core/endpoint/uphold/post_cards/post_cards.cc +++ b/components/brave_rewards/core/internal/endpoint/uphold/post_cards/post_cards.cc @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/uphold/post_cards/post_cards.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/post_cards/post_cards.h" #include #include #include "base/json/json_reader.h" #include "base/json/json_writer.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/uphold/uphold_card.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold_card.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoint::uphold { diff --git a/components/brave_rewards/core/endpoint/uphold/post_cards/post_cards.h b/components/brave_rewards/core/internal/endpoint/uphold/post_cards/post_cards.h similarity index 88% rename from components/brave_rewards/core/endpoint/uphold/post_cards/post_cards.h rename to components/brave_rewards/core/internal/endpoint/uphold/post_cards/post_cards.h index d7a21f7b4c21..efda980b1edb 100644 --- a/components/brave_rewards/core/endpoint/uphold/post_cards/post_cards.h +++ b/components/brave_rewards/core/internal/endpoint/uphold/post_cards/post_cards.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_POST_CARDS_POST_CARDS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_POST_CARDS_POST_CARDS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_POST_CARDS_POST_CARDS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_POST_CARDS_POST_CARDS_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" // POST https://api.uphold.com/v0/me/cards // @@ -109,4 +109,4 @@ class PostCards { } // namespace endpoint::uphold } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_POST_CARDS_POST_CARDS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_POST_CARDS_POST_CARDS_H_ diff --git a/components/brave_rewards/core/endpoint/uphold/post_cards/post_cards_unittest.cc b/components/brave_rewards/core/internal/endpoint/uphold/post_cards/post_cards_unittest.cc similarity index 93% rename from components/brave_rewards/core/endpoint/uphold/post_cards/post_cards_unittest.cc rename to components/brave_rewards/core/internal/endpoint/uphold/post_cards/post_cards_unittest.cc index b49745878f20..1593dc25f000 100644 --- a/components/brave_rewards/core/endpoint/uphold/post_cards/post_cards_unittest.cc +++ b/components/brave_rewards/core/internal/endpoint/uphold/post_cards/post_cards_unittest.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/uphold/post_cards/post_cards.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/post_cards/post_cards.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/endpoint/uphold/uphold_server.cc b/components/brave_rewards/core/internal/endpoint/uphold/uphold_server.cc similarity index 79% rename from components/brave_rewards/core/endpoint/uphold/uphold_server.cc rename to components/brave_rewards/core/internal/endpoint/uphold/uphold_server.cc index 37e53034f8a8..54f459bd02a8 100644 --- a/components/brave_rewards/core/endpoint/uphold/uphold_server.cc +++ b/components/brave_rewards/core/internal/endpoint/uphold/uphold_server.cc @@ -3,9 +3,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoint/uphold/uphold_server.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/uphold_server.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::endpoint { diff --git a/components/brave_rewards/core/endpoint/uphold/uphold_server.h b/components/brave_rewards/core/internal/endpoint/uphold/uphold_server.h similarity index 57% rename from components/brave_rewards/core/endpoint/uphold/uphold_server.h rename to components/brave_rewards/core/internal/endpoint/uphold/uphold_server.h index 72b684604435..be55717f78f9 100644 --- a/components/brave_rewards/core/endpoint/uphold/uphold_server.h +++ b/components/brave_rewards/core/internal/endpoint/uphold/uphold_server.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_UPHOLD_SERVER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_UPHOLD_SERVER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_UPHOLD_SERVER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_UPHOLD_SERVER_H_ -#include "brave/components/brave_rewards/core/endpoint/uphold/get_capabilities/get_capabilities.h" -#include "brave/components/brave_rewards/core/endpoint/uphold/get_card/get_card.h" -#include "brave/components/brave_rewards/core/endpoint/uphold/get_cards/get_cards.h" -#include "brave/components/brave_rewards/core/endpoint/uphold/get_me/get_me.h" -#include "brave/components/brave_rewards/core/endpoint/uphold/patch_card/patch_card.h" -#include "brave/components/brave_rewards/core/endpoint/uphold/post_cards/post_cards.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/get_capabilities/get_capabilities.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/get_card/get_card.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/get_cards/get_cards.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/get_me/get_me.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/patch_card/patch_card.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/post_cards/post_cards.h" namespace brave_rewards::internal { class RewardsEngine; @@ -49,4 +49,4 @@ class UpholdServer { } // namespace endpoint } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINT_UPHOLD_UPHOLD_SERVER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINT_UPHOLD_UPHOLD_SERVER_H_ diff --git a/components/brave_rewards/core/endpoints/bitflyer/post_commit_transaction_bitflyer.cc b/components/brave_rewards/core/internal/endpoints/bitflyer/post_commit_transaction_bitflyer.cc similarity index 91% rename from components/brave_rewards/core/endpoints/bitflyer/post_commit_transaction_bitflyer.cc rename to components/brave_rewards/core/internal/endpoints/bitflyer/post_commit_transaction_bitflyer.cc index 675efa30fd93..f644203b1f3a 100644 --- a/components/brave_rewards/core/endpoints/bitflyer/post_commit_transaction_bitflyer.cc +++ b/components/brave_rewards/core/internal/endpoints/bitflyer/post_commit_transaction_bitflyer.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/bitflyer/post_commit_transaction_bitflyer.h" +#include "brave/components/brave_rewards/core/internal/endpoints/bitflyer/post_commit_transaction_bitflyer.h" #include #include #include "base/json/json_reader.h" #include "base/json/json_writer.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/bitflyer/post_commit_transaction_bitflyer.h b/components/brave_rewards/core/internal/endpoints/bitflyer/post_commit_transaction_bitflyer.h similarity index 74% rename from components/brave_rewards/core/endpoints/bitflyer/post_commit_transaction_bitflyer.h rename to components/brave_rewards/core/internal/endpoints/bitflyer/post_commit_transaction_bitflyer.h index 185ebecad4f6..8e179a309f95 100644 --- a/components/brave_rewards/core/endpoints/bitflyer/post_commit_transaction_bitflyer.h +++ b/components/brave_rewards/core/internal/endpoints/bitflyer/post_commit_transaction_bitflyer.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BITFLYER_POST_COMMIT_TRANSACTION_BITFLYER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BITFLYER_POST_COMMIT_TRANSACTION_BITFLYER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BITFLYER_POST_COMMIT_TRANSACTION_BITFLYER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BITFLYER_POST_COMMIT_TRANSACTION_BITFLYER_H_ #include #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/common/post_commit_transaction.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_commit_transaction.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // POST /api/link/v1/coin/withdraw-to-deposit-id/request // @@ -64,4 +64,4 @@ class PostCommitTransactionBitFlyer final } // namespace brave_rewards::internal::endpoints -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BITFLYER_POST_COMMIT_TRANSACTION_BITFLYER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BITFLYER_POST_COMMIT_TRANSACTION_BITFLYER_H_ diff --git a/components/brave_rewards/core/endpoints/bitflyer/post_commit_transaction_bitflyer_unittest.cc b/components/brave_rewards/core/internal/endpoints/bitflyer/post_commit_transaction_bitflyer_unittest.cc similarity index 85% rename from components/brave_rewards/core/endpoints/bitflyer/post_commit_transaction_bitflyer_unittest.cc rename to components/brave_rewards/core/internal/endpoints/bitflyer/post_commit_transaction_bitflyer_unittest.cc index 25365b611be6..90ce30c668d7 100644 --- a/components/brave_rewards/core/endpoints/bitflyer/post_commit_transaction_bitflyer_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/bitflyer/post_commit_transaction_bitflyer_unittest.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/bitflyer/post_commit_transaction_bitflyer.h" +#include "brave/components/brave_rewards/core/internal/endpoints/bitflyer/post_commit_transaction_bitflyer.h" #include #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" @@ -23,12 +23,13 @@ namespace brave_rewards::internal { using Error = endpoints::PostCommitTransactionBitFlyer::Error; using Result = endpoints::PostCommitTransactionBitFlyer::Result; -using PostCommitTransactionBitFlyerParamType = std::tuple< - std::string, // test name suffix - net::HttpStatusCode, // post commit transaction endpoint status code - std::string, // post commit transaction endpoint response body - Result // expected result ->; +using PostCommitTransactionBitFlyerParamType = + std::tuple; class RewardsPostCommitTransactionBitFlyerTest : public RewardsEngineTest, diff --git a/components/brave_rewards/core/endpoints/brave/get_parameters.cc b/components/brave_rewards/core/internal/endpoints/brave/get_parameters.cc similarity index 95% rename from components/brave_rewards/core/endpoints/brave/get_parameters.cc rename to components/brave_rewards/core/internal/endpoints/brave/get_parameters.cc index 34d793f66c32..a5f9294a0a08 100644 --- a/components/brave_rewards/core/endpoints/brave/get_parameters.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/get_parameters.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/brave/get_parameters.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/get_parameters.h" #include #include #include #include "base/json/json_reader.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/brave/get_parameters.h b/components/brave_rewards/core/internal/endpoints/brave/get_parameters.h similarity index 79% rename from components/brave_rewards/core/endpoints/brave/get_parameters.h rename to components/brave_rewards/core/internal/endpoints/brave/get_parameters.h index 8dd735f9eb74..4541714fa80f 100644 --- a/components/brave_rewards/core/endpoints/brave/get_parameters.h +++ b/components/brave_rewards/core/internal/endpoints/brave/get_parameters.h @@ -3,19 +3,19 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_GET_PARAMETERS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_GET_PARAMETERS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_GET_PARAMETERS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_GET_PARAMETERS_H_ #include #include #include "base/containers/flat_map.h" #include "base/values.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" -#include "brave/components/brave_rewards/core/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // GET /v1/parameters // @@ -96,4 +96,4 @@ class GetParameters final : public RequestBuilder, } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_GET_PARAMETERS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_GET_PARAMETERS_H_ diff --git a/components/brave_rewards/core/endpoints/brave/get_parameters_unittest.cc b/components/brave_rewards/core/internal/endpoints/brave/get_parameters_unittest.cc similarity index 93% rename from components/brave_rewards/core/endpoints/brave/get_parameters_unittest.cc rename to components/brave_rewards/core/internal/endpoints/brave/get_parameters_unittest.cc index b977b2ae8b9c..1e3e5e5060fd 100644 --- a/components/brave_rewards/core/endpoints/brave/get_parameters_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/get_parameters_unittest.cc @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/brave/get_parameters.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/get_parameters.h" #include #include #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/components/brave_rewards/core/endpoints/brave/get_ui_cards.cc b/components/brave_rewards/core/internal/endpoints/brave/get_ui_cards.cc similarity index 92% rename from components/brave_rewards/core/endpoints/brave/get_ui_cards.cc rename to components/brave_rewards/core/internal/endpoints/brave/get_ui_cards.cc index 05d7e8c51d45..1786fc7a356a 100644 --- a/components/brave_rewards/core/endpoints/brave/get_ui_cards.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/get_ui_cards.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/brave/get_ui_cards.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/get_ui_cards.h" #include #include #include "base/json/json_reader.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/brave/get_ui_cards.h b/components/brave_rewards/core/internal/endpoints/brave/get_ui_cards.h similarity index 76% rename from components/brave_rewards/core/endpoints/brave/get_ui_cards.h rename to components/brave_rewards/core/internal/endpoints/brave/get_ui_cards.h index e20f520d9f93..fc4b0d7edc1f 100644 --- a/components/brave_rewards/core/endpoints/brave/get_ui_cards.h +++ b/components/brave_rewards/core/internal/endpoints/brave/get_ui_cards.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_GET_UI_CARDS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_GET_UI_CARDS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_GET_UI_CARDS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_GET_UI_CARDS_H_ #include #include #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/rewards_engine_helper.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine_helper.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal::endpoints { @@ -51,4 +51,4 @@ class GetUICards : public RewardsEngineHelper, } // namespace brave_rewards::internal::endpoints -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_GET_UI_CARDS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_GET_UI_CARDS_H_ diff --git a/components/brave_rewards/core/endpoints/brave/get_wallet.cc b/components/brave_rewards/core/internal/endpoints/brave/get_wallet.cc similarity index 91% rename from components/brave_rewards/core/endpoints/brave/get_wallet.cc rename to components/brave_rewards/core/internal/endpoints/brave/get_wallet.cc index 4041a2597e80..1bbd94956f9e 100644 --- a/components/brave_rewards/core/endpoints/brave/get_wallet.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/get_wallet.cc @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/brave/get_wallet.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/get_wallet.h" #include #include #include "base/json/json_reader.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/request_signer.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/request_signer.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/brave/get_wallet.h b/components/brave_rewards/core/internal/endpoints/brave/get_wallet.h similarity index 76% rename from components/brave_rewards/core/endpoints/brave/get_wallet.h rename to components/brave_rewards/core/internal/endpoints/brave/get_wallet.h index b628f2c6d9bc..d442b73991c6 100644 --- a/components/brave_rewards/core/endpoints/brave/get_wallet.h +++ b/components/brave_rewards/core/internal/endpoints/brave/get_wallet.h @@ -3,19 +3,19 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_GET_WALLET_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_GET_WALLET_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_GET_WALLET_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_GET_WALLET_H_ #include #include #include #include "base/values.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_engine.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" -#include "brave/components/brave_rewards/core/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_engine.mojom.h" // GET /v4/wallets/{payment_id} // @@ -88,4 +88,4 @@ class GetWallet final : public RequestBuilder, } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_GET_WALLET_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_GET_WALLET_H_ diff --git a/components/brave_rewards/core/endpoints/brave/get_wallet_unittest.cc b/components/brave_rewards/core/internal/endpoints/brave/get_wallet_unittest.cc similarity index 91% rename from components/brave_rewards/core/endpoints/brave/get_wallet_unittest.cc rename to components/brave_rewards/core/internal/endpoints/brave/get_wallet_unittest.cc index 4e19142c650a..07abf570980d 100644 --- a/components/brave_rewards/core/endpoints/brave/get_wallet_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/get_wallet_unittest.cc @@ -3,15 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/endpoints/brave/get_wallet.h" + #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/brave/get_wallet.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" // npm run test -- brave_unit_tests --filter=*GetWalletTest* diff --git a/components/brave_rewards/core/endpoints/brave/patch_wallets.cc b/components/brave_rewards/core/internal/endpoints/brave/patch_wallets.cc similarity index 92% rename from components/brave_rewards/core/endpoints/brave/patch_wallets.cc rename to components/brave_rewards/core/internal/endpoints/brave/patch_wallets.cc index 7dec1e19db19..f41ec18b7243 100644 --- a/components/brave_rewards/core/endpoints/brave/patch_wallets.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/patch_wallets.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/brave/patch_wallets.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/patch_wallets.h" #include #include @@ -11,10 +11,10 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/request_signer.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/request_signer.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/brave/patch_wallets.h b/components/brave_rewards/core/internal/endpoints/brave/patch_wallets.h similarity index 68% rename from components/brave_rewards/core/endpoints/brave/patch_wallets.h rename to components/brave_rewards/core/internal/endpoints/brave/patch_wallets.h index f6cf23c1be6e..8b12e09fd12f 100644 --- a/components/brave_rewards/core/endpoints/brave/patch_wallets.h +++ b/components/brave_rewards/core/internal/endpoints/brave/patch_wallets.h @@ -3,18 +3,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_PATCH_WALLETS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_PATCH_WALLETS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_PATCH_WALLETS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_PATCH_WALLETS_H_ #include #include #include -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" -#include "brave/components/brave_rewards/core/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // PATCH /v4/wallets/ // @@ -61,4 +61,4 @@ class PatchWallets final : public RequestBuilder, } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_PATCH_WALLETS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_PATCH_WALLETS_H_ diff --git a/components/brave_rewards/core/endpoints/brave/patch_wallets_unittest.cc b/components/brave_rewards/core/internal/endpoints/brave/patch_wallets_unittest.cc similarity index 83% rename from components/brave_rewards/core/endpoints/brave/patch_wallets_unittest.cc rename to components/brave_rewards/core/internal/endpoints/brave/patch_wallets_unittest.cc index 5523361cc9b8..86fe52a07b8a 100644 --- a/components/brave_rewards/core/endpoints/brave/patch_wallets_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/patch_wallets_unittest.cc @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/brave/patch_wallets.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/patch_wallets.h" #include #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" @@ -24,12 +24,13 @@ namespace brave_rewards::internal::endpoints { using Error = PatchWallets::Error; using Result = PatchWallets::Result; -using PatchWalletsParamType = std::tuple< - std::string, // test name suffix - net::HttpStatusCode, // post create wallet endpoint response status code - std::string, // post create wallet endpoint response body - Result // expected result ->; +using PatchWalletsParamType = + std::tuple; class RewardsPatchWalletsTest : public RewardsEngineTest, diff --git a/components/brave_rewards/core/endpoints/brave/post_challenges.cc b/components/brave_rewards/core/internal/endpoints/brave/post_challenges.cc similarity index 86% rename from components/brave_rewards/core/endpoints/brave/post_challenges.cc rename to components/brave_rewards/core/internal/endpoints/brave/post_challenges.cc index 3747313a1554..804145104970 100644 --- a/components/brave_rewards/core/endpoints/brave/post_challenges.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/post_challenges.cc @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/brave/post_challenges.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_challenges.h" #include #include "base/json/json_reader.h" #include "base/json/json_writer.h" -#include "brave/components/brave_rewards/core/common/callback_helpers.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/request_signer.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/common/callback_helpers.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/request_signer.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/brave/post_challenges.h b/components/brave_rewards/core/internal/endpoints/brave/post_challenges.h similarity index 74% rename from components/brave_rewards/core/endpoints/brave/post_challenges.h rename to components/brave_rewards/core/internal/endpoints/brave/post_challenges.h index a858d6c0a52e..a82174fe0fc1 100644 --- a/components/brave_rewards/core/endpoints/brave/post_challenges.h +++ b/components/brave_rewards/core/internal/endpoints/brave/post_challenges.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CHALLENGES_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CHALLENGES_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CHALLENGES_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CHALLENGES_H_ #include #include "base/memory/weak_ptr.h" #include "base/types/expected.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/rewards_engine_helper.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine_helper.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" namespace brave_rewards::internal::endpoints { @@ -56,4 +56,4 @@ class PostChallenges : public RewardsEngineHelper, } // namespace brave_rewards::internal::endpoints -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CHALLENGES_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CHALLENGES_H_ diff --git a/components/brave_rewards/core/endpoints/brave/post_challenges_unittest.cc b/components/brave_rewards/core/internal/endpoints/brave/post_challenges_unittest.cc similarity index 88% rename from components/brave_rewards/core/endpoints/brave/post_challenges_unittest.cc rename to components/brave_rewards/core/internal/endpoints/brave/post_challenges_unittest.cc index 9d76cfc3212d..8f36c1ff3b29 100644 --- a/components/brave_rewards/core/endpoints/brave/post_challenges_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/post_challenges_unittest.cc @@ -3,13 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_challenges.h" + #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/brave/post_challenges.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" // npm run test -- brave_unit_tests --filter=RewardsPostChallengesTest* diff --git a/components/brave_rewards/core/endpoints/brave/post_connect_bitflyer.cc b/components/brave_rewards/core/internal/endpoints/brave/post_connect_bitflyer.cc similarity index 88% rename from components/brave_rewards/core/endpoints/brave/post_connect_bitflyer.cc rename to components/brave_rewards/core/internal/endpoints/brave/post_connect_bitflyer.cc index dd0ec0030386..dc077374ef15 100644 --- a/components/brave_rewards/core/endpoints/brave/post_connect_bitflyer.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/post_connect_bitflyer.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/brave/post_connect_bitflyer.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_connect_bitflyer.h" #include #include #include "base/json/json_writer.h" #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/brave/post_connect_bitflyer.h b/components/brave_rewards/core/internal/endpoints/brave/post_connect_bitflyer.h similarity index 79% rename from components/brave_rewards/core/endpoints/brave/post_connect_bitflyer.h rename to components/brave_rewards/core/internal/endpoints/brave/post_connect_bitflyer.h index 93cecbb7e811..4acbbccce7dd 100644 --- a/components/brave_rewards/core/endpoints/brave/post_connect_bitflyer.h +++ b/components/brave_rewards/core/internal/endpoints/brave/post_connect_bitflyer.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CONNECT_BITFLYER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CONNECT_BITFLYER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CONNECT_BITFLYER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CONNECT_BITFLYER_H_ #include #include -#include "brave/components/brave_rewards/core/endpoints/common/post_connect.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_connect.h" // POST /v3/wallet/bitflyer/{rewards_payment_id}/claim // @@ -46,4 +46,4 @@ class PostConnectBitflyer final : public PostConnect { } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CONNECT_BITFLYER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CONNECT_BITFLYER_H_ diff --git a/components/brave_rewards/core/endpoints/brave/post_connect_gemini.cc b/components/brave_rewards/core/internal/endpoints/brave/post_connect_gemini.cc similarity index 90% rename from components/brave_rewards/core/endpoints/brave/post_connect_gemini.cc rename to components/brave_rewards/core/internal/endpoints/brave/post_connect_gemini.cc index 1b62ea486325..ceb6f2bfeeb2 100644 --- a/components/brave_rewards/core/endpoints/brave/post_connect_gemini.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/post_connect_gemini.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/brave/post_connect_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_connect_gemini.h" #include #include #include "base/json/json_writer.h" #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/brave/post_connect_gemini.h b/components/brave_rewards/core/internal/endpoints/brave/post_connect_gemini.h similarity index 79% rename from components/brave_rewards/core/endpoints/brave/post_connect_gemini.h rename to components/brave_rewards/core/internal/endpoints/brave/post_connect_gemini.h index e6849a3f357d..1069e684694e 100644 --- a/components/brave_rewards/core/endpoints/brave/post_connect_gemini.h +++ b/components/brave_rewards/core/internal/endpoints/brave/post_connect_gemini.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CONNECT_GEMINI_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CONNECT_GEMINI_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CONNECT_GEMINI_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CONNECT_GEMINI_H_ #include #include -#include "brave/components/brave_rewards/core/endpoints/common/post_connect.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_connect.h" // POST /v3/wallet/gemini/{rewards_payment_id}/claim // @@ -50,4 +50,4 @@ class PostConnectGemini final : public PostConnect { } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CONNECT_GEMINI_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CONNECT_GEMINI_H_ diff --git a/components/brave_rewards/core/endpoints/brave/post_connect_uphold.cc b/components/brave_rewards/core/internal/endpoints/brave/post_connect_uphold.cc similarity index 90% rename from components/brave_rewards/core/endpoints/brave/post_connect_uphold.cc rename to components/brave_rewards/core/internal/endpoints/brave/post_connect_uphold.cc index 94e30b27c4ce..ce5ca33563bb 100644 --- a/components/brave_rewards/core/endpoints/brave/post_connect_uphold.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/post_connect_uphold.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/brave/post_connect_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_connect_uphold.h" #include #include @@ -11,9 +11,9 @@ #include "base/base64.h" #include "base/json/json_writer.h" #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/common/request_signer.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/common/request_signer.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/brave/post_connect_uphold.h b/components/brave_rewards/core/internal/endpoints/brave/post_connect_uphold.h similarity index 86% rename from components/brave_rewards/core/endpoints/brave/post_connect_uphold.h rename to components/brave_rewards/core/internal/endpoints/brave/post_connect_uphold.h index acbdf01a56e2..709f2365aafd 100644 --- a/components/brave_rewards/core/endpoints/brave/post_connect_uphold.h +++ b/components/brave_rewards/core/internal/endpoints/brave/post_connect_uphold.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CONNECT_UPHOLD_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CONNECT_UPHOLD_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CONNECT_UPHOLD_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CONNECT_UPHOLD_H_ #include #include #include -#include "brave/components/brave_rewards/core/endpoints/common/post_connect.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_connect.h" // POST /v3/wallet/uphold/{rewards_payment_id}/claim // @@ -66,4 +66,4 @@ class PostConnectUphold final : public PostConnect { } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CONNECT_UPHOLD_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CONNECT_UPHOLD_H_ diff --git a/components/brave_rewards/core/endpoints/brave/post_connect_zebpay.cc b/components/brave_rewards/core/internal/endpoints/brave/post_connect_zebpay.cc similarity index 88% rename from components/brave_rewards/core/endpoints/brave/post_connect_zebpay.cc rename to components/brave_rewards/core/internal/endpoints/brave/post_connect_zebpay.cc index 07b36c609fb4..f5a1b211a083 100644 --- a/components/brave_rewards/core/endpoints/brave/post_connect_zebpay.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/post_connect_zebpay.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/brave/post_connect_zebpay.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_connect_zebpay.h" #include #include #include "base/json/json_writer.h" #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/brave/post_connect_zebpay.h b/components/brave_rewards/core/internal/endpoints/brave/post_connect_zebpay.h similarity index 73% rename from components/brave_rewards/core/endpoints/brave/post_connect_zebpay.h rename to components/brave_rewards/core/internal/endpoints/brave/post_connect_zebpay.h index e16e43137674..91d478d21cc3 100644 --- a/components/brave_rewards/core/endpoints/brave/post_connect_zebpay.h +++ b/components/brave_rewards/core/internal/endpoints/brave/post_connect_zebpay.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CONNECT_ZEBPAY_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CONNECT_ZEBPAY_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CONNECT_ZEBPAY_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CONNECT_ZEBPAY_H_ #include #include -#include "brave/components/brave_rewards/core/endpoints/common/post_connect.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_connect.h" // POST /v3/wallet/zebpay/{rewards_payment_id}/claim // @@ -46,4 +46,4 @@ class PostConnectZebPay final : public PostConnect { } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_CONNECT_ZEBPAY_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_CONNECT_ZEBPAY_H_ diff --git a/components/brave_rewards/core/endpoints/brave/post_wallets.cc b/components/brave_rewards/core/internal/endpoints/brave/post_wallets.cc similarity index 91% rename from components/brave_rewards/core/endpoints/brave/post_wallets.cc rename to components/brave_rewards/core/internal/endpoints/brave/post_wallets.cc index e3d25510e53f..01b5f822ca7b 100644 --- a/components/brave_rewards/core/endpoints/brave/post_wallets.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/post_wallets.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/brave/post_wallets.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_wallets.h" #include #include @@ -11,10 +11,10 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/strings/string_number_conversions.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/request_signer.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/request_signer.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/brave/post_wallets.h b/components/brave_rewards/core/internal/endpoints/brave/post_wallets.h similarity index 70% rename from components/brave_rewards/core/endpoints/brave/post_wallets.h rename to components/brave_rewards/core/internal/endpoints/brave/post_wallets.h index b11cb8229908..f5db0a40a63d 100644 --- a/components/brave_rewards/core/endpoints/brave/post_wallets.h +++ b/components/brave_rewards/core/internal/endpoints/brave/post_wallets.h @@ -3,18 +3,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_WALLETS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_WALLETS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_WALLETS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_WALLETS_H_ #include #include #include -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" -#include "brave/components/brave_rewards/core/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // POST /v4/wallets // @@ -67,4 +67,4 @@ class PostWallets final : public RequestBuilder, } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_BRAVE_POST_WALLETS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_BRAVE_POST_WALLETS_H_ diff --git a/components/brave_rewards/core/endpoints/brave/post_wallets_unittest.cc b/components/brave_rewards/core/internal/endpoints/brave/post_wallets_unittest.cc similarity index 82% rename from components/brave_rewards/core/endpoints/brave/post_wallets_unittest.cc rename to components/brave_rewards/core/internal/endpoints/brave/post_wallets_unittest.cc index dfae27cb2d00..688d6fa8737e 100644 --- a/components/brave_rewards/core/endpoints/brave/post_wallets_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/brave/post_wallets_unittest.cc @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/brave/post_wallets.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_wallets.h" #include #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" @@ -24,12 +24,13 @@ namespace brave_rewards::internal::endpoints { using Error = PostWallets::Error; using Result = PostWallets::Result; -using PostWalletsParamType = std::tuple< - std::string, // test name suffix - net::HttpStatusCode, // post create wallet endpoint response status code - std::string, // post create wallet endpoint response body - Result // expected result ->; +using PostWalletsParamType = + std::tuple; class RewardsPostWalletsTest : public RewardsEngineTest, public WithParamInterface { diff --git a/components/brave_rewards/core/endpoints/common/get_transaction_status.cc b/components/brave_rewards/core/internal/endpoints/common/get_transaction_status.cc similarity index 89% rename from components/brave_rewards/core/endpoints/common/get_transaction_status.cc rename to components/brave_rewards/core/internal/endpoints/common/get_transaction_status.cc index 6eea97cdb89e..d4bac477acb7 100644 --- a/components/brave_rewards/core/endpoints/common/get_transaction_status.cc +++ b/components/brave_rewards/core/internal/endpoints/common/get_transaction_status.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/common/get_transaction_status.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/get_transaction_status.h" #include diff --git a/components/brave_rewards/core/endpoints/common/get_transaction_status.h b/components/brave_rewards/core/internal/endpoints/common/get_transaction_status.h similarity index 68% rename from components/brave_rewards/core/endpoints/common/get_transaction_status.h rename to components/brave_rewards/core/internal/endpoints/common/get_transaction_status.h index 299833320ed2..f3efa1fa6208 100644 --- a/components/brave_rewards/core/endpoints/common/get_transaction_status.h +++ b/components/brave_rewards/core/internal/endpoints/common/get_transaction_status.h @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_COMMON_GET_TRANSACTION_STATUS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_COMMON_GET_TRANSACTION_STATUS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_COMMON_GET_TRANSACTION_STATUS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_COMMON_GET_TRANSACTION_STATUS_H_ #include -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" namespace brave_rewards::internal { class RewardsEngine; @@ -33,4 +33,4 @@ class GetTransactionStatus : public RequestBuilder { } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_COMMON_GET_TRANSACTION_STATUS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_COMMON_GET_TRANSACTION_STATUS_H_ diff --git a/components/brave_rewards/core/endpoints/common/post_commit_transaction.cc b/components/brave_rewards/core/internal/endpoints/common/post_commit_transaction.cc similarity index 90% rename from components/brave_rewards/core/endpoints/common/post_commit_transaction.cc rename to components/brave_rewards/core/internal/endpoints/common/post_commit_transaction.cc index d393b4db50c2..ff2199f36a86 100644 --- a/components/brave_rewards/core/endpoints/common/post_commit_transaction.cc +++ b/components/brave_rewards/core/internal/endpoints/common/post_commit_transaction.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/common/post_commit_transaction.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_commit_transaction.h" #include diff --git a/components/brave_rewards/core/endpoints/common/post_commit_transaction.h b/components/brave_rewards/core/internal/endpoints/common/post_commit_transaction.h similarity index 65% rename from components/brave_rewards/core/endpoints/common/post_commit_transaction.h rename to components/brave_rewards/core/internal/endpoints/common/post_commit_transaction.h index 5bb1c5f79959..67d0b41c934b 100644 --- a/components/brave_rewards/core/endpoints/common/post_commit_transaction.h +++ b/components/brave_rewards/core/internal/endpoints/common/post_commit_transaction.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_COMMON_POST_COMMIT_TRANSACTION_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_COMMON_POST_COMMIT_TRANSACTION_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_COMMON_POST_COMMIT_TRANSACTION_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_COMMON_POST_COMMIT_TRANSACTION_H_ #include -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" namespace brave_rewards::internal { class RewardsEngine; @@ -33,4 +33,4 @@ class PostCommitTransaction : public RequestBuilder { } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_COMMON_POST_COMMIT_TRANSACTION_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_COMMON_POST_COMMIT_TRANSACTION_H_ diff --git a/components/brave_rewards/core/endpoints/common/post_connect.cc b/components/brave_rewards/core/internal/endpoints/common/post_connect.cc similarity index 95% rename from components/brave_rewards/core/endpoints/common/post_connect.cc rename to components/brave_rewards/core/internal/endpoints/common/post_connect.cc index 7b60eeeec216..888bbe64c52e 100644 --- a/components/brave_rewards/core/endpoints/common/post_connect.cc +++ b/components/brave_rewards/core/internal/endpoints/common/post_connect.cc @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/common/post_connect.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_connect.h" #include #include #include "base/json/json_reader.h" #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/request_signer.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/request_signer.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/common/post_connect.h b/components/brave_rewards/core/internal/endpoints/common/post_connect.h similarity index 67% rename from components/brave_rewards/core/endpoints/common/post_connect.h rename to components/brave_rewards/core/internal/endpoints/common/post_connect.h index 8b293c683af3..19ec8a67888c 100644 --- a/components/brave_rewards/core/endpoints/common/post_connect.h +++ b/components/brave_rewards/core/internal/endpoints/common/post_connect.h @@ -3,19 +3,19 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_COMMON_POST_CONNECT_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_COMMON_POST_CONNECT_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_COMMON_POST_CONNECT_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_COMMON_POST_CONNECT_H_ #include #include #include #include "base/strings/cstring_view.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" -#include "brave/components/brave_rewards/core/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" namespace brave_rewards::internal { class RewardsEngine; @@ -53,4 +53,4 @@ class PostConnect : public RequestBuilder, public ResponseHandler { } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_COMMON_POST_CONNECT_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_COMMON_POST_CONNECT_H_ diff --git a/components/brave_rewards/core/endpoints/common/post_connect_unittest.cc b/components/brave_rewards/core/internal/endpoints/common/post_connect_unittest.cc similarity index 90% rename from components/brave_rewards/core/endpoints/common/post_connect_unittest.cc rename to components/brave_rewards/core/internal/endpoints/common/post_connect_unittest.cc index 076158de8a49..d824a6f1b972 100644 --- a/components/brave_rewards/core/endpoints/common/post_connect_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/common/post_connect_unittest.cc @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/common/post_connect.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_connect.h" #include #include #include #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" @@ -37,12 +37,12 @@ class PostConnectMock final : public endpoints::PostConnect { } }; -using PostConnectParamType = std::tuple< - std::string, // test name suffix - net::HttpStatusCode, // connect endpoint response status code - std::string, // connect endpoint response body - Result // expected result ->; +using PostConnectParamType = + std::tuple; class RewardsPostConnectTest : public RewardsEngineTest, public WithParamInterface { diff --git a/components/brave_rewards/core/endpoints/common/post_create_transaction.cc b/components/brave_rewards/core/internal/endpoints/common/post_create_transaction.cc similarity index 91% rename from components/brave_rewards/core/endpoints/common/post_create_transaction.cc rename to components/brave_rewards/core/internal/endpoints/common/post_create_transaction.cc index 9368a9ca0949..faa66011df9c 100644 --- a/components/brave_rewards/core/endpoints/common/post_create_transaction.cc +++ b/components/brave_rewards/core/internal/endpoints/common/post_create_transaction.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/common/post_create_transaction.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_create_transaction.h" #include diff --git a/components/brave_rewards/core/endpoints/common/post_create_transaction.h b/components/brave_rewards/core/internal/endpoints/common/post_create_transaction.h similarity index 69% rename from components/brave_rewards/core/endpoints/common/post_create_transaction.h rename to components/brave_rewards/core/internal/endpoints/common/post_create_transaction.h index 89ee63490749..ba4e7f587e20 100644 --- a/components/brave_rewards/core/endpoints/common/post_create_transaction.h +++ b/components/brave_rewards/core/internal/endpoints/common/post_create_transaction.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_COMMON_POST_CREATE_TRANSACTION_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_COMMON_POST_CREATE_TRANSACTION_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_COMMON_POST_CREATE_TRANSACTION_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_COMMON_POST_CREATE_TRANSACTION_H_ #include -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" namespace brave_rewards::internal { class RewardsEngine; @@ -39,4 +39,4 @@ class PostCreateTransaction : public RequestBuilder { } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_COMMON_POST_CREATE_TRANSACTION_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_COMMON_POST_CREATE_TRANSACTION_H_ diff --git a/components/brave_rewards/core/endpoints/gemini/get_recipient_id_gemini.cc b/components/brave_rewards/core/internal/endpoints/gemini/get_recipient_id_gemini.cc similarity index 87% rename from components/brave_rewards/core/endpoints/gemini/get_recipient_id_gemini.cc rename to components/brave_rewards/core/internal/endpoints/gemini/get_recipient_id_gemini.cc index 166b02ca8f89..214c75023545 100644 --- a/components/brave_rewards/core/endpoints/gemini/get_recipient_id_gemini.cc +++ b/components/brave_rewards/core/internal/endpoints/gemini/get_recipient_id_gemini.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/gemini/get_recipient_id_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoints/gemini/get_recipient_id_gemini.h" #include #include #include "base/json/json_reader.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" #include "url/gurl.h" diff --git a/components/brave_rewards/core/endpoints/gemini/get_recipient_id_gemini.h b/components/brave_rewards/core/internal/endpoints/gemini/get_recipient_id_gemini.h similarity index 73% rename from components/brave_rewards/core/endpoints/gemini/get_recipient_id_gemini.h rename to components/brave_rewards/core/internal/endpoints/gemini/get_recipient_id_gemini.h index 7aa5eef8c9cb..c1f99536661e 100644 --- a/components/brave_rewards/core/endpoints/gemini/get_recipient_id_gemini.h +++ b/components/brave_rewards/core/internal/endpoints/gemini/get_recipient_id_gemini.h @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_GEMINI_GET_RECIPIENT_ID_GEMINI_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_GEMINI_GET_RECIPIENT_ID_GEMINI_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_GEMINI_GET_RECIPIENT_ID_GEMINI_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_GEMINI_GET_RECIPIENT_ID_GEMINI_H_ #include #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" -#include "brave/components/brave_rewards/core/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // GET /v1/payments/recipientIds // @@ -69,4 +69,4 @@ class GetRecipientIDGemini final } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_GEMINI_GET_RECIPIENT_ID_GEMINI_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_GEMINI_GET_RECIPIENT_ID_GEMINI_H_ diff --git a/components/brave_rewards/core/endpoints/gemini/get_recipient_id_gemini_unittest.cc b/components/brave_rewards/core/internal/endpoints/gemini/get_recipient_id_gemini_unittest.cc similarity index 82% rename from components/brave_rewards/core/endpoints/gemini/get_recipient_id_gemini_unittest.cc rename to components/brave_rewards/core/internal/endpoints/gemini/get_recipient_id_gemini_unittest.cc index 37461e7ce980..611d58c8088f 100644 --- a/components/brave_rewards/core/endpoints/gemini/get_recipient_id_gemini_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/gemini/get_recipient_id_gemini_unittest.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/gemini/get_recipient_id_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoints/gemini/get_recipient_id_gemini.h" #include #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" @@ -24,12 +24,13 @@ namespace brave_rewards::internal { using Error = endpoints::GetRecipientIDGemini::Error; using Result = endpoints::GetRecipientIDGemini::Result; -using GetRecipientIDGeminiParamType = std::tuple< - std::string, // test name suffix - net::HttpStatusCode, // GET recipient ID Gemini endpoint response status code - std::string, // GET recipient ID Gemini endpoint response body - Result // expected result ->; +using GetRecipientIDGeminiParamType = + std::tuple; class RewardsGetRecipientIDGeminiTest : public RewardsEngineTest, diff --git a/components/brave_rewards/core/endpoints/gemini/post_commit_transaction_gemini.cc b/components/brave_rewards/core/internal/endpoints/gemini/post_commit_transaction_gemini.cc similarity index 91% rename from components/brave_rewards/core/endpoints/gemini/post_commit_transaction_gemini.cc rename to components/brave_rewards/core/internal/endpoints/gemini/post_commit_transaction_gemini.cc index c1b4bbb6ada6..b19a507f1ec9 100644 --- a/components/brave_rewards/core/endpoints/gemini/post_commit_transaction_gemini.cc +++ b/components/brave_rewards/core/internal/endpoints/gemini/post_commit_transaction_gemini.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/gemini/post_commit_transaction_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoints/gemini/post_commit_transaction_gemini.h" #include #include @@ -11,8 +11,8 @@ #include "base/base64.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" #include "url/gurl.h" diff --git a/components/brave_rewards/core/endpoints/gemini/post_commit_transaction_gemini.h b/components/brave_rewards/core/internal/endpoints/gemini/post_commit_transaction_gemini.h similarity index 71% rename from components/brave_rewards/core/endpoints/gemini/post_commit_transaction_gemini.h rename to components/brave_rewards/core/internal/endpoints/gemini/post_commit_transaction_gemini.h index 8f081545c871..6c3e4954e2ba 100644 --- a/components/brave_rewards/core/endpoints/gemini/post_commit_transaction_gemini.h +++ b/components/brave_rewards/core/internal/endpoints/gemini/post_commit_transaction_gemini.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_GEMINI_POST_COMMIT_TRANSACTION_GEMINI_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_GEMINI_POST_COMMIT_TRANSACTION_GEMINI_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_GEMINI_POST_COMMIT_TRANSACTION_GEMINI_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_GEMINI_POST_COMMIT_TRANSACTION_GEMINI_H_ #include #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/common/post_commit_transaction.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_commit_transaction.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // POST /v1/payments/pay // @@ -57,4 +57,4 @@ class PostCommitTransactionGemini final } // namespace brave_rewards::internal::endpoints -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_GEMINI_POST_COMMIT_TRANSACTION_GEMINI_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_GEMINI_POST_COMMIT_TRANSACTION_GEMINI_H_ diff --git a/components/brave_rewards/core/endpoints/gemini/post_commit_transaction_gemini_unittest.cc b/components/brave_rewards/core/internal/endpoints/gemini/post_commit_transaction_gemini_unittest.cc similarity index 85% rename from components/brave_rewards/core/endpoints/gemini/post_commit_transaction_gemini_unittest.cc rename to components/brave_rewards/core/internal/endpoints/gemini/post_commit_transaction_gemini_unittest.cc index 0912de5dc38f..18c079d6f242 100644 --- a/components/brave_rewards/core/endpoints/gemini/post_commit_transaction_gemini_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/gemini/post_commit_transaction_gemini_unittest.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/gemini/post_commit_transaction_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoints/gemini/post_commit_transaction_gemini.h" #include #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" @@ -23,12 +23,13 @@ namespace brave_rewards::internal { using Error = endpoints::PostCommitTransactionGemini::Error; using Result = endpoints::PostCommitTransactionGemini::Result; -using PostCommitTransactionGeminiParamType = std::tuple< - std::string, // test name suffix - net::HttpStatusCode, // post commit transaction endpoint status code - std::string, // post commit transaction endpoint response body - Result // expected result ->; +using PostCommitTransactionGeminiParamType = + std::tuple; class RewardsPostCommitTransactionGeminiTest : public RewardsEngineTest, diff --git a/components/brave_rewards/core/endpoints/request_builder.cc b/components/brave_rewards/core/internal/endpoints/request_builder.cc similarity index 94% rename from components/brave_rewards/core/endpoints/request_builder.cc rename to components/brave_rewards/core/internal/endpoints/request_builder.cc index da59d65113fe..9795b75bce2e 100644 --- a/components/brave_rewards/core/endpoints/request_builder.cc +++ b/components/brave_rewards/core/internal/endpoints/request_builder.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" #include #include diff --git a/components/brave_rewards/core/endpoints/request_builder.h b/components/brave_rewards/core/internal/endpoints/request_builder.h similarity index 78% rename from components/brave_rewards/core/endpoints/request_builder.h rename to components/brave_rewards/core/internal/endpoints/request_builder.h index ccf58ec91f6b..97e5bea4884a 100644 --- a/components/brave_rewards/core/endpoints/request_builder.h +++ b/components/brave_rewards/core/internal/endpoints/request_builder.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_REQUEST_BUILDER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_REQUEST_BUILDER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_REQUEST_BUILDER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_REQUEST_BUILDER_H_ #include #include #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal { class RewardsEngine; @@ -50,4 +50,4 @@ class RequestBuilder { } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_REQUEST_BUILDER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_REQUEST_BUILDER_H_ diff --git a/components/brave_rewards/core/endpoints/request_for.h b/components/brave_rewards/core/internal/endpoints/request_for.h similarity index 82% rename from components/brave_rewards/core/endpoints/request_for.h rename to components/brave_rewards/core/internal/endpoints/request_for.h index 72a185e845ae..1d2368d52853 100644 --- a/components/brave_rewards/core/endpoints/request_for.h +++ b/components/brave_rewards/core/internal/endpoints/request_for.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_REQUEST_FOR_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_REQUEST_FOR_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_REQUEST_FOR_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_REQUEST_FOR_H_ #include #include @@ -13,10 +13,10 @@ #include "base/functional/callback.h" #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/common/callback_helpers.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/callback_helpers.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::endpoints { @@ -85,4 +85,4 @@ class RequestFor { } // namespace brave_rewards::internal::endpoints -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_REQUEST_FOR_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_REQUEST_FOR_H_ diff --git a/components/brave_rewards/core/endpoints/response_handler.h b/components/brave_rewards/core/internal/endpoints/response_handler.h similarity index 73% rename from components/brave_rewards/core/endpoints/response_handler.h rename to components/brave_rewards/core/internal/endpoints/response_handler.h index cca0b7a1f7e7..839e9c0a5158 100644 --- a/components/brave_rewards/core/endpoints/response_handler.h +++ b/components/brave_rewards/core/internal/endpoints/response_handler.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_RESPONSE_HANDLER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_RESPONSE_HANDLER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_RESPONSE_HANDLER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_RESPONSE_HANDLER_H_ #include #include "base/functional/callback.h" #include "base/types/expected.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/result_for.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal::endpoints { @@ -42,4 +42,4 @@ class ResponseHandler { } // namespace brave_rewards::internal::endpoints -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_RESPONSE_HANDLER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_RESPONSE_HANDLER_H_ diff --git a/components/brave_rewards/core/endpoints/result_for.h b/components/brave_rewards/core/internal/endpoints/result_for.h similarity index 72% rename from components/brave_rewards/core/endpoints/result_for.h rename to components/brave_rewards/core/internal/endpoints/result_for.h index 5cb971771631..5cfa6c1c5a56 100644 --- a/components/brave_rewards/core/endpoints/result_for.h +++ b/components/brave_rewards/core/internal/endpoints/result_for.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_RESULT_FOR_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_RESULT_FOR_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_RESULT_FOR_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_RESULT_FOR_H_ namespace brave_rewards::internal::endpoints { @@ -19,4 +19,4 @@ struct ResultFor { } // namespace brave_rewards::internal::endpoints -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_RESULT_FOR_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_RESULT_FOR_H_ diff --git a/components/brave_rewards/core/endpoints/uphold/get_transaction_status_uphold.cc b/components/brave_rewards/core/internal/endpoints/uphold/get_transaction_status_uphold.cc similarity index 90% rename from components/brave_rewards/core/endpoints/uphold/get_transaction_status_uphold.cc rename to components/brave_rewards/core/internal/endpoints/uphold/get_transaction_status_uphold.cc index 3068b0030d2b..968f8de6c673 100644 --- a/components/brave_rewards/core/endpoints/uphold/get_transaction_status_uphold.cc +++ b/components/brave_rewards/core/internal/endpoints/uphold/get_transaction_status_uphold.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/uphold/get_transaction_status_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/uphold/get_transaction_status_uphold.h" #include #include #include "base/json/json_reader.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/uphold/get_transaction_status_uphold.h b/components/brave_rewards/core/internal/endpoints/uphold/get_transaction_status_uphold.h similarity index 84% rename from components/brave_rewards/core/endpoints/uphold/get_transaction_status_uphold.h rename to components/brave_rewards/core/internal/endpoints/uphold/get_transaction_status_uphold.h index 974eb0fba2ad..dce10d6a7b51 100644 --- a/components/brave_rewards/core/endpoints/uphold/get_transaction_status_uphold.h +++ b/components/brave_rewards/core/internal/endpoints/uphold/get_transaction_status_uphold.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_UPHOLD_GET_TRANSACTION_STATUS_UPHOLD_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_UPHOLD_GET_TRANSACTION_STATUS_UPHOLD_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_UPHOLD_GET_TRANSACTION_STATUS_UPHOLD_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_UPHOLD_GET_TRANSACTION_STATUS_UPHOLD_H_ #include #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/common/get_transaction_status.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/get_transaction_status.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // GET /v0/me/transactions/:transaction-id // @@ -127,4 +127,4 @@ class GetTransactionStatusUphold final } // namespace brave_rewards::internal::endpoints -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_UPHOLD_GET_TRANSACTION_STATUS_UPHOLD_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_UPHOLD_GET_TRANSACTION_STATUS_UPHOLD_H_ diff --git a/components/brave_rewards/core/endpoints/uphold/get_transaction_status_uphold_unittest.cc b/components/brave_rewards/core/internal/endpoints/uphold/get_transaction_status_uphold_unittest.cc similarity index 83% rename from components/brave_rewards/core/endpoints/uphold/get_transaction_status_uphold_unittest.cc rename to components/brave_rewards/core/internal/endpoints/uphold/get_transaction_status_uphold_unittest.cc index ecdac5ce1891..e31107791629 100644 --- a/components/brave_rewards/core/endpoints/uphold/get_transaction_status_uphold_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/uphold/get_transaction_status_uphold_unittest.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/uphold/get_transaction_status_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/uphold/get_transaction_status_uphold.h" #include #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" @@ -23,12 +23,13 @@ namespace brave_rewards::internal { using Error = endpoints::GetTransactionStatusUphold::Error; using Result = endpoints::GetTransactionStatusUphold::Result; -using GetTransactionStatusUpholdParamType = std::tuple< - std::string, // test name suffix - net::HttpStatusCode, // get transaction status endpoint status code - std::string, // get transaction status endpoint response body - Result // expected result ->; +using GetTransactionStatusUpholdParamType = + std::tuple; class RewardsGetTransactionStatusUpholdTest : public RewardsEngineTest, diff --git a/components/brave_rewards/core/endpoints/uphold/post_commit_transaction_uphold.cc b/components/brave_rewards/core/internal/endpoints/uphold/post_commit_transaction_uphold.cc similarity index 88% rename from components/brave_rewards/core/endpoints/uphold/post_commit_transaction_uphold.cc rename to components/brave_rewards/core/internal/endpoints/uphold/post_commit_transaction_uphold.cc index 1dc3884a718d..e5c8081119bb 100644 --- a/components/brave_rewards/core/endpoints/uphold/post_commit_transaction_uphold.cc +++ b/components/brave_rewards/core/internal/endpoints/uphold/post_commit_transaction_uphold.cc @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/uphold/post_commit_transaction_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/uphold/post_commit_transaction_uphold.h" #include #include #include "base/json/json_reader.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/uphold/post_commit_transaction_uphold.h b/components/brave_rewards/core/internal/endpoints/uphold/post_commit_transaction_uphold.h similarity index 84% rename from components/brave_rewards/core/endpoints/uphold/post_commit_transaction_uphold.h rename to components/brave_rewards/core/internal/endpoints/uphold/post_commit_transaction_uphold.h index 7b3937c29b8d..04c2d68bac5d 100644 --- a/components/brave_rewards/core/endpoints/uphold/post_commit_transaction_uphold.h +++ b/components/brave_rewards/core/internal/endpoints/uphold/post_commit_transaction_uphold.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_UPHOLD_POST_COMMIT_TRANSACTION_UPHOLD_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_UPHOLD_POST_COMMIT_TRANSACTION_UPHOLD_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_UPHOLD_POST_COMMIT_TRANSACTION_UPHOLD_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_UPHOLD_POST_COMMIT_TRANSACTION_UPHOLD_H_ #include #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/common/post_commit_transaction.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_commit_transaction.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // POST /v0/me/cards/:card-id/transactions/:transaction-id/commit // @@ -127,4 +127,4 @@ class PostCommitTransactionUphold final } // namespace brave_rewards::internal::endpoints -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_UPHOLD_POST_COMMIT_TRANSACTION_UPHOLD_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_UPHOLD_POST_COMMIT_TRANSACTION_UPHOLD_H_ diff --git a/components/brave_rewards/core/endpoints/uphold/post_commit_transaction_uphold_unittest.cc b/components/brave_rewards/core/internal/endpoints/uphold/post_commit_transaction_uphold_unittest.cc similarity index 84% rename from components/brave_rewards/core/endpoints/uphold/post_commit_transaction_uphold_unittest.cc rename to components/brave_rewards/core/internal/endpoints/uphold/post_commit_transaction_uphold_unittest.cc index 0f592d96fb37..2227f20efce7 100644 --- a/components/brave_rewards/core/endpoints/uphold/post_commit_transaction_uphold_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/uphold/post_commit_transaction_uphold_unittest.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/uphold/post_commit_transaction_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/uphold/post_commit_transaction_uphold.h" #include #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" @@ -23,12 +23,13 @@ namespace brave_rewards::internal { using Error = endpoints::PostCommitTransactionUphold::Error; using Result = endpoints::PostCommitTransactionUphold::Result; -using PostCommitTransactionUpholdParamType = std::tuple< - std::string, // test name suffix - net::HttpStatusCode, // post commit transaction endpoint status code - std::string, // post commit transaction endpoint response body - Result // expected result ->; +using PostCommitTransactionUpholdParamType = + std::tuple; class RewardsPostCommitTransactionUpholdTest : public RewardsEngineTest, diff --git a/components/brave_rewards/core/endpoints/uphold/post_create_transaction_uphold.cc b/components/brave_rewards/core/internal/endpoints/uphold/post_create_transaction_uphold.cc similarity index 89% rename from components/brave_rewards/core/endpoints/uphold/post_create_transaction_uphold.cc rename to components/brave_rewards/core/internal/endpoints/uphold/post_create_transaction_uphold.cc index 382f7ad3e10d..e30299fe0d6b 100644 --- a/components/brave_rewards/core/endpoints/uphold/post_create_transaction_uphold.cc +++ b/components/brave_rewards/core/internal/endpoints/uphold/post_create_transaction_uphold.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/uphold/post_create_transaction_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/uphold/post_create_transaction_uphold.h" #include #include @@ -11,9 +11,9 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/uphold/post_create_transaction_uphold.h b/components/brave_rewards/core/internal/endpoints/uphold/post_create_transaction_uphold.h similarity index 85% rename from components/brave_rewards/core/endpoints/uphold/post_create_transaction_uphold.h rename to components/brave_rewards/core/internal/endpoints/uphold/post_create_transaction_uphold.h index f382609a95e1..f8a4dc95ad5a 100644 --- a/components/brave_rewards/core/endpoints/uphold/post_create_transaction_uphold.h +++ b/components/brave_rewards/core/internal/endpoints/uphold/post_create_transaction_uphold.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_UPHOLD_POST_CREATE_TRANSACTION_UPHOLD_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_UPHOLD_POST_CREATE_TRANSACTION_UPHOLD_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_UPHOLD_POST_CREATE_TRANSACTION_UPHOLD_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_UPHOLD_POST_CREATE_TRANSACTION_UPHOLD_H_ #include #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/common/post_create_transaction.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_create_transaction.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // POST /v0/me/cards/:card-id/transactions // @@ -128,4 +128,4 @@ class PostCreateTransactionUphold final } // namespace brave_rewards::internal::endpoints -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_UPHOLD_POST_CREATE_TRANSACTION_UPHOLD_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_UPHOLD_POST_CREATE_TRANSACTION_UPHOLD_H_ diff --git a/components/brave_rewards/core/endpoints/uphold/post_create_transaction_uphold_unittest.cc b/components/brave_rewards/core/internal/endpoints/uphold/post_create_transaction_uphold_unittest.cc similarity index 81% rename from components/brave_rewards/core/endpoints/uphold/post_create_transaction_uphold_unittest.cc rename to components/brave_rewards/core/internal/endpoints/uphold/post_create_transaction_uphold_unittest.cc index f03ee4175470..fc0a06fbc474 100644 --- a/components/brave_rewards/core/endpoints/uphold/post_create_transaction_uphold_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/uphold/post_create_transaction_uphold_unittest.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/uphold/post_create_transaction_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/uphold/post_create_transaction_uphold.h" #include #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" @@ -23,12 +23,13 @@ namespace brave_rewards::internal::endpoints { using Error = endpoints::PostCreateTransactionUphold::Error; using Result = endpoints::PostCreateTransactionUphold::Result; -using PostCreateTransactionUpholdParamType = std::tuple< - std::string, // test name suffix - net::HttpStatusCode, // post create transaction endpoint status code - std::string, // post create transaction endpoint response body - Result // expected result ->; +using PostCreateTransactionUpholdParamType = + std::tuple; class RewardsPostCreateTransactionUpholdTest : public RewardsEngineTest, diff --git a/components/brave_rewards/core/endpoints/uphold/post_oauth_uphold.cc b/components/brave_rewards/core/internal/endpoints/uphold/post_oauth_uphold.cc similarity index 89% rename from components/brave_rewards/core/endpoints/uphold/post_oauth_uphold.cc rename to components/brave_rewards/core/internal/endpoints/uphold/post_oauth_uphold.cc index 8673e90c93d6..a07d3165b85a 100644 --- a/components/brave_rewards/core/endpoints/uphold/post_oauth_uphold.cc +++ b/components/brave_rewards/core/internal/endpoints/uphold/post_oauth_uphold.cc @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/uphold/post_oauth_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/uphold/post_oauth_uphold.h" #include #include #include "base/base64.h" #include "base/json/json_reader.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/uphold/post_oauth_uphold.h b/components/brave_rewards/core/internal/endpoints/uphold/post_oauth_uphold.h similarity index 74% rename from components/brave_rewards/core/endpoints/uphold/post_oauth_uphold.h rename to components/brave_rewards/core/internal/endpoints/uphold/post_oauth_uphold.h index fe3c557158c8..e90b8cc7ac71 100644 --- a/components/brave_rewards/core/endpoints/uphold/post_oauth_uphold.h +++ b/components/brave_rewards/core/internal/endpoints/uphold/post_oauth_uphold.h @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_UPHOLD_POST_OAUTH_UPHOLD_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_UPHOLD_POST_OAUTH_UPHOLD_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_UPHOLD_POST_OAUTH_UPHOLD_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_UPHOLD_POST_OAUTH_UPHOLD_H_ #include #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" -#include "brave/components/brave_rewards/core/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // POST /oauth2/token // @@ -66,4 +66,4 @@ class PostOAuthUphold final : public RequestBuilder, } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_UPHOLD_POST_OAUTH_UPHOLD_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_UPHOLD_POST_OAUTH_UPHOLD_H_ diff --git a/components/brave_rewards/core/endpoints/uphold/post_oauth_uphold_unittest.cc b/components/brave_rewards/core/internal/endpoints/uphold/post_oauth_uphold_unittest.cc similarity index 82% rename from components/brave_rewards/core/endpoints/uphold/post_oauth_uphold_unittest.cc rename to components/brave_rewards/core/internal/endpoints/uphold/post_oauth_uphold_unittest.cc index ef4ded1a2f07..e15c43d15cc8 100644 --- a/components/brave_rewards/core/endpoints/uphold/post_oauth_uphold_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/uphold/post_oauth_uphold_unittest.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/uphold/post_oauth_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/uphold/post_oauth_uphold.h" #include #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" @@ -23,12 +23,13 @@ namespace brave_rewards::internal { using Error = endpoints::PostOAuthUphold::Error; using Result = endpoints::PostOAuthUphold::Result; -using PostOAuthUpholdParamType = std::tuple< - std::string, // test name suffix - net::HttpStatusCode, // post OAuth Uphold endpoint response status code - std::string, // post OAuth Uphold endpoint response body - Result // expected result ->; +using PostOAuthUpholdParamType = + std::tuple; class RewardsPostOAuthUpholdTest : public RewardsEngineTest, diff --git a/components/brave_rewards/core/endpoints/zebpay/get_balance_zebpay.cc b/components/brave_rewards/core/internal/endpoints/zebpay/get_balance_zebpay.cc similarity index 90% rename from components/brave_rewards/core/endpoints/zebpay/get_balance_zebpay.cc rename to components/brave_rewards/core/internal/endpoints/zebpay/get_balance_zebpay.cc index b570021ebaa7..892ea87c4977 100644 --- a/components/brave_rewards/core/endpoints/zebpay/get_balance_zebpay.cc +++ b/components/brave_rewards/core/internal/endpoints/zebpay/get_balance_zebpay.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/zebpay/get_balance_zebpay.h" +#include "brave/components/brave_rewards/core/internal/endpoints/zebpay/get_balance_zebpay.h" #include #include #include "base/json/json_reader.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/zebpay/get_balance_zebpay.h b/components/brave_rewards/core/internal/endpoints/zebpay/get_balance_zebpay.h similarity index 68% rename from components/brave_rewards/core/endpoints/zebpay/get_balance_zebpay.h rename to components/brave_rewards/core/internal/endpoints/zebpay/get_balance_zebpay.h index a8d072a09a1f..46fd70cfebd6 100644 --- a/components/brave_rewards/core/endpoints/zebpay/get_balance_zebpay.h +++ b/components/brave_rewards/core/internal/endpoints/zebpay/get_balance_zebpay.h @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_ZEBPAY_GET_BALANCE_ZEBPAY_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_ZEBPAY_GET_BALANCE_ZEBPAY_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_ZEBPAY_GET_BALANCE_ZEBPAY_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_ZEBPAY_GET_BALANCE_ZEBPAY_H_ #include #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" -#include "brave/components/brave_rewards/core/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // GET /api/balance // @@ -59,4 +59,4 @@ class GetBalanceZebPay final : public RequestBuilder, } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_ZEBPAY_GET_BALANCE_ZEBPAY_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_ZEBPAY_GET_BALANCE_ZEBPAY_H_ diff --git a/components/brave_rewards/core/endpoints/zebpay/get_balance_zebpay_unittest.cc b/components/brave_rewards/core/internal/endpoints/zebpay/get_balance_zebpay_unittest.cc similarity index 80% rename from components/brave_rewards/core/endpoints/zebpay/get_balance_zebpay_unittest.cc rename to components/brave_rewards/core/internal/endpoints/zebpay/get_balance_zebpay_unittest.cc index 974d5a0421c1..9cd3663909a1 100644 --- a/components/brave_rewards/core/endpoints/zebpay/get_balance_zebpay_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/zebpay/get_balance_zebpay_unittest.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/zebpay/get_balance_zebpay.h" +#include "brave/components/brave_rewards/core/internal/endpoints/zebpay/get_balance_zebpay.h" #include #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" @@ -24,12 +24,13 @@ namespace brave_rewards::internal { using Error = endpoints::GetBalanceZebPay::Error; using Result = endpoints::GetBalanceZebPay::Result; -using GetBalanceZebPayParamType = std::tuple< - std::string, // test name suffix - net::HttpStatusCode, // GET balance ZebPay endpoint response status code - std::string, // GET balance ZebPay endpoint response body - Result // expected result ->; +using GetBalanceZebPayParamType = + std::tuple; class RewardsGetBalanceZebPayTest : public RewardsEngineTest, diff --git a/components/brave_rewards/core/endpoints/zebpay/post_oauth_zebpay.cc b/components/brave_rewards/core/internal/endpoints/zebpay/post_oauth_zebpay.cc similarity index 94% rename from components/brave_rewards/core/endpoints/zebpay/post_oauth_zebpay.cc rename to components/brave_rewards/core/internal/endpoints/zebpay/post_oauth_zebpay.cc index 5090521d8a0e..4310e9a95f07 100644 --- a/components/brave_rewards/core/endpoints/zebpay/post_oauth_zebpay.cc +++ b/components/brave_rewards/core/internal/endpoints/zebpay/post_oauth_zebpay.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/zebpay/post_oauth_zebpay.h" +#include "brave/components/brave_rewards/core/internal/endpoints/zebpay/post_oauth_zebpay.h" #include #include @@ -12,8 +12,8 @@ #include "base/json/json_reader.h" #include "base/strings/strcat.h" #include "base/types/expected.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::endpoints { diff --git a/components/brave_rewards/core/endpoints/zebpay/post_oauth_zebpay.h b/components/brave_rewards/core/internal/endpoints/zebpay/post_oauth_zebpay.h similarity index 76% rename from components/brave_rewards/core/endpoints/zebpay/post_oauth_zebpay.h rename to components/brave_rewards/core/internal/endpoints/zebpay/post_oauth_zebpay.h index a1eb9a667a2c..ac2ecc85fc29 100644 --- a/components/brave_rewards/core/endpoints/zebpay/post_oauth_zebpay.h +++ b/components/brave_rewards/core/internal/endpoints/zebpay/post_oauth_zebpay.h @@ -3,18 +3,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_ZEBPAY_POST_OAUTH_ZEBPAY_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_ZEBPAY_POST_OAUTH_ZEBPAY_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_ZEBPAY_POST_OAUTH_ZEBPAY_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_ZEBPAY_POST_OAUTH_ZEBPAY_H_ #include #include #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/request_builder.h" -#include "brave/components/brave_rewards/core/endpoints/response_handler.h" -#include "brave/components/brave_rewards/core/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_builder.h" +#include "brave/components/brave_rewards/core/internal/endpoints/response_handler.h" +#include "brave/components/brave_rewards/core/internal/endpoints/result_for.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" // POST /connect/token // @@ -73,4 +73,4 @@ class PostOAuthZebPay final : public RequestBuilder, } // namespace endpoints } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ENDPOINTS_ZEBPAY_POST_OAUTH_ZEBPAY_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ENDPOINTS_ZEBPAY_POST_OAUTH_ZEBPAY_H_ diff --git a/components/brave_rewards/core/endpoints/zebpay/post_oauth_zebpay_unittest.cc b/components/brave_rewards/core/internal/endpoints/zebpay/post_oauth_zebpay_unittest.cc similarity index 85% rename from components/brave_rewards/core/endpoints/zebpay/post_oauth_zebpay_unittest.cc rename to components/brave_rewards/core/internal/endpoints/zebpay/post_oauth_zebpay_unittest.cc index 4fbfc7ad3bbb..808b1d038ee0 100644 --- a/components/brave_rewards/core/endpoints/zebpay/post_oauth_zebpay_unittest.cc +++ b/components/brave_rewards/core/internal/endpoints/zebpay/post_oauth_zebpay_unittest.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/endpoints/zebpay/post_oauth_zebpay.h" +#include "brave/components/brave_rewards/core/internal/endpoints/zebpay/post_oauth_zebpay.h" #include #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" @@ -24,12 +24,13 @@ namespace brave_rewards::internal { using Error = endpoints::PostOAuthZebPay::Error; using Result = endpoints::PostOAuthZebPay::Result; -using PostOAuthZebPayParamType = std::tuple< - std::string, // test name suffix - net::HttpStatusCode, // post OAuth ZebPay endpoint response status code - std::string, // post OAuth ZebPay endpoint response body - Result // expected result ->; +using PostOAuthZebPayParamType = + std::tuple; class RewardsPostOAuthZebPayTest : public RewardsEngineTest, diff --git a/components/brave_rewards/core/gemini/gemini.cc b/components/brave_rewards/core/internal/gemini/gemini.cc similarity index 73% rename from components/brave_rewards/core/gemini/gemini.cc rename to components/brave_rewards/core/internal/gemini/gemini.cc index 50a66c4f06d0..ed94e6538f70 100644 --- a/components/brave_rewards/core/gemini/gemini.cc +++ b/components/brave_rewards/core/internal/gemini/gemini.cc @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/gemini/gemini.h" +#include "brave/components/brave_rewards/core/internal/gemini/gemini.h" #include #include -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet_provider/gemini/connect_gemini_wallet.h" -#include "brave/components/brave_rewards/core/wallet_provider/gemini/gemini_transfer.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/gemini/connect_gemini_wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/gemini/gemini_transfer.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal::gemini { diff --git a/components/brave_rewards/core/gemini/gemini.h b/components/brave_rewards/core/internal/gemini/gemini.h similarity index 68% rename from components/brave_rewards/core/gemini/gemini.h rename to components/brave_rewards/core/internal/gemini/gemini.h index d9f465a2a1a1..9949e0a4d8fa 100644 --- a/components/brave_rewards/core/gemini/gemini.h +++ b/components/brave_rewards/core/internal/gemini/gemini.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_GEMINI_GEMINI_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_GEMINI_GEMINI_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_GEMINI_GEMINI_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_GEMINI_GEMINI_H_ #include #include "base/functional/callback_forward.h" #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/endpoint/gemini/gemini_server.h" -#include "brave/components/brave_rewards/core/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/gemini_server.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal { class RewardsEngine; @@ -41,4 +41,4 @@ class Gemini final : public wallet_provider::WalletProvider { } // namespace gemini } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_GEMINI_GEMINI_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_GEMINI_GEMINI_H_ diff --git a/components/brave_rewards/core/global_constants.h b/components/brave_rewards/core/internal/global_constants.h similarity index 76% rename from components/brave_rewards/core/global_constants.h rename to components/brave_rewards/core/internal/global_constants.h index 55cab6355654..9a0923c54287 100644 --- a/components/brave_rewards/core/global_constants.h +++ b/components/brave_rewards/core/internal/global_constants.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_GLOBAL_CONSTANTS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_GLOBAL_CONSTANTS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_GLOBAL_CONSTANTS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_GLOBAL_CONSTANTS_H_ namespace brave_rewards::internal { namespace constant { @@ -19,4 +19,4 @@ inline constexpr char kWalletSolana[] = "solana"; } // namespace constant } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_GLOBAL_CONSTANTS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_GLOBAL_CONSTANTS_H_ diff --git a/components/brave_rewards/core/initialization_manager.cc b/components/brave_rewards/core/internal/initialization_manager.cc similarity index 85% rename from components/brave_rewards/core/initialization_manager.cc rename to components/brave_rewards/core/internal/initialization_manager.cc index b5cff6a306ad..b3c43f23fcd3 100644 --- a/components/brave_rewards/core/initialization_manager.cc +++ b/components/brave_rewards/core/internal/initialization_manager.cc @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/initialization_manager.h" +#include "brave/components/brave_rewards/core/internal/initialization_manager.h" #include -#include "brave/components/brave_rewards/core/contribution/contribution.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/parameters/rewards_parameters_provider.h" -#include "brave/components/brave_rewards/core/publisher/publisher.h" -#include "brave/components/brave_rewards/core/state/state.h" -#include "brave/components/brave_rewards/core/uphold/uphold.h" -#include "brave/components/brave_rewards/core/wallet_provider/linkage_checker.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/parameters/rewards_parameters_provider.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/linkage_checker.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/initialization_manager.h b/components/brave_rewards/core/internal/initialization_manager.h similarity index 84% rename from components/brave_rewards/core/initialization_manager.h rename to components/brave_rewards/core/internal/initialization_manager.h index acba9d54d0a0..3c089e09c46b 100644 --- a/components/brave_rewards/core/initialization_manager.h +++ b/components/brave_rewards/core/internal/initialization_manager.h @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INITIALIZATION_MANAGER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INITIALIZATION_MANAGER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_INITIALIZATION_MANAGER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_INITIALIZATION_MANAGER_H_ #include "base/functional/callback.h" #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/rewards_engine_helper.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine_helper.h" namespace brave_rewards::internal { @@ -47,4 +47,4 @@ class InitializationManager : public RewardsEngineHelper, } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INITIALIZATION_MANAGER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_INITIALIZATION_MANAGER_H_ diff --git a/components/brave_rewards/core/legacy/DEPS b/components/brave_rewards/core/internal/legacy/DEPS similarity index 100% rename from components/brave_rewards/core/legacy/DEPS rename to components/brave_rewards/core/internal/legacy/DEPS diff --git a/components/brave_rewards/core/legacy/bat_state.cc b/components/brave_rewards/core/internal/legacy/bat_state.cc similarity index 82% rename from components/brave_rewards/core/legacy/bat_state.cc rename to components/brave_rewards/core/internal/legacy/bat_state.cc index a24ff9d56833..66518e6bcb2a 100644 --- a/components/brave_rewards/core/legacy/bat_state.cc +++ b/components/brave_rewards/core/internal/legacy/bat_state.cc @@ -3,13 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/legacy/bat_state.h" + #include #include -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/legacy/bat_state.h" -#include "brave/components/brave_rewards/core/legacy/client_properties.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "base/strings/string_number_conversions.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/legacy/client_properties.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal { @@ -41,12 +43,12 @@ void LegacyBatState::OnLoad(ResultCallback callback, state_ = std::move(state); // fix timestamp ms to s conversion - if (std::to_string(state_.reconcile_timestamp).length() > 10) { + if (base::NumberToString(state_.reconcile_timestamp).length() > 10) { state_.reconcile_timestamp = state_.reconcile_timestamp / 1000; } // fix timestamp ms to s conversion - if (std::to_string(state_.boot_timestamp).length() > 10) { + if (base::NumberToString(state_.boot_timestamp).length() > 10) { state_.boot_timestamp = state_.boot_timestamp / 1000; } diff --git a/components/brave_rewards/core/legacy/bat_state.h b/components/brave_rewards/core/internal/legacy/bat_state.h similarity index 71% rename from components/brave_rewards/core/legacy/bat_state.h rename to components/brave_rewards/core/internal/legacy/bat_state.h index 043b91316efc..70048a0bc14e 100644 --- a/components/brave_rewards/core/legacy/bat_state.h +++ b/components/brave_rewards/core/internal/legacy/bat_state.h @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_BAT_STATE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_BAT_STATE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_BAT_STATE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_BAT_STATE_H_ #include #include #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/legacy/client_properties.h" -#include "brave/components/brave_rewards/core/legacy/wallet_info_properties.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/legacy/client_properties.h" +#include "brave/components/brave_rewards/core/internal/legacy/wallet_info_properties.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { @@ -55,4 +55,4 @@ class LegacyBatState { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_BAT_STATE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_BAT_STATE_H_ diff --git a/components/brave_rewards/core/legacy/bat_util.cc b/components/brave_rewards/core/internal/legacy/bat_util.cc similarity index 94% rename from components/brave_rewards/core/legacy/bat_util.cc rename to components/brave_rewards/core/internal/legacy/bat_util.cc index b1d956ee3b84..11fc00f5e3a2 100644 --- a/components/brave_rewards/core/legacy/bat_util.cc +++ b/components/brave_rewards/core/internal/legacy/bat_util.cc @@ -3,7 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/legacy/bat_util.h" +#include "brave/components/brave_rewards/core/internal/legacy/bat_util.h" + #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" diff --git a/components/brave_rewards/core/legacy/bat_util.h b/components/brave_rewards/core/internal/legacy/bat_util.h similarity index 68% rename from components/brave_rewards/core/legacy/bat_util.h rename to components/brave_rewards/core/internal/legacy/bat_util.h index 143a59d872f0..910808d9c9ea 100644 --- a/components/brave_rewards/core/legacy/bat_util.h +++ b/components/brave_rewards/core/internal/legacy/bat_util.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_BAT_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_BAT_UTIL_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_BAT_UTIL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_BAT_UTIL_H_ #include @@ -16,4 +16,4 @@ double ProbiToDouble(const std::string& probi); } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_BAT_UTIL_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_BAT_UTIL_H_ diff --git a/components/brave_rewards/core/legacy/bat_util_unittest.cc b/components/brave_rewards/core/internal/legacy/bat_util_unittest.cc similarity index 95% rename from components/brave_rewards/core/legacy/bat_util_unittest.cc rename to components/brave_rewards/core/internal/legacy/bat_util_unittest.cc index b7db87241a6f..506aea8d35b3 100644 --- a/components/brave_rewards/core/legacy/bat_util_unittest.cc +++ b/components/brave_rewards/core/internal/legacy/bat_util_unittest.cc @@ -3,7 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/legacy/bat_util.h" +#include "brave/components/brave_rewards/core/internal/legacy/bat_util.h" + #include "testing/gtest/include/gtest/gtest.h" // npm run test -- brave_unit_tests --filter=BatUtilTest.* diff --git a/components/brave_rewards/core/legacy/client_properties.cc b/components/brave_rewards/core/internal/legacy/client_properties.cc similarity index 97% rename from components/brave_rewards/core/legacy/client_properties.cc rename to components/brave_rewards/core/internal/legacy/client_properties.cc index 0bd9d0e47fe8..ab585c57a206 100644 --- a/components/brave_rewards/core/legacy/client_properties.cc +++ b/components/brave_rewards/core/internal/legacy/client_properties.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/legacy/client_properties.h" +#include "brave/components/brave_rewards/core/internal/legacy/client_properties.h" #include @@ -11,7 +11,7 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/json/values_util.h" -#include "brave/components/brave_rewards/core/constants.h" +#include "brave/components/brave_rewards/core/internal/constants.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/legacy/client_properties.h b/components/brave_rewards/core/internal/legacy/client_properties.h similarity index 72% rename from components/brave_rewards/core/legacy/client_properties.h rename to components/brave_rewards/core/internal/legacy/client_properties.h index 34e4bbca9e37..2392288b546a 100644 --- a/components/brave_rewards/core/legacy/client_properties.h +++ b/components/brave_rewards/core/internal/legacy/client_properties.h @@ -3,16 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_CLIENT_PROPERTIES_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_CLIENT_PROPERTIES_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_CLIENT_PROPERTIES_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_CLIENT_PROPERTIES_H_ #include + #include #include #include "base/values.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/legacy/wallet_info_properties.h" +#include "brave/components/brave_rewards/core/internal/legacy/wallet_info_properties.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal { @@ -43,4 +44,4 @@ struct ClientProperties { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_CLIENT_PROPERTIES_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_CLIENT_PROPERTIES_H_ diff --git a/components/brave_rewards/core/legacy/client_state_unittest.cc b/components/brave_rewards/core/internal/legacy/client_state_unittest.cc similarity index 99% rename from components/brave_rewards/core/legacy/client_state_unittest.cc rename to components/brave_rewards/core/internal/legacy/client_state_unittest.cc index 4dc850638124..b44fab25fa6e 100644 --- a/components/brave_rewards/core/legacy/client_state_unittest.cc +++ b/components/brave_rewards/core/internal/legacy/client_state_unittest.cc @@ -7,7 +7,7 @@ #include #include "base/base64.h" -#include "brave/components/brave_rewards/core/legacy/client_properties.h" +#include "brave/components/brave_rewards/core/internal/legacy/client_properties.h" #include "testing/gtest/include/gtest/gtest.h" // npm run test -- brave_unit_tests --filter=ClientStateTest.* diff --git a/components/brave_rewards/core/legacy/publisher_settings_properties.cc b/components/brave_rewards/core/internal/legacy/publisher_settings_properties.cc similarity index 97% rename from components/brave_rewards/core/legacy/publisher_settings_properties.cc rename to components/brave_rewards/core/internal/legacy/publisher_settings_properties.cc index 90ea0fdec2a3..f39ab6fb0caa 100644 --- a/components/brave_rewards/core/legacy/publisher_settings_properties.cc +++ b/components/brave_rewards/core/internal/legacy/publisher_settings_properties.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/legacy/publisher_settings_properties.h" +#include "brave/components/brave_rewards/core/internal/legacy/publisher_settings_properties.h" #include @@ -12,7 +12,7 @@ #include "base/json/json_writer.h" #include "base/json/values_util.h" #include "base/logging.h" -#include "brave/components/brave_rewards/core/constants.h" +#include "brave/components/brave_rewards/core/internal/constants.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/legacy/publisher_settings_properties.h b/components/brave_rewards/core/internal/legacy/publisher_settings_properties.h similarity index 76% rename from components/brave_rewards/core/legacy/publisher_settings_properties.h rename to components/brave_rewards/core/internal/legacy/publisher_settings_properties.h index d523d4c254f1..427a57335c70 100644 --- a/components/brave_rewards/core/legacy/publisher_settings_properties.h +++ b/components/brave_rewards/core/internal/legacy/publisher_settings_properties.h @@ -3,15 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_PUBLISHER_SETTINGS_PROPERTIES_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_PUBLISHER_SETTINGS_PROPERTIES_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_PUBLISHER_SETTINGS_PROPERTIES_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_PUBLISHER_SETTINGS_PROPERTIES_H_ #include + #include #include #include -#include "brave/components/brave_rewards/core/legacy/report_balance_properties.h" +#include "brave/components/brave_rewards/core/internal/legacy/report_balance_properties.h" namespace brave_rewards::internal { @@ -40,4 +41,4 @@ struct PublisherSettingsProperties { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_PUBLISHER_SETTINGS_PROPERTIES_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_PUBLISHER_SETTINGS_PROPERTIES_H_ diff --git a/components/brave_rewards/core/legacy/publisher_settings_state_unittest.cc b/components/brave_rewards/core/internal/legacy/publisher_settings_state_unittest.cc similarity index 94% rename from components/brave_rewards/core/legacy/publisher_settings_state_unittest.cc rename to components/brave_rewards/core/internal/legacy/publisher_settings_state_unittest.cc index 0f7d5cbeb968..cc6b9b14b91e 100644 --- a/components/brave_rewards/core/legacy/publisher_settings_state_unittest.cc +++ b/components/brave_rewards/core/internal/legacy/publisher_settings_state_unittest.cc @@ -5,8 +5,8 @@ #include -#include "brave/components/brave_rewards/core/legacy/publisher_settings_properties.h" -#include "brave/components/brave_rewards/core/legacy/report_balance_properties.h" +#include "brave/components/brave_rewards/core/internal/legacy/publisher_settings_properties.h" +#include "brave/components/brave_rewards/core/internal/legacy/report_balance_properties.h" #include "testing/gtest/include/gtest/gtest.h" // npm run test -- brave_unit_tests --filter=PublisherSettingsStateTest.* diff --git a/components/brave_rewards/core/legacy/publisher_state.cc b/components/brave_rewards/core/internal/legacy/publisher_state.cc similarity index 90% rename from components/brave_rewards/core/legacy/publisher_state.cc rename to components/brave_rewards/core/internal/legacy/publisher_state.cc index 0dd6d806451e..9ea4f8dd48b6 100644 --- a/components/brave_rewards/core/legacy/publisher_state.cc +++ b/components/brave_rewards/core/internal/legacy/publisher_state.cc @@ -3,11 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/legacy/publisher_state.h" + #include -#include "brave/components/brave_rewards/core/legacy/publisher_settings_properties.h" -#include "brave/components/brave_rewards/core/legacy/publisher_state.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/legacy/publisher_settings_properties.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::publisher { diff --git a/components/brave_rewards/core/legacy/publisher_state.h b/components/brave_rewards/core/internal/legacy/publisher_state.h similarity index 74% rename from components/brave_rewards/core/legacy/publisher_state.h rename to components/brave_rewards/core/internal/legacy/publisher_state.h index 82a2e37b5ef1..95c9a3be1653 100644 --- a/components/brave_rewards/core/legacy/publisher_state.h +++ b/components/brave_rewards/core/internal/legacy/publisher_state.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_PUBLISHER_STATE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_PUBLISHER_STATE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_PUBLISHER_STATE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_PUBLISHER_STATE_H_ #include #include #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/legacy/publisher_settings_properties.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/legacy/publisher_settings_properties.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -51,4 +51,4 @@ class LegacyPublisherState { } // namespace publisher } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_PUBLISHER_STATE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_PUBLISHER_STATE_H_ diff --git a/components/brave_rewards/core/legacy/report_balance_properties.cc b/components/brave_rewards/core/internal/legacy/report_balance_properties.cc similarity index 96% rename from components/brave_rewards/core/legacy/report_balance_properties.cc rename to components/brave_rewards/core/internal/legacy/report_balance_properties.cc index 5cb151530b52..06ffef505e43 100644 --- a/components/brave_rewards/core/legacy/report_balance_properties.cc +++ b/components/brave_rewards/core/internal/legacy/report_balance_properties.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/legacy/report_balance_properties.h" +#include "brave/components/brave_rewards/core/internal/legacy/report_balance_properties.h" #include @@ -11,7 +11,7 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/logging.h" -#include "brave/components/brave_rewards/core/legacy/bat_util.h" +#include "brave/components/brave_rewards/core/internal/legacy/bat_util.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/legacy/report_balance_properties.h b/components/brave_rewards/core/internal/legacy/report_balance_properties.h similarity index 78% rename from components/brave_rewards/core/legacy/report_balance_properties.h rename to components/brave_rewards/core/internal/legacy/report_balance_properties.h index 5ca5386df709..da39210ee94d 100644 --- a/components/brave_rewards/core/legacy/report_balance_properties.h +++ b/components/brave_rewards/core/internal/legacy/report_balance_properties.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_REPORT_BALANCE_PROPERTIES_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_REPORT_BALANCE_PROPERTIES_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_REPORT_BALANCE_PROPERTIES_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_REPORT_BALANCE_PROPERTIES_H_ #include @@ -36,4 +36,4 @@ struct ReportBalanceProperties { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_REPORT_BALANCE_PROPERTIES_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_REPORT_BALANCE_PROPERTIES_H_ diff --git a/components/brave_rewards/core/legacy/report_balance_state_unittest.cc b/components/brave_rewards/core/internal/legacy/report_balance_state_unittest.cc similarity index 94% rename from components/brave_rewards/core/legacy/report_balance_state_unittest.cc rename to components/brave_rewards/core/internal/legacy/report_balance_state_unittest.cc index 0f3768e9b7b5..61628f3eaef8 100644 --- a/components/brave_rewards/core/legacy/report_balance_state_unittest.cc +++ b/components/brave_rewards/core/internal/legacy/report_balance_state_unittest.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/legacy/report_balance_properties.h" +#include "brave/components/brave_rewards/core/internal/legacy/report_balance_properties.h" #include "testing/gtest/include/gtest/gtest.h" // npm run test -- brave_unit_tests --filter=ReportBalanceStateTest.* diff --git a/components/brave_rewards/core/legacy/state_writer.h b/components/brave_rewards/core/internal/legacy/state_writer.h similarity index 71% rename from components/brave_rewards/core/legacy/state_writer.h rename to components/brave_rewards/core/internal/legacy/state_writer.h index 5357aaba4d4f..4046f2b792d2 100644 --- a/components/brave_rewards/core/legacy/state_writer.h +++ b/components/brave_rewards/core/internal/legacy/state_writer.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_STATE_WRITER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_STATE_WRITER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_STATE_WRITER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_STATE_WRITER_H_ #include @@ -22,4 +22,4 @@ class Writer { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_STATE_WRITER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_STATE_WRITER_H_ diff --git a/components/brave_rewards/core/legacy/static_values.h b/components/brave_rewards/core/internal/legacy/static_values.h similarity index 65% rename from components/brave_rewards/core/legacy/static_values.h rename to components/brave_rewards/core/internal/legacy/static_values.h index 46a303791974..9cb85ade58f6 100644 --- a/components/brave_rewards/core/legacy/static_values.h +++ b/components/brave_rewards/core/internal/legacy/static_values.h @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_STATIC_VALUES_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_STATIC_VALUES_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_STATIC_VALUES_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_STATIC_VALUES_H_ #define YOUTUBE_MEDIA_TYPE "youtube" #define YOUTUBE_PROVIDER_URL "https://www.youtube.com/oembed" #define YOUTUBE_DOMAIN "youtube.com" #define MEDIA_DELIMITER "_" -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_STATIC_VALUES_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_STATIC_VALUES_H_ diff --git a/components/brave_rewards/core/legacy/wallet_info_properties.cc b/components/brave_rewards/core/internal/legacy/wallet_info_properties.cc similarity index 97% rename from components/brave_rewards/core/legacy/wallet_info_properties.cc rename to components/brave_rewards/core/internal/legacy/wallet_info_properties.cc index 574afe52e1ab..cde5b5e9d5f5 100644 --- a/components/brave_rewards/core/legacy/wallet_info_properties.cc +++ b/components/brave_rewards/core/internal/legacy/wallet_info_properties.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/legacy/wallet_info_properties.h" +#include "brave/components/brave_rewards/core/internal/legacy/wallet_info_properties.h" #include "base/base64.h" #include "base/check.h" diff --git a/components/brave_rewards/core/legacy/wallet_info_properties.h b/components/brave_rewards/core/internal/legacy/wallet_info_properties.h similarity index 79% rename from components/brave_rewards/core/legacy/wallet_info_properties.h rename to components/brave_rewards/core/internal/legacy/wallet_info_properties.h index 7db2a55294d7..925a3bad9823 100644 --- a/components/brave_rewards/core/legacy/wallet_info_properties.h +++ b/components/brave_rewards/core/internal/legacy/wallet_info_properties.h @@ -3,10 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_WALLET_INFO_PROPERTIES_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_WALLET_INFO_PROPERTIES_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_WALLET_INFO_PROPERTIES_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_WALLET_INFO_PROPERTIES_H_ #include + #include #include @@ -37,4 +38,4 @@ struct WalletInfoProperties { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LEGACY_WALLET_INFO_PROPERTIES_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LEGACY_WALLET_INFO_PROPERTIES_H_ diff --git a/components/brave_rewards/core/legacy/wallet_info_state_unittest.cc b/components/brave_rewards/core/internal/legacy/wallet_info_state_unittest.cc similarity index 96% rename from components/brave_rewards/core/legacy/wallet_info_state_unittest.cc rename to components/brave_rewards/core/internal/legacy/wallet_info_state_unittest.cc index 503d4392d148..eec2fd104f3f 100644 --- a/components/brave_rewards/core/legacy/wallet_info_state_unittest.cc +++ b/components/brave_rewards/core/internal/legacy/wallet_info_state_unittest.cc @@ -4,7 +4,7 @@ * You can obtain one at https://mozilla.org/MPL/2.0/. */ #include "base/base64.h" -#include "brave/components/brave_rewards/core/legacy/wallet_info_properties.h" +#include "brave/components/brave_rewards/core/internal/legacy/wallet_info_properties.h" #include "testing/gtest/include/gtest/gtest.h" // npm run test -- brave_unit_tests --filter=WalletInfoStateTest.* diff --git a/components/brave_rewards/core/logging/event_log_keys.h b/components/brave_rewards/core/internal/logging/event_log_keys.h similarity index 87% rename from components/brave_rewards/core/logging/event_log_keys.h rename to components/brave_rewards/core/internal/logging/event_log_keys.h index b48a2b095266..342337fa5c46 100644 --- a/components/brave_rewards/core/logging/event_log_keys.h +++ b/components/brave_rewards/core/internal/logging/event_log_keys.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LOGGING_EVENT_LOG_KEYS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LOGGING_EVENT_LOG_KEYS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LOGGING_EVENT_LOG_KEYS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LOGGING_EVENT_LOG_KEYS_H_ namespace brave_rewards::internal { namespace log { @@ -35,4 +35,4 @@ inline constexpr char kWalletVerified[] = "wallet_verified"; } // namespace log } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LOGGING_EVENT_LOG_KEYS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LOGGING_EVENT_LOG_KEYS_H_ diff --git a/components/brave_rewards/core/logging/event_log_util.cc b/components/brave_rewards/core/internal/logging/event_log_util.cc similarity index 90% rename from components/brave_rewards/core/logging/event_log_util.cc rename to components/brave_rewards/core/internal/logging/event_log_util.cc index 434252dd06b8..d7d15692117b 100644 --- a/components/brave_rewards/core/logging/event_log_util.cc +++ b/components/brave_rewards/core/internal/logging/event_log_util.cc @@ -3,8 +3,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/logging/event_log_util.h" -#include "brave/components/brave_rewards/core/logging/event_log_keys.h" +#include "brave/components/brave_rewards/core/internal/logging/event_log_util.h" + +#include "brave/components/brave_rewards/core/internal/logging/event_log_keys.h" namespace brave_rewards::internal::log { std::string GetEventLogKeyForLinkingResult( diff --git a/components/brave_rewards/core/logging/event_log_util.h b/components/brave_rewards/core/internal/logging/event_log_util.h similarity index 60% rename from components/brave_rewards/core/logging/event_log_util.h rename to components/brave_rewards/core/internal/logging/event_log_util.h index 819ec4c6e454..c6fdf0e74d74 100644 --- a/components/brave_rewards/core/logging/event_log_util.h +++ b/components/brave_rewards/core/internal/logging/event_log_util.h @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LOGGING_EVENT_LOG_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LOGGING_EVENT_LOG_UTIL_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LOGGING_EVENT_LOG_UTIL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LOGGING_EVENT_LOG_UTIL_H_ #include -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal { namespace log { @@ -16,4 +16,4 @@ std::string GetEventLogKeyForLinkingResult(mojom::ConnectExternalWalletResult); } // namespace log } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_LOGGING_EVENT_LOG_UTIL_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_LOGGING_EVENT_LOG_UTIL_H_ diff --git a/components/brave_rewards/core/notifications/notification_keys.h b/components/brave_rewards/core/internal/notifications/notification_keys.h similarity index 72% rename from components/brave_rewards/core/notifications/notification_keys.h rename to components/brave_rewards/core/internal/notifications/notification_keys.h index fedd5ea3c990..e975c9286a77 100644 --- a/components/brave_rewards/core/notifications/notification_keys.h +++ b/components/brave_rewards/core/internal/notifications/notification_keys.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_NOTIFICATIONS_NOTIFICATION_KEYS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_NOTIFICATIONS_NOTIFICATION_KEYS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_NOTIFICATIONS_NOTIFICATION_KEYS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_NOTIFICATIONS_NOTIFICATION_KEYS_H_ namespace brave_rewards::internal { namespace notifications { @@ -18,4 +18,4 @@ inline constexpr char kSelfCustodyAvailable[] = "self_custody_available"; } // namespace notifications } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_NOTIFICATIONS_NOTIFICATION_KEYS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_NOTIFICATIONS_NOTIFICATION_KEYS_H_ diff --git a/components/brave_rewards/core/parameters/rewards_parameters_provider.cc b/components/brave_rewards/core/internal/parameters/rewards_parameters_provider.cc similarity index 94% rename from components/brave_rewards/core/parameters/rewards_parameters_provider.cc rename to components/brave_rewards/core/internal/parameters/rewards_parameters_provider.cc index 3860f37042ff..f2e0b170b083 100644 --- a/components/brave_rewards/core/parameters/rewards_parameters_provider.cc +++ b/components/brave_rewards/core/internal/parameters/rewards_parameters_provider.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/parameters/rewards_parameters_provider.h" +#include "brave/components/brave_rewards/core/internal/parameters/rewards_parameters_provider.h" #include #include "base/json/values_util.h" -#include "brave/components/brave_rewards/core/common/callback_helpers.h" -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/common/callback_helpers.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/parameters/rewards_parameters_provider.h b/components/brave_rewards/core/internal/parameters/rewards_parameters_provider.h similarity index 82% rename from components/brave_rewards/core/parameters/rewards_parameters_provider.h rename to components/brave_rewards/core/internal/parameters/rewards_parameters_provider.h index 44d1f95940f0..edfd62377672 100644 --- a/components/brave_rewards/core/parameters/rewards_parameters_provider.h +++ b/components/brave_rewards/core/internal/parameters/rewards_parameters_provider.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PARAMETERS_REWARDS_PARAMETERS_PROVIDER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PARAMETERS_REWARDS_PARAMETERS_PROVIDER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PARAMETERS_REWARDS_PARAMETERS_PROVIDER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PARAMETERS_REWARDS_PARAMETERS_PROVIDER_H_ #include #include @@ -13,8 +13,8 @@ #include "base/time/time.h" #include "base/timer/timer.h" #include "base/values.h" -#include "brave/components/brave_rewards/core/endpoints/brave/get_parameters.h" -#include "brave/components/brave_rewards/core/rewards_engine_helper.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/get_parameters.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine_helper.h" namespace brave_rewards::internal { @@ -64,4 +64,4 @@ class RewardsParametersProvider } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PARAMETERS_REWARDS_PARAMETERS_PROVIDER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PARAMETERS_REWARDS_PARAMETERS_PROVIDER_H_ diff --git a/components/brave_rewards/core/parameters/rewards_parameters_provider_unittest.cc b/components/brave_rewards/core/internal/parameters/rewards_parameters_provider_unittest.cc similarity index 94% rename from components/brave_rewards/core/parameters/rewards_parameters_provider_unittest.cc rename to components/brave_rewards/core/internal/parameters/rewards_parameters_provider_unittest.cc index 88d8d2401399..2916fd60ae15 100644 --- a/components/brave_rewards/core/parameters/rewards_parameters_provider_unittest.cc +++ b/components/brave_rewards/core/internal/parameters/rewards_parameters_provider_unittest.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/parameters/rewards_parameters_provider.h" +#include "brave/components/brave_rewards/core/internal/parameters/rewards_parameters_provider.h" #include #include @@ -11,9 +11,9 @@ #include #include "base/json/json_reader.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/publisher/media/helper.cc b/components/brave_rewards/core/internal/publisher/media/helper.cc similarity index 94% rename from components/brave_rewards/core/publisher/media/helper.cc rename to components/brave_rewards/core/internal/publisher/media/helper.cc index 7dc8e0780cb8..5ef1225deda5 100644 --- a/components/brave_rewards/core/publisher/media/helper.cc +++ b/components/brave_rewards/core/internal/publisher/media/helper.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/publisher/media/helper.h" +#include "brave/components/brave_rewards/core/internal/publisher/media/helper.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/publisher/media/helper.h b/components/brave_rewards/core/internal/publisher/media/helper.h similarity index 71% rename from components/brave_rewards/core/publisher/media/helper.h rename to components/brave_rewards/core/internal/publisher/media/helper.h index cf0bad48ea45..156cc463b7f9 100644 --- a/components/brave_rewards/core/publisher/media/helper.h +++ b/components/brave_rewards/core/internal/publisher/media/helper.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_MEDIA_HELPER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_MEDIA_HELPER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_MEDIA_HELPER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_MEDIA_HELPER_H_ #include @@ -18,4 +18,4 @@ std::string ExtractData(const std::string& data, } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_MEDIA_HELPER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_MEDIA_HELPER_H_ diff --git a/components/brave_rewards/core/publisher/media/helper_unittest.cc b/components/brave_rewards/core/internal/publisher/media/helper_unittest.cc similarity index 89% rename from components/brave_rewards/core/publisher/media/helper_unittest.cc rename to components/brave_rewards/core/internal/publisher/media/helper_unittest.cc index 1948abecdc24..51fadfd6ade6 100644 --- a/components/brave_rewards/core/publisher/media/helper_unittest.cc +++ b/components/brave_rewards/core/internal/publisher/media/helper_unittest.cc @@ -3,10 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/publisher/media/helper.h" + #include -#include "brave/components/brave_rewards/core/publisher/media/helper.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" #include "testing/gtest/include/gtest/gtest.h" // npm run test -- brave_unit_tests --filter=RewardsMediaHelperTest.* diff --git a/components/brave_rewards/core/publisher/media/media.cc b/components/brave_rewards/core/internal/publisher/media/media.cc similarity index 87% rename from components/brave_rewards/core/publisher/media/media.cc rename to components/brave_rewards/core/internal/publisher/media/media.cc index c343f3cbf368..203c34b745ac 100644 --- a/components/brave_rewards/core/publisher/media/media.cc +++ b/components/brave_rewards/core/internal/publisher/media/media.cc @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/publisher/media/media.h" +#include "brave/components/brave_rewards/core/internal/publisher/media/media.h" #include #include "base/containers/flat_map.h" #include "base/feature_list.h" -#include "brave/components/brave_rewards/common/features.h" -#include "brave/components/brave_rewards/core/legacy/static_values.h" -#include "brave/components/brave_rewards/core/publisher/publisher.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/features.h" +#include "brave/components/brave_rewards/core/internal/legacy/static_values.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include "build/build_config.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/publisher/media/media.h b/components/brave_rewards/core/internal/publisher/media/media.h similarity index 81% rename from components/brave_rewards/core/publisher/media/media.h rename to components/brave_rewards/core/internal/publisher/media/media.h index 9e86102719be..0183cc16e78f 100644 --- a/components/brave_rewards/core/publisher/media/media.h +++ b/components/brave_rewards/core/internal/publisher/media/media.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_MEDIA_MEDIA_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_MEDIA_MEDIA_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_MEDIA_MEDIA_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_MEDIA_MEDIA_H_ #include #include "base/containers/flat_map.h" #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/publisher/media/youtube.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/publisher/media/youtube.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { @@ -55,4 +55,4 @@ class Media { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_MEDIA_MEDIA_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_MEDIA_MEDIA_H_ diff --git a/components/brave_rewards/core/publisher/media/youtube.cc b/components/brave_rewards/core/internal/publisher/media/youtube.cc similarity index 97% rename from components/brave_rewards/core/publisher/media/youtube.cc rename to components/brave_rewards/core/internal/publisher/media/youtube.cc index 082886836d4b..3d63fae81e69 100644 --- a/components/brave_rewards/core/publisher/media/youtube.cc +++ b/components/brave_rewards/core/internal/publisher/media/youtube.cc @@ -3,6 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/publisher/media/youtube.h" + #include #include #include @@ -11,14 +13,13 @@ #include "base/strings/escape.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/publisher/media/helper.h" -#include "brave/components/brave_rewards/core/publisher/media/youtube.h" -#include "brave/components/brave_rewards/core/legacy/static_values.h" -#include "brave/components/brave_rewards/core/publisher/publisher.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/legacy/static_values.h" +#include "brave/components/brave_rewards/core/internal/publisher/media/helper.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/publisher/media/youtube.h b/components/brave_rewards/core/internal/publisher/media/youtube.h similarity index 94% rename from components/brave_rewards/core/publisher/media/youtube.h rename to components/brave_rewards/core/internal/publisher/media/youtube.h index c21990ec9727..5a8142ff18b4 100644 --- a/components/brave_rewards/core/publisher/media/youtube.h +++ b/components/brave_rewards/core/internal/publisher/media/youtube.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_MEDIA_YOUTUBE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_MEDIA_YOUTUBE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_MEDIA_YOUTUBE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_MEDIA_YOUTUBE_H_ #include #include @@ -13,8 +13,8 @@ #include "base/gtest_prod_util.h" #include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/publisher/media/helper.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/publisher/media/helper.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { @@ -171,4 +171,4 @@ class YouTube { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_MEDIA_YOUTUBE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_MEDIA_YOUTUBE_H_ diff --git a/components/brave_rewards/core/publisher/media/youtube_unittest.cc b/components/brave_rewards/core/internal/publisher/media/youtube_unittest.cc similarity index 97% rename from components/brave_rewards/core/publisher/media/youtube_unittest.cc rename to components/brave_rewards/core/internal/publisher/media/youtube_unittest.cc index 2cb92d65ec8c..a336c09ad1b0 100644 --- a/components/brave_rewards/core/publisher/media/youtube_unittest.cc +++ b/components/brave_rewards/core/internal/publisher/media/youtube_unittest.cc @@ -3,13 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/publisher/media/youtube.h" + #include #include "base/containers/flat_map.h" -#include "brave/components/brave_rewards/core/constants.h" -#include "brave/components/brave_rewards/core/publisher/media/youtube.h" -#include "brave/components/brave_rewards/core/legacy/static_values.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/constants.h" +#include "brave/components/brave_rewards/core/internal/legacy/static_values.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" #include "testing/gtest/include/gtest/gtest.h" // npm run test -- brave_unit_tests --filter=RewardsMediaYouTubeTest.* @@ -434,8 +435,8 @@ TEST(RewardsMediaYouTubeTest, GetVideoUrl) { // Death tests misbehave on Android. #if !BUILDFLAG(IS_ANDROID) GTEST_FLAG_SET(death_test_style, "threadsafe"); - EXPECT_DEATH({ YouTube::GetVideoUrl(media_id); }, - "Check failed: !media_id.empty*"); + EXPECT_DEATH( + { YouTube::GetVideoUrl(media_id); }, "Check failed: !media_id.empty*"); #endif // !BUILDFLAG(IS_ANDROID) #endif @@ -470,8 +471,9 @@ TEST(RewardsMediaYouTubeTest, GetChannelUrl) { // Death tests misbehave on Android. #if !BUILDFLAG(IS_ANDROID) GTEST_FLAG_SET(death_test_style, "threadsafe"); - EXPECT_DEATH({ YouTube::GetChannelUrl(channel_id); }, - "Check failed: !publisher_key.empty*"); + EXPECT_DEATH( + { YouTube::GetChannelUrl(channel_id); }, + "Check failed: !publisher_key.empty*"); #endif // !BUILDFLAG(IS_ANDROID) #endif diff --git a/components/brave_rewards/core/publisher/prefix_iterator.h b/components/brave_rewards/core/internal/publisher/prefix_iterator.h similarity index 92% rename from components/brave_rewards/core/publisher/prefix_iterator.h rename to components/brave_rewards/core/internal/publisher/prefix_iterator.h index 89721675f77e..d5bf25debdd8 100644 --- a/components/brave_rewards/core/publisher/prefix_iterator.h +++ b/components/brave_rewards/core/internal/publisher/prefix_iterator.h @@ -9,8 +9,8 @@ #pragma allow_unsafe_buffers #endif -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PREFIX_ITERATOR_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PREFIX_ITERATOR_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PREFIX_ITERATOR_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PREFIX_ITERATOR_H_ #include #include @@ -120,4 +120,4 @@ class PrefixIterator { } // namespace publisher } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PREFIX_ITERATOR_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PREFIX_ITERATOR_H_ diff --git a/components/brave_rewards/core/publisher/prefix_list_reader.cc b/components/brave_rewards/core/internal/publisher/prefix_list_reader.cc similarity index 88% rename from components/brave_rewards/core/publisher/prefix_list_reader.cc rename to components/brave_rewards/core/internal/publisher/prefix_list_reader.cc index 8d2986375bc2..514f960aaf42 100644 --- a/components/brave_rewards/core/publisher/prefix_list_reader.cc +++ b/components/brave_rewards/core/internal/publisher/prefix_list_reader.cc @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/publisher/prefix_list_reader.h" +#include "brave/components/brave_rewards/core/internal/publisher/prefix_list_reader.h" #include -#include "brave/components/brave_rewards/core/common/brotli_util.h" -#include "brave/components/brave_rewards/core/publisher/prefix_util.h" -#include "brave/components/brave_rewards/core/publisher/protos/publisher_prefix_list.pb.h" +#include "brave/components/brave_rewards/core/internal/common/brotli_util.h" +#include "brave/components/brave_rewards/core/internal/publisher/prefix_util.h" +#include "brave/components/brave_rewards/core/internal/publisher/protos/publisher_prefix_list.pb.h" namespace brave_rewards::internal::publisher { diff --git a/components/brave_rewards/core/publisher/prefix_list_reader.h b/components/brave_rewards/core/internal/publisher/prefix_list_reader.h similarity index 83% rename from components/brave_rewards/core/publisher/prefix_list_reader.h rename to components/brave_rewards/core/internal/publisher/prefix_list_reader.h index 8c6bfd62b544..96544ab3460f 100644 --- a/components/brave_rewards/core/publisher/prefix_list_reader.h +++ b/components/brave_rewards/core/internal/publisher/prefix_list_reader.h @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PREFIX_LIST_READER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PREFIX_LIST_READER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PREFIX_LIST_READER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PREFIX_LIST_READER_H_ #include -#include "brave/components/brave_rewards/core/publisher/prefix_iterator.h" +#include "brave/components/brave_rewards/core/internal/publisher/prefix_iterator.h" namespace brave_rewards::internal { namespace publisher { @@ -65,4 +65,4 @@ class PrefixListReader { } // namespace publisher } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PREFIX_LIST_READER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PREFIX_LIST_READER_H_ diff --git a/components/brave_rewards/core/publisher/prefix_list_reader_unittest.cc b/components/brave_rewards/core/internal/publisher/prefix_list_reader_unittest.cc similarity index 96% rename from components/brave_rewards/core/publisher/prefix_list_reader_unittest.cc rename to components/brave_rewards/core/internal/publisher/prefix_list_reader_unittest.cc index 7503518d4c29..23403d380c22 100644 --- a/components/brave_rewards/core/publisher/prefix_list_reader_unittest.cc +++ b/components/brave_rewards/core/internal/publisher/prefix_list_reader_unittest.cc @@ -3,12 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/publisher/prefix_list_reader.h" + #include #include #include -#include "brave/components/brave_rewards/core/publisher/prefix_list_reader.h" -#include "brave/components/brave_rewards/core/publisher/protos/publisher_prefix_list.pb.h" +#include "brave/components/brave_rewards/core/internal/publisher/protos/publisher_prefix_list.pb.h" #include "testing/gtest/include/gtest/gtest.h" namespace brave_rewards::internal::publisher { diff --git a/components/brave_rewards/core/publisher/prefix_util.cc b/components/brave_rewards/core/internal/publisher/prefix_util.cc similarity index 92% rename from components/brave_rewards/core/publisher/prefix_util.cc rename to components/brave_rewards/core/internal/publisher/prefix_util.cc index d7f32e333015..54a5a143f3bf 100644 --- a/components/brave_rewards/core/publisher/prefix_util.cc +++ b/components/brave_rewards/core/internal/publisher/prefix_util.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/publisher/prefix_util.h" +#include "brave/components/brave_rewards/core/internal/publisher/prefix_util.h" #include "base/strings/string_number_conversions.h" #include "crypto/sha2.h" diff --git a/components/brave_rewards/core/publisher/prefix_util.h b/components/brave_rewards/core/internal/publisher/prefix_util.h similarity index 78% rename from components/brave_rewards/core/publisher/prefix_util.h rename to components/brave_rewards/core/internal/publisher/prefix_util.h index 458ee1e9a397..37235de1209e 100644 --- a/components/brave_rewards/core/publisher/prefix_util.h +++ b/components/brave_rewards/core/internal/publisher/prefix_util.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PREFIX_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PREFIX_UTIL_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PREFIX_UTIL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PREFIX_UTIL_H_ #include @@ -25,4 +25,4 @@ std::string GetHashPrefixInHex(const std::string& publisher_key, } // namespace publisher } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PREFIX_UTIL_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PREFIX_UTIL_H_ diff --git a/components/brave_rewards/core/publisher/protos/channel_response.proto b/components/brave_rewards/core/internal/publisher/protos/channel_response.proto similarity index 100% rename from components/brave_rewards/core/publisher/protos/channel_response.proto rename to components/brave_rewards/core/internal/publisher/protos/channel_response.proto diff --git a/components/brave_rewards/core/publisher/protos/publisher_prefix_list.proto b/components/brave_rewards/core/internal/publisher/protos/publisher_prefix_list.proto similarity index 100% rename from components/brave_rewards/core/publisher/protos/publisher_prefix_list.proto rename to components/brave_rewards/core/internal/publisher/protos/publisher_prefix_list.proto diff --git a/components/brave_rewards/core/publisher/publisher.cc b/components/brave_rewards/core/internal/publisher/publisher.cc similarity index 96% rename from components/brave_rewards/core/publisher/publisher.cc rename to components/brave_rewards/core/internal/publisher/publisher.cc index 968487213950..d2eac2d3c134 100644 --- a/components/brave_rewards/core/publisher/publisher.cc +++ b/components/brave_rewards/core/internal/publisher/publisher.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/publisher/publisher.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher.h" #include #include @@ -16,18 +16,18 @@ #include "base/feature_list.h" #include "base/strings/stringprintf.h" #include "base/uuid.h" -#include "brave/components/brave_rewards/common/features.h" -#include "brave/components/brave_rewards/core/constants.h" -#include "brave/components/brave_rewards/core/contribution/contribution.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/legacy/static_values.h" -#include "brave/components/brave_rewards/core/publisher/media/media.h" -#include "brave/components/brave_rewards/core/publisher/prefix_util.h" -#include "brave/components/brave_rewards/core/publisher/publisher_prefix_list_updater.h" -#include "brave/components/brave_rewards/core/publisher/server_publisher_fetcher.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state.h" +#include "brave/components/brave_rewards/core/features.h" +#include "brave/components/brave_rewards/core/internal/constants.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/legacy/static_values.h" +#include "brave/components/brave_rewards/core/internal/publisher/media/media.h" +#include "brave/components/brave_rewards/core/internal/publisher/prefix_util.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher_prefix_list_updater.h" +#include "brave/components/brave_rewards/core/internal/publisher/server_publisher_fetcher.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/publisher/publisher.h b/components/brave_rewards/core/internal/publisher/publisher.h similarity index 93% rename from components/brave_rewards/core/publisher/publisher.h rename to components/brave_rewards/core/internal/publisher/publisher.h index 0eb8954dc195..c962eb41f3f8 100644 --- a/components/brave_rewards/core/publisher/publisher.h +++ b/components/brave_rewards/core/internal/publisher/publisher.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PUBLISHER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PUBLISHER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PUBLISHER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PUBLISHER_H_ #include #include @@ -13,10 +13,10 @@ #include "base/gtest_prod_util.h" #include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/database/database_server_publisher_info.h" -#include "brave/components/brave_rewards/core/publisher/publisher_prefix_list_updater.h" -#include "brave/components/brave_rewards/core/publisher/server_publisher_fetcher.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/database/database_server_publisher_info.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher_prefix_list_updater.h" +#include "brave/components/brave_rewards/core/internal/publisher/server_publisher_fetcher.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -210,4 +210,4 @@ class Publisher { } // namespace publisher } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PUBLISHER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PUBLISHER_H_ diff --git a/components/brave_rewards/core/publisher/publisher_prefix_list_updater.cc b/components/brave_rewards/core/internal/publisher/publisher_prefix_list_updater.cc similarity index 90% rename from components/brave_rewards/core/publisher/publisher_prefix_list_updater.cc rename to components/brave_rewards/core/internal/publisher/publisher_prefix_list_updater.cc index 33258120656f..0273e22306ee 100644 --- a/components/brave_rewards/core/publisher/publisher_prefix_list_updater.cc +++ b/components/brave_rewards/core/internal/publisher/publisher_prefix_list_updater.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/publisher/publisher_prefix_list_updater.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher_prefix_list_updater.h" #include -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/publisher/prefix_list_reader.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/publisher/prefix_list_reader.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" #include "net/http/http_status_code.h" namespace { diff --git a/components/brave_rewards/core/publisher/publisher_prefix_list_updater.h b/components/brave_rewards/core/internal/publisher/publisher_prefix_list_updater.h similarity index 82% rename from components/brave_rewards/core/publisher/publisher_prefix_list_updater.h rename to components/brave_rewards/core/internal/publisher/publisher_prefix_list_updater.h index 111a00336b93..eab749175165 100644 --- a/components/brave_rewards/core/publisher/publisher_prefix_list_updater.h +++ b/components/brave_rewards/core/internal/publisher/publisher_prefix_list_updater.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PUBLISHER_PREFIX_LIST_UPDATER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PUBLISHER_PREFIX_LIST_UPDATER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PUBLISHER_PREFIX_LIST_UPDATER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PUBLISHER_PREFIX_LIST_UPDATER_H_ #include #include @@ -14,8 +14,8 @@ #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "base/timer/timer.h" -#include "brave/components/brave_rewards/core/endpoint/rewards/rewards_server.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/endpoint/rewards/rewards_server.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -72,4 +72,4 @@ class PublisherPrefixListUpdater { } // namespace publisher } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PUBLISHER_PREFIX_LIST_UPDATER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PUBLISHER_PREFIX_LIST_UPDATER_H_ diff --git a/components/brave_rewards/core/publisher/publisher_status_helper.cc b/components/brave_rewards/core/internal/publisher/publisher_status_helper.cc similarity index 93% rename from components/brave_rewards/core/publisher/publisher_status_helper.cc rename to components/brave_rewards/core/internal/publisher/publisher_status_helper.cc index af60abba4631..1fac69c3dea0 100644 --- a/components/brave_rewards/core/publisher/publisher_status_helper.cc +++ b/components/brave_rewards/core/internal/publisher/publisher_status_helper.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/publisher/publisher_status_helper.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher_status_helper.h" #include #include @@ -13,9 +13,9 @@ #include "base/memory/raw_ref.h" #include "base/time/time.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/publisher/publisher.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/publisher/publisher_status_helper.h b/components/brave_rewards/core/internal/publisher/publisher_status_helper.h similarity index 70% rename from components/brave_rewards/core/publisher/publisher_status_helper.h rename to components/brave_rewards/core/internal/publisher/publisher_status_helper.h index 8301587db9c7..3f09ae2a8267 100644 --- a/components/brave_rewards/core/publisher/publisher_status_helper.h +++ b/components/brave_rewards/core/internal/publisher/publisher_status_helper.h @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PUBLISHER_STATUS_HELPER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PUBLISHER_STATUS_HELPER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PUBLISHER_STATUS_HELPER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PUBLISHER_STATUS_HELPER_H_ #include -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -26,4 +26,4 @@ void RefreshPublisherStatus(RewardsEngine& engine, } // namespace publisher } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_PUBLISHER_STATUS_HELPER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_PUBLISHER_STATUS_HELPER_H_ diff --git a/components/brave_rewards/core/publisher/publisher_unittest.cc b/components/brave_rewards/core/internal/publisher/publisher_unittest.cc similarity index 92% rename from components/brave_rewards/core/publisher/publisher_unittest.cc rename to components/brave_rewards/core/internal/publisher/publisher_unittest.cc index bac5ad39f8b1..eef9934f8622 100644 --- a/components/brave_rewards/core/publisher/publisher_unittest.cc +++ b/components/brave_rewards/core/internal/publisher/publisher_unittest.cc @@ -3,15 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/publisher/publisher.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher.h" #include #include #include "base/containers/flat_map.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "base/strings/string_number_conversions.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal::publisher { @@ -21,7 +22,7 @@ class RewardsPublisherTest : public RewardsEngineTest { double prev_score; for (int ix = 0; ix < 50; ix++) { mojom::PublisherInfoPtr info = mojom::PublisherInfo::New(); - info->id = "example" + std::to_string(ix) + ".com"; + info->id = "example" + base::NumberToString(ix) + ".com"; info->duration = 50; if (ix == 0) { info->score = 24; diff --git a/components/brave_rewards/core/publisher/server_publisher_fetcher.cc b/components/brave_rewards/core/internal/publisher/server_publisher_fetcher.cc similarity index 89% rename from components/brave_rewards/core/publisher/server_publisher_fetcher.cc rename to components/brave_rewards/core/internal/publisher/server_publisher_fetcher.cc index 2de054f9b706..e2625defd414 100644 --- a/components/brave_rewards/core/publisher/server_publisher_fetcher.cc +++ b/components/brave_rewards/core/internal/publisher/server_publisher_fetcher.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/publisher/server_publisher_fetcher.h" +#include "brave/components/brave_rewards/core/internal/publisher/server_publisher_fetcher.h" #include #include @@ -12,11 +12,11 @@ #include "base/json/json_reader.h" #include "base/strings/stringprintf.h" #include "base/time/time.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/publisher/prefix_util.h" -#include "brave/components/brave_rewards/core/publisher/protos/channel_response.pb.h" -#include "brave/components/brave_rewards/core/publisher/publisher_prefix_list_updater.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/publisher/prefix_util.h" +#include "brave/components/brave_rewards/core/internal/publisher/protos/channel_response.pb.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher_prefix_list_updater.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::publisher { diff --git a/components/brave_rewards/core/publisher/server_publisher_fetcher.h b/components/brave_rewards/core/internal/publisher/server_publisher_fetcher.h similarity index 80% rename from components/brave_rewards/core/publisher/server_publisher_fetcher.h rename to components/brave_rewards/core/internal/publisher/server_publisher_fetcher.h index 5a29ba0b4d97..3601be1dcebf 100644 --- a/components/brave_rewards/core/publisher/server_publisher_fetcher.h +++ b/components/brave_rewards/core/internal/publisher/server_publisher_fetcher.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_SERVER_PUBLISHER_FETCHER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_SERVER_PUBLISHER_FETCHER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_SERVER_PUBLISHER_FETCHER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_SERVER_PUBLISHER_FETCHER_H_ #include #include @@ -12,9 +12,9 @@ #include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/database/database_server_publisher_info.h" -#include "brave/components/brave_rewards/core/endpoint/private_cdn/private_cdn_server.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/database/database_server_publisher_info.h" +#include "brave/components/brave_rewards/core/internal/endpoint/private_cdn/private_cdn_server.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -69,4 +69,4 @@ class ServerPublisherFetcher { } // namespace publisher } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_SERVER_PUBLISHER_FETCHER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_PUBLISHER_SERVER_PUBLISHER_FETCHER_H_ diff --git a/components/brave_rewards/core/rewards_callbacks.h b/components/brave_rewards/core/internal/rewards_callbacks.h similarity index 87% rename from components/brave_rewards/core/rewards_callbacks.h rename to components/brave_rewards/core/internal/rewards_callbacks.h index 4a94150843bc..a09ecbf030f5 100644 --- a/components/brave_rewards/core/rewards_callbacks.h +++ b/components/brave_rewards/core/internal/rewards_callbacks.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_CALLBACKS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_CALLBACKS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_CALLBACKS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_CALLBACKS_H_ #include #include @@ -13,9 +13,9 @@ #include "base/containers/flat_map.h" #include "base/functional/callback_forward.h" #include "base/types/expected.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_database.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_engine.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_database.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_engine.mojom.h" namespace brave_rewards::internal { @@ -95,4 +95,4 @@ using UnverifiedPublishersCallback = } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_CALLBACKS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_CALLBACKS_H_ diff --git a/components/brave_rewards/core/rewards_database.cc b/components/brave_rewards/core/internal/rewards_database.cc similarity index 99% rename from components/brave_rewards/core/rewards_database.cc rename to components/brave_rewards/core/internal/rewards_database.cc index e5505732ec40..97ccbf1625ec 100644 --- a/components/brave_rewards/core/rewards_database.cc +++ b/components/brave_rewards/core/internal/rewards_database.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/rewards_database.h" +#include "brave/components/brave_rewards/core/internal/rewards_database.h" #include #include diff --git a/components/brave_rewards/core/rewards_database.h b/components/brave_rewards/core/internal/rewards_database.h similarity index 86% rename from components/brave_rewards/core/rewards_database.h rename to components/brave_rewards/core/internal/rewards_database.h index 218541a293b5..81b5a1b393f1 100644 --- a/components/brave_rewards/core/rewards_database.h +++ b/components/brave_rewards/core/internal/rewards_database.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_DATABASE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_DATABASE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_DATABASE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_DATABASE_H_ #include #include "base/files/file_path.h" #include "base/memory/memory_pressure_listener.h" #include "base/sequence_checker.h" -#include "brave/components/brave_rewards/common/mojom/rewards_database.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_database.mojom.h" #include "sql/database.h" #include "sql/init_status.h" #include "sql/meta_table.h" @@ -68,4 +68,4 @@ class RewardsDatabase { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_DATABASE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_DATABASE_H_ diff --git a/components/brave_rewards/core/rewards_engine.cc b/components/brave_rewards/core/internal/rewards_engine.cc similarity index 82% rename from components/brave_rewards/core/rewards_engine.cc rename to components/brave_rewards/core/internal/rewards_engine.cc index 94a04c5607eb..b8dbd7396ae4 100644 --- a/components/brave_rewards/core/rewards_engine.cc +++ b/components/brave_rewards/core/internal/rewards_engine.cc @@ -3,34 +3,34 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" #include #include "base/strings/string_number_conversions.h" #include "base/task/thread_pool/thread_pool_instance.h" -#include "brave/components/brave_rewards/core/bitflyer/bitflyer.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/signer.h" -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/common/url_loader.h" -#include "brave/components/brave_rewards/core/contribution/contribution.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/endpoints/brave/get_ui_cards.h" -#include "brave/components/brave_rewards/core/gemini/gemini.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/initialization_manager.h" -#include "brave/components/brave_rewards/core/legacy/static_values.h" -#include "brave/components/brave_rewards/core/parameters/rewards_parameters_provider.h" -#include "brave/components/brave_rewards/core/publisher/media/media.h" -#include "brave/components/brave_rewards/core/publisher/publisher.h" -#include "brave/components/brave_rewards/core/state/state.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/uphold/uphold.h" -#include "brave/components/brave_rewards/core/wallet/wallet.h" -#include "brave/components/brave_rewards/core/wallet_provider/solana/solana_wallet_provider.h" -#include "brave/components/brave_rewards/core/wallet_provider/wallet_provider.h" -#include "brave/components/brave_rewards/core/zebpay/zebpay.h" +#include "brave/components/brave_rewards/core/internal/bitflyer/bitflyer.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/signer.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/common/url_loader.h" +#include "brave/components/brave_rewards/core/internal/contribution/contribution.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/get_ui_cards.h" +#include "brave/components/brave_rewards/core/internal/gemini/gemini.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/initialization_manager.h" +#include "brave/components/brave_rewards/core/internal/legacy/static_values.h" +#include "brave/components/brave_rewards/core/internal/parameters/rewards_parameters_provider.h" +#include "brave/components/brave_rewards/core/internal/publisher/media/media.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/solana/solana_wallet_provider.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/internal/zebpay/zebpay.h" namespace brave_rewards::internal { @@ -66,9 +66,8 @@ void RewardsEngine::GetEnvironment(GetEnvironmentCallback callback) { std::move(callback).Run(Get().current_environment()); } -void RewardsEngine::CreateRewardsWallet( - const std::string& country, - CreateRewardsWalletCallback callback) { +void RewardsEngine::CreateRewardsWallet(const std::string& country, + CreateRewardsWalletCallback callback) { WhenReady([this, country, callback = std::move(callback)]() mutable { wallet()->CreateWalletIfNecessary( country.empty() ? std::nullopt @@ -117,7 +116,7 @@ void RewardsEngine::GetReconcileStamp(GetReconcileStampCallback callback) { } void RewardsEngine::OnLoad(mojom::VisitDataPtr visit_data, - uint64_t current_time) { + uint64_t current_time) { if (!IsReady() || !visit_data || visit_data->domain.empty()) { return; } @@ -230,10 +229,9 @@ void RewardsEngine::OnXHRLoad( media()->ProcessMedia(parts, type, std::move(visit_data)); } -void RewardsEngine::SetPublisherExclude( - const std::string& publisher_key, - mojom::PublisherExclude exclude, - SetPublisherExcludeCallback callback) { +void RewardsEngine::SetPublisherExclude(const std::string& publisher_key, + mojom::PublisherExclude exclude, + SetPublisherExcludeCallback callback) { WhenReady( [this, publisher_key, exclude, callback = std::move(callback)]() mutable { publisher()->SetPublisherExclude(publisher_key, exclude, @@ -258,8 +256,8 @@ void RewardsEngine::SetPublisherMinVisits(int visits) { } void RewardsEngine::GetBalanceReport(mojom::ActivityMonth month, - int32_t year, - GetBalanceReportCallback callback) { + int32_t year, + GetBalanceReportCallback callback) { WhenReady([this, month, year, callback = std::move(callback)]() mutable { database()->GetBalanceReportInfo(month, year, std::move(callback)); }); @@ -276,26 +274,24 @@ void RewardsEngine::GetPublisherActivityFromUrl( }); } -void RewardsEngine::GetPublisherBanner( - const std::string& publisher_id, - GetPublisherBannerCallback callback) { +void RewardsEngine::GetPublisherBanner(const std::string& publisher_id, + GetPublisherBannerCallback callback) { WhenReady([this, publisher_id, callback = std::move(callback)]() mutable { publisher()->GetPublisherBanner(publisher_id, std::move(callback)); }); } void RewardsEngine::OneTimeTip(const std::string& publisher_key, - double amount, - OneTimeTipCallback callback) { + double amount, + OneTimeTipCallback callback) { WhenReady( [this, publisher_key, amount, callback = std::move(callback)]() mutable { contribution()->OneTimeTip(publisher_key, amount, std::move(callback)); }); } -void RewardsEngine::RemoveRecurringTip( - const std::string& publisher_key, - RemoveRecurringTipCallback callback) { +void RewardsEngine::RemoveRecurringTip(const std::string& publisher_key, + RemoveRecurringTipCallback callback) { WhenReady([this, publisher_key, callback = std::move(callback)]() mutable { database()->RemoveRecurringTip(publisher_key, std::move(callback)); }); @@ -337,7 +333,7 @@ void RewardsEngine::GetRewardsInternalsInfo( } void RewardsEngine::SaveRecurringTip(mojom::RecurringTipPtr info, - SaveRecurringTipCallback callback) { + SaveRecurringTipCallback callback) { WhenReady( [this, info = std::move(info), callback = std::move(callback)]() mutable { database()->SaveRecurringTip( @@ -348,15 +344,15 @@ void RewardsEngine::SaveRecurringTip(mojom::RecurringTipPtr info, } void RewardsEngine::OnRecurringTipSaved(SaveRecurringTipCallback callback, - mojom::Result result) { + mojom::Result result) { contribution()->SetMonthlyContributionTimer(); std::move(callback).Run(result); } void RewardsEngine::SendContribution(const std::string& publisher_id, - double amount, - bool set_monthly, - SendContributionCallback callback) { + double amount, + bool set_monthly, + SendContributionCallback callback) { WhenReady([this, publisher_id, amount, set_monthly, callback = std::move(callback)]() mutable { contribution()->SendContribution(publisher_id, amount, set_monthly, @@ -377,11 +373,10 @@ void RewardsEngine::GetOneTimeTips(GetOneTimeTipsCallback callback) { }); } -void RewardsEngine::GetActivityInfoList( - uint32_t start, - uint32_t limit, - mojom::ActivityInfoFilterPtr filter, - GetActivityInfoListCallback callback) { +void RewardsEngine::GetActivityInfoList(uint32_t start, + uint32_t limit, + mojom::ActivityInfoFilterPtr filter, + GetActivityInfoListCallback callback) { WhenReady([this, start, limit, filter = std::move(filter), callback = std::move(callback)]() mutable { database()->GetActivityInfoList(start, limit, std::move(filter), @@ -403,7 +398,7 @@ void RewardsEngine::GetExcludedList(GetExcludedListCallback callback) { } void RewardsEngine::RefreshPublisher(const std::string& publisher_key, - RefreshPublisherCallback callback) { + RefreshPublisherCallback callback) { WhenReady([this, publisher_key, callback = std::move(callback)]() mutable { publisher()->RefreshPublisher(publisher_key, std::move(callback)); }); @@ -432,7 +427,7 @@ void RewardsEngine::IsPublisherRegistered( } void RewardsEngine::GetPublisherInfo(const std::string& publisher_key, - GetPublisherInfoCallback callback) { + GetPublisherInfoCallback callback) { WhenReady([this, publisher_key, callback = std::move(callback)]() mutable { database()->GetPublisherInfo(publisher_key, std::move(callback)); }); @@ -446,10 +441,9 @@ void RewardsEngine::GetPublisherPanelInfo( }); } -void RewardsEngine::SavePublisherInfo( - uint64_t window_id, - mojom::PublisherInfoPtr publisher_info, - SavePublisherInfoCallback callback) { +void RewardsEngine::SavePublisherInfo(uint64_t window_id, + mojom::PublisherInfoPtr publisher_info, + SavePublisherInfoCallback callback) { WhenReady([this, window_id, info = std::move(publisher_info), callback = std::move(callback)]() mutable { publisher()->SavePublisherInfo(window_id, std::move(info), @@ -515,17 +509,15 @@ void RewardsEngine::ConnectExternalWallet( }); } -void RewardsEngine::GetAllContributions( - GetAllContributionsCallback callback) { +void RewardsEngine::GetAllContributions(GetAllContributionsCallback callback) { WhenReady([this, callback = std::move(callback)]() mutable { database()->GetAllContributions(std::move(callback)); }); } void RewardsEngine::Shutdown(ShutdownCallback callback) { - Get().Shutdown( - base::BindOnce(&RewardsEngine::OnShutdownComplete, GetWeakPtr(), - std::move(callback))); + Get().Shutdown(base::BindOnce( + &RewardsEngine::OnShutdownComplete, GetWeakPtr(), std::move(callback))); } void RewardsEngine::GetEventLogs(GetEventLogsCallback callback) { @@ -634,13 +626,13 @@ bool RewardsEngine::IsReady() { } void RewardsEngine::OnInitializationComplete(InitializeCallback callback, - bool success) { + bool success) { ready_event_.Signal(); std::move(callback).Run(success ? mojom::Result::OK : mojom::Result::FAILED); } void RewardsEngine::OnShutdownComplete(ShutdownCallback callback, - bool success) { + bool success) { std::move(callback).Run(success ? mojom::Result::OK : mojom::Result::FAILED); } diff --git a/components/brave_rewards/core/rewards_engine.h b/components/brave_rewards/core/internal/rewards_engine.h similarity index 96% rename from components/brave_rewards/core/rewards_engine.h rename to components/brave_rewards/core/internal/rewards_engine.h index 9dde0b1d7056..f52caf420cfe 100644 --- a/components/brave_rewards/core/rewards_engine.h +++ b/components/brave_rewards/core/internal/rewards_engine.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_ENGINE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_ENGINE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_ENGINE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_ENGINE_H_ #include #include @@ -17,9 +17,9 @@ #include "base/one_shot_event.h" #include "base/supports_user_data.h" #include "base/types/always_false.h" -#include "brave/components/brave_rewards/common/mojom/rewards_engine.mojom.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" -#include "brave/components/brave_rewards/core/rewards_log_stream.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_log_stream.h" +#include "brave/components/brave_rewards/core/mojom/rewards_engine.mojom.h" #include "mojo/public/cpp/bindings/associated_remote.h" #include "mojo/public/cpp/bindings/pending_associated_remote.h" @@ -388,4 +388,4 @@ class RewardsEngine : public mojom::RewardsEngine, } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_ENGINE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_ENGINE_H_ diff --git a/components/brave_rewards/core/rewards_engine_helper.cc b/components/brave_rewards/core/internal/rewards_engine_helper.cc similarity index 91% rename from components/brave_rewards/core/rewards_engine_helper.cc rename to components/brave_rewards/core/internal/rewards_engine_helper.cc index fddeab5a34ea..2cbce72815d3 100644 --- a/components/brave_rewards/core/rewards_engine_helper.cc +++ b/components/brave_rewards/core/internal/rewards_engine_helper.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/rewards_engine_helper.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine_helper.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/rewards_engine_helper.h b/components/brave_rewards/core/internal/rewards_engine_helper.h similarity index 75% rename from components/brave_rewards/core/rewards_engine_helper.h rename to components/brave_rewards/core/internal/rewards_engine_helper.h index 3d928a150881..12cd50a33ad8 100644 --- a/components/brave_rewards/core/rewards_engine_helper.h +++ b/components/brave_rewards/core/internal/rewards_engine_helper.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_ENGINE_HELPER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_ENGINE_HELPER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_ENGINE_HELPER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_ENGINE_HELPER_H_ #include "base/memory/raw_ref.h" #include "base/supports_user_data.h" -#include "brave/components/brave_rewards/common/mojom/rewards_engine.mojom.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/rewards_log_stream.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_log_stream.h" +#include "brave/components/brave_rewards/core/mojom/rewards_engine.mojom.h" namespace brave_rewards::internal { @@ -55,4 +55,4 @@ class WithHelperKey { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_ENGINE_HELPER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_ENGINE_HELPER_H_ diff --git a/components/brave_rewards/core/rewards_log_stream.cc b/components/brave_rewards/core/internal/rewards_log_stream.cc similarity index 93% rename from components/brave_rewards/core/rewards_log_stream.cc rename to components/brave_rewards/core/internal/rewards_log_stream.cc index f02fae0e3ada..8de1576d1aa8 100644 --- a/components/brave_rewards/core/rewards_log_stream.cc +++ b/components/brave_rewards/core/internal/rewards_log_stream.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/rewards_log_stream.h" +#include "brave/components/brave_rewards/core/internal/rewards_log_stream.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/rewards_log_stream.h b/components/brave_rewards/core/internal/rewards_log_stream.h similarity index 81% rename from components/brave_rewards/core/rewards_log_stream.h rename to components/brave_rewards/core/internal/rewards_log_stream.h index 03129d4854c5..82a8a38159d5 100644 --- a/components/brave_rewards/core/rewards_log_stream.h +++ b/components/brave_rewards/core/internal/rewards_log_stream.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_LOG_STREAM_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_LOG_STREAM_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_LOG_STREAM_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_LOG_STREAM_H_ #include #include #include "base/location.h" #include "base/memory/raw_ptr.h" -#include "brave/components/brave_rewards/common/mojom/rewards_engine.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_engine.mojom.h" namespace brave_rewards::internal { @@ -47,4 +47,4 @@ class RewardsLogStream { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_LOG_STREAM_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_REWARDS_LOG_STREAM_H_ diff --git a/components/brave_rewards/core/state/state.cc b/components/brave_rewards/core/internal/state/state.cc similarity index 73% rename from components/brave_rewards/core/state/state.cc rename to components/brave_rewards/core/internal/state/state.cc index 19c13323e32b..f033f3eb6988 100644 --- a/components/brave_rewards/core/state/state.cc +++ b/components/brave_rewards/core/internal/state/state.cc @@ -3,21 +3,22 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/state/state.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" #include #include #include #include "base/base64.h" -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/constants.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/parameters/rewards_parameters_provider.h" -#include "brave/components/brave_rewards/core/publisher/publisher.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/state/state_migration.h" +#include "base/strings/string_number_conversions.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/constants.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/parameters/rewards_parameters_provider.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration.h" namespace brave_rewards::internal::state { @@ -30,7 +31,7 @@ void State::Initialize(ResultCallback callback) { } void State::SetVersion(const int version) { - engine_->database()->SaveEventLog(kVersion, std::to_string(version)); + engine_->database()->SaveEventLog(kVersion, base::NumberToString(version)); engine_->SetState(kVersion, version); } @@ -39,7 +40,8 @@ int State::GetVersion() { } void State::SetPublisherMinVisitTime(const int duration) { - engine_->database()->SaveEventLog(kMinVisitTime, std::to_string(duration)); + engine_->database()->SaveEventLog(kMinVisitTime, + base::NumberToString(duration)); engine_->SetState(kMinVisitTime, duration); engine_->publisher()->CalcScoreConsts(duration); engine_->publisher()->SynopsisNormalizer(); @@ -50,7 +52,7 @@ int State::GetPublisherMinVisitTime() { } void State::SetPublisherMinVisits(const int visits) { - engine_->database()->SaveEventLog(kMinVisits, std::to_string(visits)); + engine_->database()->SaveEventLog(kMinVisits, base::NumberToString(visits)); engine_->SetState(kMinVisits, visits); engine_->publisher()->SynopsisNormalizer(); } @@ -60,8 +62,8 @@ int State::GetPublisherMinVisits() { } void State::SetScoreValues(double a, double b) { - engine_->database()->SaveEventLog(kScoreA, std::to_string(a)); - engine_->database()->SaveEventLog(kScoreB, std::to_string(b)); + engine_->database()->SaveEventLog(kScoreA, base::NumberToString(a)); + engine_->database()->SaveEventLog(kScoreB, base::NumberToString(b)); engine_->SetState(kScoreA, a); engine_->SetState(kScoreB, b); } @@ -91,7 +93,7 @@ void State::SetReconcileStamp(const int reconcile_interval) { } engine_->database()->SaveEventLog(kNextReconcileStamp, - std::to_string(reconcile_stamp)); + base::NumberToString(reconcile_stamp)); engine_->SetState(kNextReconcileStamp, reconcile_stamp); engine_->client()->ReconcileStampReset(); } @@ -104,7 +106,8 @@ uint64_t State::GetCreationStamp() { } void State::SetCreationStamp(const uint64_t stamp) { - engine_->database()->SaveEventLog(kCreationStamp, std::to_string(stamp)); + engine_->database()->SaveEventLog(kCreationStamp, + base::NumberToString(stamp)); engine_->SetState(kCreationStamp, stamp); } diff --git a/components/brave_rewards/core/state/state.h b/components/brave_rewards/core/internal/state/state.h similarity index 84% rename from components/brave_rewards/core/state/state.h rename to components/brave_rewards/core/internal/state/state.h index b1ae50e30bad..5205455ca798 100644 --- a/components/brave_rewards/core/state/state.h +++ b/components/brave_rewards/core/internal/state/state.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_H_ #include #include @@ -12,7 +12,7 @@ #include "base/containers/flat_map.h" #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/state/state_migration.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration.h" namespace brave_rewards::internal { class RewardsEngine; @@ -68,4 +68,4 @@ class State { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_H_ diff --git a/components/brave_rewards/core/state/state_keys.h b/components/brave_rewards/core/internal/state/state_keys.h similarity index 89% rename from components/brave_rewards/core/state/state_keys.h rename to components/brave_rewards/core/internal/state/state_keys.h index 0c06760e887b..1e1025648729 100644 --- a/components/brave_rewards/core/state/state_keys.h +++ b/components/brave_rewards/core/internal/state/state_keys.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_KEYS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_KEYS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_KEYS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_KEYS_H_ namespace brave_rewards::internal { namespace state { @@ -40,4 +40,4 @@ inline constexpr char kWalletSolana[] = "wallets.solana"; } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_KEYS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_KEYS_H_ diff --git a/components/brave_rewards/core/state/state_migration.cc b/components/brave_rewards/core/internal/state/state_migration.cc similarity index 94% rename from components/brave_rewards/core/state/state_migration.cc rename to components/brave_rewards/core/internal/state/state_migration.cc index 747358603d6d..324eb77a560f 100644 --- a/components/brave_rewards/core/state/state_migration.cc +++ b/components/brave_rewards/core/internal/state/state_migration.cc @@ -3,11 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/state/state_migration.h" + #include -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state.h" -#include "brave/components/brave_rewards/core/state/state_migration.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" namespace { diff --git a/components/brave_rewards/core/internal/state/state_migration.h b/components/brave_rewards/core/internal/state/state_migration.h new file mode 100644 index 000000000000..673ea271ec1b --- /dev/null +++ b/components/brave_rewards/core/internal/state/state_migration.h @@ -0,0 +1,65 @@ +/* Copyright (c) 2020 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 https://mozilla.org/MPL/2.0/. */ + +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_H_ + +#include "base/memory/raw_ref.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v1.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v10.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v11.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v12.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v13.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v14.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v2.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v3.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v4.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v5.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v6.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v7.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v8.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v9.h" + +namespace brave_rewards::internal { +class RewardsEngine; + +namespace state { + +class StateMigration { + public: + explicit StateMigration(RewardsEngine& engine); + ~StateMigration(); + + void Start(ResultCallback callback); + + void Migrate(ResultCallback callback); + + private: + void FreshInstall(ResultCallback callback); + + void OnMigration(ResultCallback callback, int version, mojom::Result result); + + const raw_ref engine_; + StateMigrationV1 v1_; + StateMigrationV2 v2_; + StateMigrationV3 v3_; + StateMigrationV4 v4_; + StateMigrationV5 v5_; + StateMigrationV6 v6_; + StateMigrationV7 v7_; + StateMigrationV8 v8_; + StateMigrationV9 v9_; + StateMigrationV10 v10_; + StateMigrationV11 v11_; + StateMigrationV12 v12_; + StateMigrationV13 v13_; + StateMigrationV14 v14_; +}; + +} // namespace state +} // namespace brave_rewards::internal + +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_H_ diff --git a/components/brave_rewards/core/state/state_migration_v1.cc b/components/brave_rewards/core/internal/state/state_migration_v1.cc similarity index 86% rename from components/brave_rewards/core/state/state_migration_v1.cc rename to components/brave_rewards/core/internal/state/state_migration_v1.cc index 6ef3e07a5038..4b3500e90ca8 100644 --- a/components/brave_rewards/core/state/state_migration_v1.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v1.cc @@ -3,13 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/state/state_migration_v1.h" + #include -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/publisher/publisher.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/state/state_migration_v1.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/publisher/publisher.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" namespace brave_rewards::internal::state { diff --git a/components/brave_rewards/core/state/state_migration_v1.h b/components/brave_rewards/core/internal/state/state_migration_v1.h similarity index 73% rename from components/brave_rewards/core/state/state_migration_v1.h rename to components/brave_rewards/core/internal/state/state_migration_v1.h index eae3ec76a028..3494bb2180f3 100644 --- a/components/brave_rewards/core/state/state_migration_v1.h +++ b/components/brave_rewards/core/internal/state/state_migration_v1.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V1_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V1_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V1_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V1_H_ #include #include @@ -12,8 +12,8 @@ #include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/legacy/publisher_state.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/legacy/publisher_state.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -43,4 +43,4 @@ class StateMigrationV1 { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V1_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V1_H_ diff --git a/components/brave_rewards/core/state/state_migration_v10.cc b/components/brave_rewards/core/internal/state/state_migration_v10.cc similarity index 92% rename from components/brave_rewards/core/state/state_migration_v10.cc rename to components/brave_rewards/core/internal/state/state_migration_v10.cc index 4303632e1329..4fd6e0c5c8b5 100644 --- a/components/brave_rewards/core/state/state_migration_v10.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v10.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/state/state_migration_v10.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v10.h" #include #include -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/uphold/uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold.h" namespace brave_rewards::internal { using endpoints::GetWallet; diff --git a/components/brave_rewards/core/state/state_migration_v10.h b/components/brave_rewards/core/internal/state/state_migration_v10.h similarity index 67% rename from components/brave_rewards/core/state/state_migration_v10.h rename to components/brave_rewards/core/internal/state/state_migration_v10.h index 6bce660364a3..bca21182853c 100644 --- a/components/brave_rewards/core/state/state_migration_v10.h +++ b/components/brave_rewards/core/internal/state/state_migration_v10.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V10_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V10_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V10_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V10_H_ #include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/endpoints/brave/get_wallet.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/get_wallet.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -34,4 +34,4 @@ class StateMigrationV10 { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V10_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V10_H_ diff --git a/components/brave_rewards/core/state/state_migration_v11.cc b/components/brave_rewards/core/internal/state/state_migration_v11.cc similarity index 77% rename from components/brave_rewards/core/state/state_migration_v11.cc rename to components/brave_rewards/core/internal/state/state_migration_v11.cc index 829560c44a5e..e3a3bf7de4c6 100644 --- a/components/brave_rewards/core/state/state_migration_v11.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v11.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/state/state_migration_v11.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v11.h" #include #include "base/check.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" namespace brave_rewards::internal::state { diff --git a/components/brave_rewards/core/state/state_migration_v11.h b/components/brave_rewards/core/internal/state/state_migration_v11.h similarity index 66% rename from components/brave_rewards/core/state/state_migration_v11.h rename to components/brave_rewards/core/internal/state/state_migration_v11.h index 21d8d38d0b26..dcff0f63236a 100644 --- a/components/brave_rewards/core/state/state_migration_v11.h +++ b/components/brave_rewards/core/internal/state/state_migration_v11.h @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V11_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V11_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V11_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V11_H_ #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { @@ -28,4 +28,4 @@ class StateMigrationV11 { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V11_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V11_H_ diff --git a/components/brave_rewards/core/state/state_migration_v12.cc b/components/brave_rewards/core/internal/state/state_migration_v12.cc similarity index 91% rename from components/brave_rewards/core/state/state_migration_v12.cc rename to components/brave_rewards/core/internal/state/state_migration_v12.cc index bbe90063f492..37a0ce6a0ac9 100644 --- a/components/brave_rewards/core/state/state_migration_v12.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v12.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/state/state_migration_v12.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v12.h" #include #include #include "base/ranges/algorithm.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet/wallet_util.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_util.h" namespace brave_rewards::internal::state { diff --git a/components/brave_rewards/core/state/state_migration_v12.h b/components/brave_rewards/core/internal/state/state_migration_v12.h similarity index 69% rename from components/brave_rewards/core/state/state_migration_v12.h rename to components/brave_rewards/core/internal/state/state_migration_v12.h index 65e92d69d170..54bfcc33e1c9 100644 --- a/components/brave_rewards/core/state/state_migration_v12.h +++ b/components/brave_rewards/core/internal/state/state_migration_v12.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V12_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V12_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V12_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V12_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -32,4 +32,4 @@ class StateMigrationV12 { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V12_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V12_H_ diff --git a/components/brave_rewards/core/state/state_migration_v13.cc b/components/brave_rewards/core/internal/state/state_migration_v13.cc similarity index 81% rename from components/brave_rewards/core/state/state_migration_v13.cc rename to components/brave_rewards/core/internal/state/state_migration_v13.cc index 3e7a532fa662..6a28cf717947 100644 --- a/components/brave_rewards/core/state/state_migration_v13.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v13.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/state/state_migration_v13.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v13.h" #include #include #include "base/ranges/algorithm.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet/wallet_util.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_util.h" namespace brave_rewards::internal::state { diff --git a/components/brave_rewards/core/state/state_migration_v13.h b/components/brave_rewards/core/internal/state/state_migration_v13.h similarity index 69% rename from components/brave_rewards/core/state/state_migration_v13.h rename to components/brave_rewards/core/internal/state/state_migration_v13.h index 882a5cbaee00..c67c84fde8cd 100644 --- a/components/brave_rewards/core/state/state_migration_v13.h +++ b/components/brave_rewards/core/internal/state/state_migration_v13.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V13_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V13_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V13_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V13_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -32,4 +32,4 @@ class StateMigrationV13 { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V13_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V13_H_ diff --git a/components/brave_rewards/core/state/state_migration_v14.cc b/components/brave_rewards/core/internal/state/state_migration_v14.cc similarity index 78% rename from components/brave_rewards/core/state/state_migration_v14.cc rename to components/brave_rewards/core/internal/state/state_migration_v14.cc index 5f38acf02b8b..f3be3931ecd8 100644 --- a/components/brave_rewards/core/state/state_migration_v14.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v14.cc @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/state/state_migration_v14.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v14.h" #include #include #include "base/ranges/algorithm.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/wallet/wallet_util.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_util.h" namespace brave_rewards::internal::state { diff --git a/components/brave_rewards/core/state/state_migration_v14.h b/components/brave_rewards/core/internal/state/state_migration_v14.h similarity index 74% rename from components/brave_rewards/core/state/state_migration_v14.h rename to components/brave_rewards/core/internal/state/state_migration_v14.h index d33b36606d5e..6c31a1f364db 100644 --- a/components/brave_rewards/core/state/state_migration_v14.h +++ b/components/brave_rewards/core/internal/state/state_migration_v14.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V14_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V14_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V14_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V14_H_ #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -35,4 +35,4 @@ class StateMigrationV14 { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V14_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V14_H_ diff --git a/components/brave_rewards/core/state/state_migration_v2.cc b/components/brave_rewards/core/internal/state/state_migration_v2.cc similarity index 89% rename from components/brave_rewards/core/state/state_migration_v2.cc rename to components/brave_rewards/core/internal/state/state_migration_v2.cc index d471b86bce4f..a2cad5d8a337 100644 --- a/components/brave_rewards/core/state/state_migration_v2.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v2.cc @@ -3,12 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/state/state_migration_v2.h" + #include #include "base/base64.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/state/state_migration_v2.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" namespace brave_rewards::internal::state { diff --git a/components/brave_rewards/core/state/state_migration_v2.h b/components/brave_rewards/core/internal/state/state_migration_v2.h similarity index 69% rename from components/brave_rewards/core/state/state_migration_v2.h rename to components/brave_rewards/core/internal/state/state_migration_v2.h index d5e06f319830..cadbb1f0d868 100644 --- a/components/brave_rewards/core/state/state_migration_v2.h +++ b/components/brave_rewards/core/internal/state/state_migration_v2.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V2_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V2_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V2_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V2_H_ #include #include #include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" -#include "brave/components/brave_rewards/core/legacy/bat_state.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/legacy/bat_state.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -37,4 +37,4 @@ class StateMigrationV2 { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V2_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V2_H_ diff --git a/components/brave_rewards/core/state/state_migration_v3.cc b/components/brave_rewards/core/internal/state/state_migration_v3.cc similarity index 90% rename from components/brave_rewards/core/state/state_migration_v3.cc rename to components/brave_rewards/core/internal/state/state_migration_v3.cc index db3ce138dc3b..b7f0a4ef04b3 100644 --- a/components/brave_rewards/core/state/state_migration_v3.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v3.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/state/state_migration_v3.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v3.h" #include diff --git a/components/brave_rewards/core/state/state_migration_v3.h b/components/brave_rewards/core/internal/state/state_migration_v3.h similarity index 61% rename from components/brave_rewards/core/state/state_migration_v3.h rename to components/brave_rewards/core/internal/state/state_migration_v3.h index 5245f68cc4b6..1ef513f5606e 100644 --- a/components/brave_rewards/core/state/state_migration_v3.h +++ b/components/brave_rewards/core/internal/state/state_migration_v3.h @@ -3,10 +3,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V3_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V3_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V3_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V3_H_ -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { namespace state { @@ -22,4 +22,4 @@ class StateMigrationV3 { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V3_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V3_H_ diff --git a/components/brave_rewards/core/state/state_migration_v4.cc b/components/brave_rewards/core/internal/state/state_migration_v4.cc similarity index 80% rename from components/brave_rewards/core/state/state_migration_v4.cc rename to components/brave_rewards/core/internal/state/state_migration_v4.cc index 8894eb5dc5de..88696f766bfb 100644 --- a/components/brave_rewards/core/state/state_migration_v4.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v4.cc @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/state/state_migration_v4.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v4.h" #include -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::state { diff --git a/components/brave_rewards/core/state/state_migration_v4.h b/components/brave_rewards/core/internal/state/state_migration_v4.h similarity index 66% rename from components/brave_rewards/core/state/state_migration_v4.h rename to components/brave_rewards/core/internal/state/state_migration_v4.h index 9617ec2ed0fc..6c217aeea18c 100644 --- a/components/brave_rewards/core/state/state_migration_v4.h +++ b/components/brave_rewards/core/internal/state/state_migration_v4.h @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V4_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V4_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V4_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V4_H_ #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -28,4 +28,4 @@ class StateMigrationV4 { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V4_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V4_H_ diff --git a/components/brave_rewards/core/state/state_migration_v5.cc b/components/brave_rewards/core/internal/state/state_migration_v5.cc similarity index 68% rename from components/brave_rewards/core/state/state_migration_v5.cc rename to components/brave_rewards/core/internal/state/state_migration_v5.cc index becd55483074..f5b878b7abd9 100644 --- a/components/brave_rewards/core/state/state_migration_v5.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v5.cc @@ -2,15 +2,16 @@ * 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 https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/state/state_migration_v5.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v5.h" #include #include #include -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" +#include "base/strings/string_number_conversions.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" namespace brave_rewards::internal::state { @@ -30,7 +31,7 @@ void StateMigrationV5::Migrate(ResultCallback callback) { // Auto contribute auto enabled = engine_->GetState(kAutoContributeEnabled); events.insert( - std::make_pair(kAutoContributeEnabled, std::to_string(enabled))); + std::make_pair(kAutoContributeEnabled, base::NumberToString(enabled))); // Seed if (seed.size() > 1) { @@ -44,16 +45,17 @@ void StateMigrationV5::Migrate(ResultCallback callback) { // Enabled enabled = engine_->GetState("enabled"); - events.insert(std::make_pair("enabled", std::to_string(enabled))); + events.insert(std::make_pair("enabled", base::NumberToString(enabled))); // Next reconcile const auto reconcile_stamp = engine_->GetState(kNextReconcileStamp); - events.insert( - std::make_pair(kNextReconcileStamp, std::to_string(reconcile_stamp))); + events.insert(std::make_pair(kNextReconcileStamp, + base::NumberToString(reconcile_stamp))); // Creation stamp const auto creation_stamp = engine_->GetState(kCreationStamp); - events.insert(std::make_pair(kCreationStamp, std::to_string(creation_stamp))); + events.insert( + std::make_pair(kCreationStamp, base::NumberToString(creation_stamp))); engine_->database()->SaveEventLogs(events, std::move(callback)); } diff --git a/components/brave_rewards/core/state/state_migration_v5.h b/components/brave_rewards/core/internal/state/state_migration_v5.h similarity index 66% rename from components/brave_rewards/core/state/state_migration_v5.h rename to components/brave_rewards/core/internal/state/state_migration_v5.h index 4ad31d6f8985..33752096ce02 100644 --- a/components/brave_rewards/core/state/state_migration_v5.h +++ b/components/brave_rewards/core/internal/state/state_migration_v5.h @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V5_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V5_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V5_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V5_H_ #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -28,4 +28,4 @@ class StateMigrationV5 { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V5_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V5_H_ diff --git a/components/brave_rewards/core/state/state_migration_v6.cc b/components/brave_rewards/core/internal/state/state_migration_v6.cc similarity index 83% rename from components/brave_rewards/core/state/state_migration_v6.cc rename to components/brave_rewards/core/internal/state/state_migration_v6.cc index 69337a0f34eb..1cb0454947f3 100644 --- a/components/brave_rewards/core/state/state_migration_v6.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v6.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/state/state_migration_v6.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v6.h" #include #include #include #include "base/json/json_writer.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" namespace brave_rewards::internal::state { diff --git a/components/brave_rewards/core/state/state_migration_v6.h b/components/brave_rewards/core/internal/state/state_migration_v6.h similarity index 66% rename from components/brave_rewards/core/state/state_migration_v6.h rename to components/brave_rewards/core/internal/state/state_migration_v6.h index 7d4be8234f04..b3eaac8aa6fe 100644 --- a/components/brave_rewards/core/state/state_migration_v6.h +++ b/components/brave_rewards/core/internal/state/state_migration_v6.h @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V6_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V6_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V6_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V6_H_ #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -28,4 +28,4 @@ class StateMigrationV6 { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V6_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V6_H_ diff --git a/components/brave_rewards/core/state/state_migration_v7.cc b/components/brave_rewards/core/internal/state/state_migration_v7.cc similarity index 77% rename from components/brave_rewards/core/state/state_migration_v7.cc rename to components/brave_rewards/core/internal/state/state_migration_v7.cc index dd109d322ea0..0eb6de7834c5 100644 --- a/components/brave_rewards/core/state/state_migration_v7.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v7.cc @@ -2,14 +2,14 @@ * 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 https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/state/state_migration_v7.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v7.h" #include #include -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" namespace brave_rewards::internal::state { diff --git a/components/brave_rewards/core/state/state_migration_v7.h b/components/brave_rewards/core/internal/state/state_migration_v7.h similarity index 66% rename from components/brave_rewards/core/state/state_migration_v7.h rename to components/brave_rewards/core/internal/state/state_migration_v7.h index 897147888137..0b56ddd4b9be 100644 --- a/components/brave_rewards/core/state/state_migration_v7.h +++ b/components/brave_rewards/core/internal/state/state_migration_v7.h @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V7_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V7_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V7_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V7_H_ #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -28,4 +28,4 @@ class StateMigrationV7 { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V7_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V7_H_ diff --git a/components/brave_rewards/core/state/state_migration_v8.cc b/components/brave_rewards/core/internal/state/state_migration_v8.cc similarity index 76% rename from components/brave_rewards/core/state/state_migration_v8.cc rename to components/brave_rewards/core/internal/state/state_migration_v8.cc index 38126165c6f3..cdd57ac0b67c 100644 --- a/components/brave_rewards/core/state/state_migration_v8.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v8.cc @@ -2,13 +2,13 @@ * 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 https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/state/state_migration_v8.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v8.h" #include #include -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" namespace brave_rewards::internal::state { diff --git a/components/brave_rewards/core/state/state_migration_v8.h b/components/brave_rewards/core/internal/state/state_migration_v8.h similarity index 66% rename from components/brave_rewards/core/state/state_migration_v8.h rename to components/brave_rewards/core/internal/state/state_migration_v8.h index fdac99ac23ad..afdfcd1c3f2e 100644 --- a/components/brave_rewards/core/state/state_migration_v8.h +++ b/components/brave_rewards/core/internal/state/state_migration_v8.h @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V8_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V8_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V8_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V8_H_ #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -28,4 +28,4 @@ class StateMigrationV8 { } // namespace state } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V8_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V8_H_ diff --git a/components/brave_rewards/core/state/state_migration_v9.cc b/components/brave_rewards/core/internal/state/state_migration_v9.cc similarity index 90% rename from components/brave_rewards/core/state/state_migration_v9.cc rename to components/brave_rewards/core/internal/state/state_migration_v9.cc index 4d26256156aa..19138b2f7366 100644 --- a/components/brave_rewards/core/state/state_migration_v9.cc +++ b/components/brave_rewards/core/internal/state/state_migration_v9.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/state/state_migration_v9.h" +#include "brave/components/brave_rewards/core/internal/state/state_migration_v9.h" #include diff --git a/components/brave_rewards/core/state/state_migration_v9.h b/components/brave_rewards/core/internal/state/state_migration_v9.h similarity index 60% rename from components/brave_rewards/core/state/state_migration_v9.h rename to components/brave_rewards/core/internal/state/state_migration_v9.h index aa28bfe4b5ef..341c8370e22f 100644 --- a/components/brave_rewards/core/state/state_migration_v9.h +++ b/components/brave_rewards/core/internal/state/state_migration_v9.h @@ -3,10 +3,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V9_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V9_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V9_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V9_H_ -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal::state { @@ -20,4 +20,4 @@ class StateMigrationV9 { } // namespace brave_rewards::internal::state -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_V9_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_STATE_STATE_MIGRATION_V9_H_ diff --git a/components/brave_rewards/core/internal/test/BUILD.gn b/components/brave_rewards/core/internal/test/BUILD.gn new file mode 100644 index 000000000000..4f56900dc3b7 --- /dev/null +++ b/components/brave_rewards/core/internal/test/BUILD.gn @@ -0,0 +1,99 @@ +# Copyright (c) 2021 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 https://mozilla.org/MPL/2.0/. */ + +import("//brave/build/config.gni") +import("//build/config/sanitizers/sanitizers.gni") +import("//testing/test.gni") + +source_set("test") { + testonly = true + + sources = [ + "//brave/components/brave_rewards/core/internal/common/brotli_util_unittest.cc", + "//brave/components/brave_rewards/core/internal/common/request_signer_unittest.cc", + "//brave/components/brave_rewards/core/internal/common/signer_unittest.cc", + "//brave/components/brave_rewards/core/internal/common/url_loader_unittest.cc", + "//brave/components/brave_rewards/core/internal/contribution/contribution_util_unittest.cc", + "//brave/components/brave_rewards/core/internal/credentials/credentials_util_unittest.cc", + "//brave/components/brave_rewards/core/internal/database/database_migration_unittest.cc", + "//brave/components/brave_rewards/core/internal/database/database_mock.cc", + "//brave/components/brave_rewards/core/internal/database/database_mock.h", + "//brave/components/brave_rewards/core/internal/database/database_publisher_prefix_list_unittest.cc", + "//brave/components/brave_rewards/core/internal/database/database_util_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/bitflyer/get_balance/get_balance_bitflyer_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/bitflyer/post_oauth/post_oauth_bitflyer_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/gemini/post_account/post_account_gemini_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/gemini/post_balance/post_balance_gemini_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/gemini/post_oauth/post_oauth_gemini_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/gemini/post_recipient_id/post_recipient_id_gemini_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/payment/get_credentials/get_credentials_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/payment/post_credentials/post_credentials_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/payment/post_order/post_order_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/payment/post_transaction_uphold/post_transaction_uphold_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/payment/post_votes/post_votes_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/private_cdn/get_publisher/get_publisher_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/rewards/get_prefix_list/get_prefix_list_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/uphold/get_capabilities/get_capabilities_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/uphold/get_card/get_card_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/uphold/get_cards/get_cards_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/uphold/get_me/get_me_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/uphold/patch_card/patch_card_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoint/uphold/post_cards/post_cards_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/bitflyer/post_commit_transaction_bitflyer_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/brave/get_parameters_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/brave/get_wallet_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/brave/patch_wallets_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/brave/post_challenges_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/brave/post_wallets_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/common/post_connect_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/gemini/get_recipient_id_gemini_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/gemini/post_commit_transaction_gemini_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/uphold/get_transaction_status_uphold_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/uphold/post_commit_transaction_uphold_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/uphold/post_create_transaction_uphold_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/uphold/post_oauth_uphold_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/zebpay/get_balance_zebpay_unittest.cc", + "//brave/components/brave_rewards/core/internal/endpoints/zebpay/post_oauth_zebpay_unittest.cc", + "//brave/components/brave_rewards/core/internal/legacy/bat_util_unittest.cc", + "//brave/components/brave_rewards/core/internal/legacy/client_state_unittest.cc", + "//brave/components/brave_rewards/core/internal/legacy/publisher_settings_state_unittest.cc", + "//brave/components/brave_rewards/core/internal/legacy/report_balance_state_unittest.cc", + "//brave/components/brave_rewards/core/internal/legacy/wallet_info_state_unittest.cc", + "//brave/components/brave_rewards/core/internal/parameters/rewards_parameters_provider_unittest.cc", + "//brave/components/brave_rewards/core/internal/publisher/media/helper_unittest.cc", + "//brave/components/brave_rewards/core/internal/publisher/media/youtube_unittest.cc", + "//brave/components/brave_rewards/core/internal/publisher/prefix_list_reader_unittest.cc", + "//brave/components/brave_rewards/core/internal/publisher/publisher_unittest.cc", + "//brave/components/brave_rewards/core/internal/test/rewards_engine_test.cc", + "//brave/components/brave_rewards/core/internal/test/rewards_engine_test.h", + "//brave/components/brave_rewards/core/internal/test/test_rewards_engine_client.cc", + "//brave/components/brave_rewards/core/internal/test/test_rewards_engine_client.h", + "//brave/components/brave_rewards/core/internal/test/test_rewards_engine_client_unittest.cc", + "//brave/components/brave_rewards/core/internal/wallet/wallet_unittest.cc", + "//brave/components/brave_rewards/core/internal/wallet/wallet_utils_unittest.cc", + "//brave/components/brave_rewards/core/internal/wallet_provider/bitflyer/connect_bitflyer_wallet_unittest.cc", + "//brave/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet_unittest.cc", + "//brave/components/brave_rewards/core/internal/wallet_provider/gemini/connect_gemini_wallet_unittest.cc", + "//brave/components/brave_rewards/core/internal/wallet_provider/linkage_checker_unittest.cc", + "//brave/components/brave_rewards/core/internal/wallet_provider/solana/solana_wallet_provider_unittest.cc", + "//brave/components/brave_rewards/core/internal/wallet_provider/uphold/connect_uphold_wallet_unittest.cc", + "//brave/components/brave_rewards/core/internal/wallet_provider/zebpay/connect_zebpay_wallet_unittest.cc", + ] + + deps = [ + "//base/test:test_support", + "//brave/components/brave_rewards/core/internal", + "//brave/components/brave_rewards/core/internal:publishers_proto", + "//brave/components/brave_rewards/core/mojom:core", + "//brave/components/challenge_bypass_ristretto", + "//brave/third_party/rapidjson", + "//net:net", + "//sql:sql", + "//url:url", + ] + + data = [ "data/" ] +} diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v1.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v1.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v1.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v1.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v10.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v10.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v10.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v10.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v11.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v11.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v11.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v11.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v12.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v12.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v12.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v12.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v13.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v13.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v13.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v13.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v14.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v14.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v14.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v14.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v15.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v15.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v15.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v15.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v16.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v16.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v16.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v16.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v17.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v17.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v17.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v17.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v18.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v18.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v18.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v18.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v19.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v19.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v19.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v19.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v20.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v20.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v20.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v20.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v21.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v21.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v21.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v21.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v22.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v22.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v22.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v22.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v23.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v23.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v23.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v23.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v24.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v24.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v24.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v24.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v25.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v25.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v25.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v25.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v26.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v26.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v26.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v26.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v27.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v27.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v27.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v27.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v29.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v29.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v29.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v29.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v3.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v3.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v3.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v3.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v30.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v30.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v30.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v30.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v32.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v32.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v32.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v32.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v33.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v33.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v33.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v33.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v34.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v34.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v34.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v34.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v35.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v35.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v35.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v35.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v36.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v36.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v36.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v36.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v37.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v37.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v37.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v37.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v38.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v38.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v38.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v38.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v39.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v39.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v39.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v39.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v4.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v4.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v4.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v4.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v5.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v5.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v5.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v5.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v6.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v6.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v6.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v6.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v7.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v7.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v7.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v7.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v8.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v8.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v8.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v8.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_db_v9.sql b/components/brave_rewards/core/internal/test/data/publisher_info_db_v9.sql similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_db_v9.sql rename to components/brave_rewards/core/internal/test/data/publisher_info_db_v9.sql diff --git a/components/brave_rewards/core/test/data/publisher_info_schema_current.txt b/components/brave_rewards/core/internal/test/data/publisher_info_schema_current.txt similarity index 100% rename from components/brave_rewards/core/test/data/publisher_info_schema_current.txt rename to components/brave_rewards/core/internal/test/data/publisher_info_schema_current.txt diff --git a/components/brave_rewards/core/test/rewards_engine_test.cc b/components/brave_rewards/core/internal/test/rewards_engine_test.cc similarity index 86% rename from components/brave_rewards/core/test/rewards_engine_test.cc rename to components/brave_rewards/core/internal/test/rewards_engine_test.cc index 99ed7bc2fdf0..46bf9534ffe9 100644 --- a/components/brave_rewards/core/test/rewards_engine_test.cc +++ b/components/brave_rewards/core/internal/test/rewards_engine_test.cc @@ -3,9 +3,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/test/rewards_engine_test.h b/components/brave_rewards/core/internal/test/rewards_engine_test.h similarity index 88% rename from components/brave_rewards/core/test/rewards_engine_test.h rename to components/brave_rewards/core/internal/test/rewards_engine_test.h index b8773677f4c6..c987ace0bb34 100644 --- a/components/brave_rewards/core/test/rewards_engine_test.h +++ b/components/brave_rewards/core/internal/test/rewards_engine_test.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_TEST_REWARDS_ENGINE_TEST_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_TEST_REWARDS_ENGINE_TEST_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_TEST_REWARDS_ENGINE_TEST_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_TEST_REWARDS_ENGINE_TEST_H_ #include #include @@ -14,8 +14,8 @@ #include "base/test/bind.h" #include "base/test/task_environment.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/test/test_rewards_engine_client.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/test/test_rewards_engine_client.h" #include "mojo/public/cpp/bindings/associated_receiver.h" #include "testing/gtest/include/gtest/gtest.h" @@ -91,4 +91,4 @@ class RewardsEngineTest : public testing::Test { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_TEST_REWARDS_ENGINE_TEST_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_TEST_REWARDS_ENGINE_TEST_H_ diff --git a/components/brave_rewards/core/test/test_rewards_engine_client.cc b/components/brave_rewards/core/internal/test/test_rewards_engine_client.cc similarity index 98% rename from components/brave_rewards/core/test/test_rewards_engine_client.cc rename to components/brave_rewards/core/internal/test/test_rewards_engine_client.cc index 94d9841c9af8..f0740afd3c91 100644 --- a/components/brave_rewards/core/test/test_rewards_engine_client.cc +++ b/components/brave_rewards/core/internal/test/test_rewards_engine_client.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/test/test_rewards_engine_client.h" +#include "brave/components/brave_rewards/core/internal/test/test_rewards_engine_client.h" #include #include @@ -19,8 +19,8 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/task/sequenced_task_runner.h" -#include "brave/components/brave_rewards/common/mojom/rewards_engine.mojom-test-utils.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/mojom/rewards_engine.mojom-test-utils.h" #include "net/http/http_status_code.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/components/brave_rewards/core/test/test_rewards_engine_client.h b/components/brave_rewards/core/internal/test/test_rewards_engine_client.h similarity index 93% rename from components/brave_rewards/core/test/test_rewards_engine_client.h rename to components/brave_rewards/core/internal/test/test_rewards_engine_client.h index 53d2a6635e1b..861bbe1c6b94 100644 --- a/components/brave_rewards/core/test/test_rewards_engine_client.h +++ b/components/brave_rewards/core/internal/test/test_rewards_engine_client.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_TEST_TEST_REWARDS_ENGINE_CLIENT_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_TEST_TEST_REWARDS_ENGINE_CLIENT_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_TEST_TEST_REWARDS_ENGINE_CLIENT_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_TEST_TEST_REWARDS_ENGINE_CLIENT_H_ #include #include @@ -17,9 +17,9 @@ #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "base/values.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_engine.mojom.h" -#include "brave/components/brave_rewards/core/rewards_database.h" +#include "brave/components/brave_rewards/core/internal/rewards_database.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_engine.mojom.h" namespace brave_rewards::internal { @@ -218,4 +218,4 @@ class TestRewardsEngineClient : public mojom::RewardsEngineClient { } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_TEST_TEST_REWARDS_ENGINE_CLIENT_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_TEST_TEST_REWARDS_ENGINE_CLIENT_H_ diff --git a/components/brave_rewards/core/test/test_rewards_engine_client_unittest.cc b/components/brave_rewards/core/internal/test/test_rewards_engine_client_unittest.cc similarity index 87% rename from components/brave_rewards/core/test/test_rewards_engine_client_unittest.cc rename to components/brave_rewards/core/internal/test/test_rewards_engine_client_unittest.cc index 13bd019e6605..5023ace558c2 100644 --- a/components/brave_rewards/core/test/test_rewards_engine_client_unittest.cc +++ b/components/brave_rewards/core/internal/test/test_rewards_engine_client_unittest.cc @@ -3,10 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/test/test_rewards_engine_client.h" +#include "brave/components/brave_rewards/core/internal/test/test_rewards_engine_client.h" + #include "base/test/bind.h" #include "base/test/task_environment.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" #include "sql/statement.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/components/brave_rewards/core/uphold/uphold.cc b/components/brave_rewards/core/internal/uphold/uphold.cc similarity index 76% rename from components/brave_rewards/core/uphold/uphold.cc rename to components/brave_rewards/core/internal/uphold/uphold.cc index 779c1c07a857..bc6db74ce243 100644 --- a/components/brave_rewards/core/uphold/uphold.cc +++ b/components/brave_rewards/core/internal/uphold/uphold.cc @@ -3,18 +3,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/uphold/uphold.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold.h" #include #include #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet_provider/uphold/connect_uphold_wallet.h" -#include "brave/components/brave_rewards/core/wallet_provider/uphold/uphold_transfer.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/uphold/connect_uphold_wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/uphold/uphold_transfer.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal::uphold { diff --git a/components/brave_rewards/core/uphold/uphold.h b/components/brave_rewards/core/internal/uphold/uphold.h similarity index 67% rename from components/brave_rewards/core/uphold/uphold.h rename to components/brave_rewards/core/internal/uphold/uphold.h index 478f58c82266..2e72a66ad1ad 100644 --- a/components/brave_rewards/core/uphold/uphold.h +++ b/components/brave_rewards/core/internal/uphold/uphold.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_UPHOLD_UPHOLD_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_UPHOLD_UPHOLD_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_UPHOLD_UPHOLD_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_UPHOLD_UPHOLD_H_ #include #include "base/functional/callback_forward.h" #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/endpoint/uphold/uphold_server.h" -#include "brave/components/brave_rewards/core/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/uphold_server.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal { class RewardsEngine; @@ -41,4 +41,4 @@ class Uphold final : public wallet_provider::WalletProvider { } // namespace uphold } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_UPHOLD_UPHOLD_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_UPHOLD_UPHOLD_H_ diff --git a/components/brave_rewards/core/uphold/uphold_capabilities.h b/components/brave_rewards/core/internal/uphold/uphold_capabilities.h similarity index 66% rename from components/brave_rewards/core/uphold/uphold_capabilities.h rename to components/brave_rewards/core/internal/uphold/uphold_capabilities.h index adfe9d736abb..b08df955b5a4 100644 --- a/components/brave_rewards/core/uphold/uphold_capabilities.h +++ b/components/brave_rewards/core/internal/uphold/uphold_capabilities.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_UPHOLD_UPHOLD_CAPABILITIES_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_UPHOLD_UPHOLD_CAPABILITIES_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_UPHOLD_UPHOLD_CAPABILITIES_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_UPHOLD_UPHOLD_CAPABILITIES_H_ #include @@ -19,4 +19,4 @@ struct Capabilities { } // namespace uphold } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_UPHOLD_UPHOLD_CAPABILITIES_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_UPHOLD_UPHOLD_CAPABILITIES_H_ diff --git a/components/brave_rewards/core/uphold/uphold_card.cc b/components/brave_rewards/core/internal/uphold/uphold_card.cc similarity index 92% rename from components/brave_rewards/core/uphold/uphold_card.cc rename to components/brave_rewards/core/internal/uphold/uphold_card.cc index 954c5f47face..1c5f206e03c9 100644 --- a/components/brave_rewards/core/uphold/uphold_card.cc +++ b/components/brave_rewards/core/internal/uphold/uphold_card.cc @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/uphold/uphold_card.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold_card.h" #include -#include "brave/components/brave_rewards/core/endpoint/uphold/uphold_server.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/uphold_server.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::uphold { diff --git a/components/brave_rewards/core/uphold/uphold_card.h b/components/brave_rewards/core/internal/uphold/uphold_card.h similarity index 79% rename from components/brave_rewards/core/uphold/uphold_card.h rename to components/brave_rewards/core/internal/uphold/uphold_card.h index 1cc49a117382..1a50d3bac168 100644 --- a/components/brave_rewards/core/uphold/uphold_card.h +++ b/components/brave_rewards/core/internal/uphold/uphold_card.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_UPHOLD_UPHOLD_CARD_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_UPHOLD_UPHOLD_CARD_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_UPHOLD_UPHOLD_CARD_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_UPHOLD_UPHOLD_CARD_H_ #include #include "base/functional/callback_forward.h" #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/endpoint/uphold/uphold_server.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/uphold_server.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal { class RewardsEngine; @@ -53,4 +53,4 @@ class UpholdCard { } // namespace uphold } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_UPHOLD_UPHOLD_CARD_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_UPHOLD_UPHOLD_CARD_H_ diff --git a/components/brave_rewards/core/uphold/uphold_user.cc b/components/brave_rewards/core/internal/uphold/uphold_user.cc similarity index 85% rename from components/brave_rewards/core/uphold/uphold_user.cc rename to components/brave_rewards/core/internal/uphold/uphold_user.cc index dffc33797776..7ce5fbedffac 100644 --- a/components/brave_rewards/core/uphold/uphold_user.cc +++ b/components/brave_rewards/core/internal/uphold/uphold_user.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/uphold/uphold_user.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold_user.h" namespace brave_rewards::internal::uphold { diff --git a/components/brave_rewards/core/uphold/uphold_user.h b/components/brave_rewards/core/internal/uphold/uphold_user.h similarity index 71% rename from components/brave_rewards/core/uphold/uphold_user.h rename to components/brave_rewards/core/internal/uphold/uphold_user.h index bf3b090bf252..99b94cf1f3be 100644 --- a/components/brave_rewards/core/uphold/uphold_user.h +++ b/components/brave_rewards/core/internal/uphold/uphold_user.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_UPHOLD_UPHOLD_USER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_UPHOLD_UPHOLD_USER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_UPHOLD_UPHOLD_USER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_UPHOLD_UPHOLD_USER_H_ #include @@ -24,4 +24,4 @@ struct User { } // namespace brave_rewards::internal::uphold -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_UPHOLD_UPHOLD_USER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_UPHOLD_UPHOLD_USER_H_ diff --git a/components/brave_rewards/core/wallet/wallet.cc b/components/brave_rewards/core/internal/wallet/wallet.cc similarity index 81% rename from components/brave_rewards/core/wallet/wallet.cc rename to components/brave_rewards/core/internal/wallet/wallet.cc index 47756f7c0561..3755ccd92028 100644 --- a/components/brave_rewards/core/wallet/wallet.cc +++ b/components/brave_rewards/core/internal/wallet/wallet.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" #include #include @@ -12,13 +12,14 @@ #include "base/base64.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" +#include "base/strings/string_number_conversions.h" #include "base/values.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/logging/event_log_keys.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/wallet/wallet_util.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/logging/event_log_keys.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_util.h" #include "wally_bip39.h" // NOLINT namespace brave_rewards::internal::wallet { @@ -96,8 +97,8 @@ bool Wallet::SetWallet(mojom::RewardsWalletPtr wallet) { std::string event_string; if (wallet->recovery_seed.size() > 1) { - event_string = - std::to_string(wallet->recovery_seed[0] + wallet->recovery_seed[1]); + event_string = base::NumberToString(wallet->recovery_seed[0] + + wallet->recovery_seed[1]); } base::Value::Dict new_wallet; diff --git a/components/brave_rewards/core/wallet/wallet.h b/components/brave_rewards/core/internal/wallet/wallet.h similarity index 70% rename from components/brave_rewards/core/wallet/wallet.h rename to components/brave_rewards/core/internal/wallet/wallet.h index 407ffa1def7e..8a0a8b8cbdda 100644 --- a/components/brave_rewards/core/wallet/wallet.h +++ b/components/brave_rewards/core/internal/wallet/wallet.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_WALLET_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_WALLET_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_WALLET_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_WALLET_H_ #include @@ -13,9 +13,9 @@ #include "base/containers/flat_map.h" #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" -#include "brave/components/brave_rewards/core/wallet/wallet_balance.h" -#include "brave/components/brave_rewards/core/wallet/wallet_create.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_balance.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_create.h" namespace brave_rewards::internal { class RewardsEngine; @@ -46,4 +46,4 @@ class Wallet { } // namespace wallet } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_WALLET_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_WALLET_H_ diff --git a/components/brave_rewards/core/wallet/wallet_balance.cc b/components/brave_rewards/core/internal/wallet/wallet_balance.cc similarity index 77% rename from components/brave_rewards/core/wallet/wallet_balance.cc rename to components/brave_rewards/core/internal/wallet/wallet_balance.cc index b855fff6cb5b..7c09ee0bf286 100644 --- a/components/brave_rewards/core/wallet/wallet_balance.cc +++ b/components/brave_rewards/core/internal/wallet/wallet_balance.cc @@ -3,18 +3,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet/wallet_balance.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_balance.h" #include #include -#include "brave/components/brave_rewards/core/constants.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/internal/constants.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/wallet_provider.h" namespace brave_rewards::internal::wallet { diff --git a/components/brave_rewards/core/wallet/wallet_balance.h b/components/brave_rewards/core/internal/wallet/wallet_balance.h similarity index 72% rename from components/brave_rewards/core/wallet/wallet_balance.h rename to components/brave_rewards/core/internal/wallet/wallet_balance.h index bc7bfb69d0ed..1795e3a518d2 100644 --- a/components/brave_rewards/core/wallet/wallet_balance.h +++ b/components/brave_rewards/core/internal/wallet/wallet_balance.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_WALLET_BALANCE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_WALLET_BALANCE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_WALLET_BALANCE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_WALLET_BALANCE_H_ #include #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards_core.mojom.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/mojom/rewards_core.mojom.h" namespace brave_rewards::internal { class RewardsEngine; @@ -37,4 +37,4 @@ class WalletBalance { } // namespace wallet } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_WALLET_BALANCE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_WALLET_BALANCE_H_ diff --git a/components/brave_rewards/core/wallet/wallet_create.cc b/components/brave_rewards/core/internal/wallet/wallet_create.cc similarity index 82% rename from components/brave_rewards/core/wallet/wallet_create.cc rename to components/brave_rewards/core/internal/wallet/wallet_create.cc index ed097231b688..b8efc8f1fb86 100644 --- a/components/brave_rewards/core/wallet/wallet_create.cc +++ b/components/brave_rewards/core/internal/wallet/wallet_create.cc @@ -3,22 +3,22 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet/wallet_create.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_create.h" #include #include -#include "brave/components/brave_rewards/core/common/signer.h" -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/endpoints/brave/patch_wallets.h" -#include "brave/components/brave_rewards/core/endpoints/brave/post_wallets.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/logging/event_log_keys.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state.h" -#include "brave/components/brave_rewards/core/wallet/wallet.h" -#include "brave/components/brave_rewards/core/wallet_provider/linkage_checker.h" +#include "brave/components/brave_rewards/core/internal/common/signer.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/patch_wallets.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_wallets.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/logging/event_log_keys.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/linkage_checker.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/wallet/wallet_create.h b/components/brave_rewards/core/internal/wallet/wallet_create.h similarity index 74% rename from components/brave_rewards/core/wallet/wallet_create.h rename to components/brave_rewards/core/internal/wallet/wallet_create.h index 61e127393882..4f845e332270 100644 --- a/components/brave_rewards/core/wallet/wallet_create.h +++ b/components/brave_rewards/core/internal/wallet/wallet_create.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_WALLET_CREATE_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_WALLET_CREATE_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_WALLET_CREATE_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_WALLET_CREATE_H_ #include #include #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -36,4 +36,4 @@ class WalletCreate { } // namespace wallet } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_WALLET_CREATE_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_WALLET_CREATE_H_ diff --git a/components/brave_rewards/core/wallet/wallet_unittest.cc b/components/brave_rewards/core/internal/wallet/wallet_unittest.cc similarity index 88% rename from components/brave_rewards/core/wallet/wallet_unittest.cc rename to components/brave_rewards/core/internal/wallet/wallet_unittest.cc index 282610227b30..11c2ee962234 100644 --- a/components/brave_rewards/core/wallet/wallet_unittest.cc +++ b/components/brave_rewards/core/internal/wallet/wallet_unittest.cc @@ -3,18 +3,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" #include #include #include #include "base/test/bind.h" -#include "brave/components/brave_rewards/common/mojom/rewards_engine.mojom-test-utils.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/mojom/rewards_engine.mojom-test-utils.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/wallet/wallet_util.cc b/components/brave_rewards/core/internal/wallet/wallet_util.cc similarity index 93% rename from components/brave_rewards/core/wallet/wallet_util.cc rename to components/brave_rewards/core/internal/wallet/wallet_util.cc index 1036f3b0e5fd..4882f358bcd2 100644 --- a/components/brave_rewards/core/wallet/wallet_util.cc +++ b/components/brave_rewards/core/internal/wallet/wallet_util.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet/wallet_util.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_util.h" #include #include @@ -15,15 +15,15 @@ #include "base/notreached.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/initialization_manager.h" -#include "brave/components/brave_rewards/core/logging/event_log_keys.h" -#include "brave/components/brave_rewards/core/notifications/notification_keys.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/initialization_manager.h" +#include "brave/components/brave_rewards/core/internal/logging/event_log_keys.h" +#include "brave/components/brave_rewards/core/internal/notifications/notification_keys.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/wallet_provider.h" namespace brave_rewards::internal::wallet { diff --git a/components/brave_rewards/core/wallet/wallet_util.h b/components/brave_rewards/core/internal/wallet/wallet_util.h similarity index 82% rename from components/brave_rewards/core/wallet/wallet_util.h rename to components/brave_rewards/core/internal/wallet/wallet_util.h index 915c2d20ecf6..22f862fac63e 100644 --- a/components/brave_rewards/core/wallet/wallet_util.h +++ b/components/brave_rewards/core/internal/wallet/wallet_util.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_WALLET_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_WALLET_UTIL_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_WALLET_UTIL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_WALLET_UTIL_H_ #include #include -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" #include "third_party/abseil-cpp/absl/types/variant.h" namespace brave_rewards::internal { @@ -41,4 +41,4 @@ bool LogOutWallet(RewardsEngine& engine, } // namespace wallet } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_WALLET_UTIL_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_WALLET_UTIL_H_ diff --git a/components/brave_rewards/core/wallet/wallet_utils_unittest.cc b/components/brave_rewards/core/internal/wallet/wallet_utils_unittest.cc similarity index 96% rename from components/brave_rewards/core/wallet/wallet_utils_unittest.cc rename to components/brave_rewards/core/internal/wallet/wallet_utils_unittest.cc index 6d038aaf041f..352f9a993313 100644 --- a/components/brave_rewards/core/wallet/wallet_utils_unittest.cc +++ b/components/brave_rewards/core/internal/wallet/wallet_utils_unittest.cc @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" -#include "brave/components/brave_rewards/core/wallet/wallet_util.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_util.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" using testing::Test; using testing::Values; diff --git a/components/brave_rewards/core/wallet_provider/bitflyer/bitflyer_transfer.cc b/components/brave_rewards/core/internal/wallet_provider/bitflyer/bitflyer_transfer.cc similarity index 83% rename from components/brave_rewards/core/wallet_provider/bitflyer/bitflyer_transfer.cc rename to components/brave_rewards/core/internal/wallet_provider/bitflyer/bitflyer_transfer.cc index 197c5e219984..c3b8fdef2beb 100644 --- a/components/brave_rewards/core/wallet_provider/bitflyer/bitflyer_transfer.cc +++ b/components/brave_rewards/core/internal/wallet_provider/bitflyer/bitflyer_transfer.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/bitflyer/bitflyer_transfer.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/bitflyer/bitflyer_transfer.h" #include -#include "brave/components/brave_rewards/core/bitflyer/bitflyer.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/bitflyer/bitflyer.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/wallet_provider/bitflyer/bitflyer_transfer.h b/components/brave_rewards/core/internal/wallet_provider/bitflyer/bitflyer_transfer.h similarity index 59% rename from components/brave_rewards/core/wallet_provider/bitflyer/bitflyer_transfer.h rename to components/brave_rewards/core/internal/wallet_provider/bitflyer/bitflyer_transfer.h index 2034576d2951..5f04bdaa9656 100644 --- a/components/brave_rewards/core/wallet_provider/bitflyer/bitflyer_transfer.h +++ b/components/brave_rewards/core/internal/wallet_provider/bitflyer/bitflyer_transfer.h @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_BITFLYER_BITFLYER_TRANSFER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_BITFLYER_BITFLYER_TRANSFER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_BITFLYER_BITFLYER_TRANSFER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_BITFLYER_BITFLYER_TRANSFER_H_ -#include "brave/components/brave_rewards/core/endpoints/bitflyer/post_commit_transaction_bitflyer.h" -#include "brave/components/brave_rewards/core/wallet_provider/transfer.h" +#include "brave/components/brave_rewards/core/internal/endpoints/bitflyer/post_commit_transaction_bitflyer.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/transfer.h" namespace brave_rewards::internal::bitflyer { @@ -26,4 +26,4 @@ class BitFlyerTransfer final : public wallet_provider::Transfer { } // namespace brave_rewards::internal::bitflyer -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_BITFLYER_BITFLYER_TRANSFER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_BITFLYER_BITFLYER_TRANSFER_H_ diff --git a/components/brave_rewards/core/wallet_provider/bitflyer/connect_bitflyer_wallet.cc b/components/brave_rewards/core/internal/wallet_provider/bitflyer/connect_bitflyer_wallet.cc similarity index 80% rename from components/brave_rewards/core/wallet_provider/bitflyer/connect_bitflyer_wallet.cc rename to components/brave_rewards/core/internal/wallet_provider/bitflyer/connect_bitflyer_wallet.cc index f76b517dd9bc..de6e7dc3821f 100644 --- a/components/brave_rewards/core/wallet_provider/bitflyer/connect_bitflyer_wallet.cc +++ b/components/brave_rewards/core/internal/wallet_provider/bitflyer/connect_bitflyer_wallet.cc @@ -3,23 +3,23 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/bitflyer/connect_bitflyer_wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/bitflyer/connect_bitflyer_wallet.h" #include #include "base/containers/contains.h" #include "base/strings/string_number_conversions.h" -#include "brave/components/brave_rewards/core/bitflyer/bitflyer.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/random_util.h" -#include "brave/components/brave_rewards/core/common/url_helpers.h" -#include "brave/components/brave_rewards/core/endpoint/bitflyer/bitflyer_server.h" -#include "brave/components/brave_rewards/core/endpoints/brave/post_connect_bitflyer.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/logging/event_log_keys.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/bitflyer/bitflyer.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/random_util.h" +#include "brave/components/brave_rewards/core/internal/common/url_helpers.h" +#include "brave/components/brave_rewards/core/internal/endpoint/bitflyer/bitflyer_server.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_connect_bitflyer.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/logging/event_log_keys.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" #include "crypto/sha2.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/wallet_provider/bitflyer/connect_bitflyer_wallet.h b/components/brave_rewards/core/internal/wallet_provider/bitflyer/connect_bitflyer_wallet.h similarity index 65% rename from components/brave_rewards/core/wallet_provider/bitflyer/connect_bitflyer_wallet.h rename to components/brave_rewards/core/internal/wallet_provider/bitflyer/connect_bitflyer_wallet.h index 4cbaf626ddd8..2eb62e943f89 100644 --- a/components/brave_rewards/core/wallet_provider/bitflyer/connect_bitflyer_wallet.h +++ b/components/brave_rewards/core/internal/wallet_provider/bitflyer/connect_bitflyer_wallet.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_BITFLYER_CONNECT_BITFLYER_WALLET_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_BITFLYER_CONNECT_BITFLYER_WALLET_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_BITFLYER_CONNECT_BITFLYER_WALLET_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_BITFLYER_CONNECT_BITFLYER_WALLET_H_ #include #include "base/containers/flat_map.h" -#include "brave/components/brave_rewards/core/endpoint/bitflyer/bitflyer_server.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" -#include "brave/components/brave_rewards/core/wallet_provider/connect_external_wallet.h" +#include "brave/components/brave_rewards/core/internal/endpoint/bitflyer/bitflyer_server.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet.h" namespace brave_rewards::internal { class RewardsEngine; @@ -43,4 +43,4 @@ class ConnectBitFlyerWallet : public wallet_provider::ConnectExternalWallet { } // namespace bitflyer } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_BITFLYER_CONNECT_BITFLYER_WALLET_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_BITFLYER_CONNECT_BITFLYER_WALLET_H_ diff --git a/components/brave_rewards/core/wallet_provider/bitflyer/connect_bitflyer_wallet_unittest.cc b/components/brave_rewards/core/internal/wallet_provider/bitflyer/connect_bitflyer_wallet_unittest.cc similarity index 80% rename from components/brave_rewards/core/wallet_provider/bitflyer/connect_bitflyer_wallet_unittest.cc rename to components/brave_rewards/core/internal/wallet_provider/bitflyer/connect_bitflyer_wallet_unittest.cc index 5f0dfdca432b..e28351f79ba7 100644 --- a/components/brave_rewards/core/wallet_provider/bitflyer/connect_bitflyer_wallet_unittest.cc +++ b/components/brave_rewards/core/internal/wallet_provider/bitflyer/connect_bitflyer_wallet_unittest.cc @@ -3,12 +3,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/bitflyer/connect_bitflyer_wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/bitflyer/connect_bitflyer_wallet.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/random_util.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/random_util.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal::bitflyer { diff --git a/components/brave_rewards/core/wallet_provider/connect_external_wallet.cc b/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet.cc similarity index 89% rename from components/brave_rewards/core/wallet_provider/connect_external_wallet.cc rename to components/brave_rewards/core/internal/wallet_provider/connect_external_wallet.cc index f97e078c2ec4..ea0f49e4412e 100644 --- a/components/brave_rewards/core/wallet_provider/connect_external_wallet.cc +++ b/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet.cc @@ -3,20 +3,20 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/connect_external_wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet.h" #include #include "base/containers/contains.h" #include "base/functional/bind.h" #include "base/location.h" -#include "brave/components/brave_rewards/core/common/random_util.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/logging/event_log_keys.h" -#include "brave/components/brave_rewards/core/logging/event_log_util.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/wallet/wallet_util.h" +#include "brave/components/brave_rewards/core/internal/common/random_util.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/logging/event_log_keys.h" +#include "brave/components/brave_rewards/core/internal/logging/event_log_util.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_util.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/wallet_provider/connect_external_wallet.h b/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet.h similarity index 79% rename from components/brave_rewards/core/wallet_provider/connect_external_wallet.h rename to components/brave_rewards/core/internal/wallet_provider/connect_external_wallet.h index be27e229a208..f7c77f2fdd3d 100644 --- a/components/brave_rewards/core/wallet_provider/connect_external_wallet.h +++ b/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_CONNECT_EXTERNAL_WALLET_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_CONNECT_EXTERNAL_WALLET_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_CONNECT_EXTERNAL_WALLET_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_CONNECT_EXTERNAL_WALLET_H_ #include #include "base/containers/flat_map.h" #include "base/memory/raw_ref.h" #include "base/types/expected.h" -#include "brave/components/brave_rewards/core/endpoints/common/post_connect.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_connect.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -66,4 +66,4 @@ class ConnectExternalWallet { } // namespace wallet_provider } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_CONNECT_EXTERNAL_WALLET_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_CONNECT_EXTERNAL_WALLET_H_ diff --git a/components/brave_rewards/core/wallet_provider/connect_external_wallet_unittest.cc b/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet_unittest.cc similarity index 93% rename from components/brave_rewards/core/wallet_provider/connect_external_wallet_unittest.cc rename to components/brave_rewards/core/internal/wallet_provider/connect_external_wallet_unittest.cc index cdb63e4483a1..843b1e1c6559 100644 --- a/components/brave_rewards/core/wallet_provider/connect_external_wallet_unittest.cc +++ b/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet_unittest.cc @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/connect_external_wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet.h" #include #include #include "base/containers/flat_map.h" #include "base/strings/string_number_conversions.h" -#include "brave/components/brave_rewards/core/endpoints/common/post_connect.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/endpoints/common/post_connect.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "testing/gtest/include/gtest/gtest.h" using ::testing::TestParamInfo; @@ -44,14 +44,14 @@ class ConnectTestWallet : public wallet_provider::ConnectExternalWallet { Result post_connect_result_; }; -using ConnectExternalWalletTestParamType = std::tuple< - std::string, // test name suffix - mojom::WalletStatus, // wallet status - std::string, // one time string - base::flat_map, // query parameters - Result, // post connect result - mojom::ConnectExternalWalletResult // expected result ->; +using ConnectExternalWalletTestParamType = + std::tuple, // query parameters + Result, // post connect result + mojom::ConnectExternalWalletResult // expected result + >; class RewardsConnectExternalWalletTest : public RewardsEngineTest, diff --git a/components/brave_rewards/core/wallet_provider/gemini/connect_gemini_wallet.cc b/components/brave_rewards/core/internal/wallet_provider/gemini/connect_gemini_wallet.cc similarity index 87% rename from components/brave_rewards/core/wallet_provider/gemini/connect_gemini_wallet.cc rename to components/brave_rewards/core/internal/wallet_provider/gemini/connect_gemini_wallet.cc index 04223711d3ac..7e9d56270d14 100644 --- a/components/brave_rewards/core/wallet_provider/gemini/connect_gemini_wallet.cc +++ b/components/brave_rewards/core/internal/wallet_provider/gemini/connect_gemini_wallet.cc @@ -3,23 +3,23 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/gemini/connect_gemini_wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/gemini/connect_gemini_wallet.h" #include #include "base/strings/string_number_conversions.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/random_util.h" -#include "brave/components/brave_rewards/core/common/url_helpers.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/endpoint/gemini/gemini_server.h" -#include "brave/components/brave_rewards/core/endpoints/brave/post_connect_gemini.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/gemini/gemini.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/logging/event_log_keys.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/random_util.h" +#include "brave/components/brave_rewards/core/internal/common/url_helpers.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/gemini_server.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_connect_gemini.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/gemini/gemini.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/logging/event_log_keys.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" #include "crypto/sha2.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/wallet_provider/gemini/connect_gemini_wallet.h b/components/brave_rewards/core/internal/wallet_provider/gemini/connect_gemini_wallet.h similarity index 71% rename from components/brave_rewards/core/wallet_provider/gemini/connect_gemini_wallet.h rename to components/brave_rewards/core/internal/wallet_provider/gemini/connect_gemini_wallet.h index 9fef5606902a..6c17575012ff 100644 --- a/components/brave_rewards/core/wallet_provider/gemini/connect_gemini_wallet.h +++ b/components/brave_rewards/core/internal/wallet_provider/gemini/connect_gemini_wallet.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_GEMINI_CONNECT_GEMINI_WALLET_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_GEMINI_CONNECT_GEMINI_WALLET_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_GEMINI_CONNECT_GEMINI_WALLET_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_GEMINI_CONNECT_GEMINI_WALLET_H_ #include #include "base/containers/flat_map.h" -#include "brave/components/brave_rewards/core/endpoint/gemini/gemini_server.h" -#include "brave/components/brave_rewards/core/endpoints/gemini/get_recipient_id_gemini.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" -#include "brave/components/brave_rewards/core/wallet_provider/connect_external_wallet.h" +#include "brave/components/brave_rewards/core/internal/endpoint/gemini/gemini_server.h" +#include "brave/components/brave_rewards/core/internal/endpoints/gemini/get_recipient_id_gemini.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet.h" namespace brave_rewards::internal { class RewardsEngine; @@ -59,4 +59,4 @@ class ConnectGeminiWallet : public wallet_provider::ConnectExternalWallet { } // namespace gemini } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_GEMINI_CONNECT_GEMINI_WALLET_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_GEMINI_CONNECT_GEMINI_WALLET_H_ diff --git a/components/brave_rewards/core/wallet_provider/gemini/connect_gemini_wallet_unittest.cc b/components/brave_rewards/core/internal/wallet_provider/gemini/connect_gemini_wallet_unittest.cc similarity index 81% rename from components/brave_rewards/core/wallet_provider/gemini/connect_gemini_wallet_unittest.cc rename to components/brave_rewards/core/internal/wallet_provider/gemini/connect_gemini_wallet_unittest.cc index 06f7df177557..b3b508bdc9f8 100644 --- a/components/brave_rewards/core/wallet_provider/gemini/connect_gemini_wallet_unittest.cc +++ b/components/brave_rewards/core/internal/wallet_provider/gemini/connect_gemini_wallet_unittest.cc @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/gemini/connect_gemini_wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/gemini/connect_gemini_wallet.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal::gemini { diff --git a/components/brave_rewards/core/wallet_provider/gemini/gemini_transfer.cc b/components/brave_rewards/core/internal/wallet_provider/gemini/gemini_transfer.cc similarity index 85% rename from components/brave_rewards/core/wallet_provider/gemini/gemini_transfer.cc rename to components/brave_rewards/core/internal/wallet_provider/gemini/gemini_transfer.cc index eec1404d3f10..4b4a379239af 100644 --- a/components/brave_rewards/core/wallet_provider/gemini/gemini_transfer.cc +++ b/components/brave_rewards/core/internal/wallet_provider/gemini/gemini_transfer.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/gemini/gemini_transfer.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/gemini/gemini_transfer.h" #include -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/gemini/gemini.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/gemini/gemini.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/wallet_provider/gemini/gemini_transfer.h b/components/brave_rewards/core/internal/wallet_provider/gemini/gemini_transfer.h similarity index 59% rename from components/brave_rewards/core/wallet_provider/gemini/gemini_transfer.h rename to components/brave_rewards/core/internal/wallet_provider/gemini/gemini_transfer.h index 7d9d99ce24a0..72450ec1566e 100644 --- a/components/brave_rewards/core/wallet_provider/gemini/gemini_transfer.h +++ b/components/brave_rewards/core/internal/wallet_provider/gemini/gemini_transfer.h @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_GEMINI_GEMINI_TRANSFER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_GEMINI_GEMINI_TRANSFER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_GEMINI_GEMINI_TRANSFER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_GEMINI_GEMINI_TRANSFER_H_ -#include "brave/components/brave_rewards/core/endpoints/gemini/post_commit_transaction_gemini.h" -#include "brave/components/brave_rewards/core/wallet_provider/transfer.h" +#include "brave/components/brave_rewards/core/internal/endpoints/gemini/post_commit_transaction_gemini.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/transfer.h" namespace brave_rewards::internal::gemini { @@ -26,4 +26,4 @@ class GeminiTransfer final : public wallet_provider::Transfer { } // namespace brave_rewards::internal::gemini -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_GEMINI_GEMINI_TRANSFER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_GEMINI_GEMINI_TRANSFER_H_ diff --git a/components/brave_rewards/core/wallet_provider/linkage_checker.cc b/components/brave_rewards/core/internal/wallet_provider/linkage_checker.cc similarity index 88% rename from components/brave_rewards/core/wallet_provider/linkage_checker.cc rename to components/brave_rewards/core/internal/wallet_provider/linkage_checker.cc index a0170bf143f1..83cef9a740d8 100644 --- a/components/brave_rewards/core/wallet_provider/linkage_checker.cc +++ b/components/brave_rewards/core/internal/wallet_provider/linkage_checker.cc @@ -3,19 +3,19 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/linkage_checker.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/linkage_checker.h" #include #include #include "base/feature_list.h" -#include "brave/components/brave_rewards/common/features.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/notifications/notification_keys.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/wallet/wallet.h" -#include "brave/components/brave_rewards/core/wallet/wallet_util.h" -#include "brave/components/brave_rewards/core/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/features.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/notifications/notification_keys.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_util.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/wallet_provider.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/wallet_provider/linkage_checker.h b/components/brave_rewards/core/internal/wallet_provider/linkage_checker.h similarity index 79% rename from components/brave_rewards/core/wallet_provider/linkage_checker.h rename to components/brave_rewards/core/internal/wallet_provider/linkage_checker.h index e79e8b5409b3..faa702be41fd 100644 --- a/components/brave_rewards/core/wallet_provider/linkage_checker.h +++ b/components/brave_rewards/core/internal/wallet_provider/linkage_checker.h @@ -3,13 +3,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_LINKAGE_CHECKER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_LINKAGE_CHECKER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_LINKAGE_CHECKER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_LINKAGE_CHECKER_H_ #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" -#include "brave/components/brave_rewards/core/endpoints/brave/get_wallet.h" -#include "brave/components/brave_rewards/core/rewards_engine_helper.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/get_wallet.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine_helper.h" namespace brave_rewards::internal { @@ -48,4 +48,4 @@ class LinkageChecker : public RewardsEngineHelper, } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_LINKAGE_CHECKER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_LINKAGE_CHECKER_H_ diff --git a/components/brave_rewards/core/wallet_provider/linkage_checker_unittest.cc b/components/brave_rewards/core/internal/wallet_provider/linkage_checker_unittest.cc similarity index 89% rename from components/brave_rewards/core/wallet_provider/linkage_checker_unittest.cc rename to components/brave_rewards/core/internal/wallet_provider/linkage_checker_unittest.cc index 0f40ddb2fc96..c1ec694809d2 100644 --- a/components/brave_rewards/core/wallet_provider/linkage_checker_unittest.cc +++ b/components/brave_rewards/core/internal/wallet_provider/linkage_checker_unittest.cc @@ -3,13 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/wallet_provider/linkage_checker.h" + #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" -#include "brave/components/brave_rewards/core/wallet_provider/linkage_checker.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/wallet_provider/solana/solana_wallet_provider.cc b/components/brave_rewards/core/internal/wallet_provider/solana/solana_wallet_provider.cc similarity index 88% rename from components/brave_rewards/core/wallet_provider/solana/solana_wallet_provider.cc rename to components/brave_rewards/core/internal/wallet_provider/solana/solana_wallet_provider.cc index b630e23cfca8..9a26f194c794 100644 --- a/components/brave_rewards/core/wallet_provider/solana/solana_wallet_provider.cc +++ b/components/brave_rewards/core/internal/wallet_provider/solana/solana_wallet_provider.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/solana/solana_wallet_provider.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/solana/solana_wallet_provider.h" #include #include @@ -12,15 +12,15 @@ #include "base/base64url.h" #include "base/strings/strcat.h" #include "base/strings/string_util.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/signer.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/logging/event_log_keys.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/wallet/wallet.h" -#include "brave/components/brave_rewards/core/wallet/wallet_util.h" -#include "brave/components/brave_rewards/core/wallet_provider/linkage_checker.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/signer.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/logging/event_log_keys.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_util.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/linkage_checker.h" #include "net/base/url_util.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/wallet_provider/solana/solana_wallet_provider.h b/components/brave_rewards/core/internal/wallet_provider/solana/solana_wallet_provider.h similarity index 74% rename from components/brave_rewards/core/wallet_provider/solana/solana_wallet_provider.h rename to components/brave_rewards/core/internal/wallet_provider/solana/solana_wallet_provider.h index b21baa8a3c8a..3e4621d4f56d 100644 --- a/components/brave_rewards/core/wallet_provider/solana/solana_wallet_provider.h +++ b/components/brave_rewards/core/internal/wallet_provider/solana/solana_wallet_provider.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_SOLANA_SOLANA_WALLET_PROVIDER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_SOLANA_SOLANA_WALLET_PROVIDER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_SOLANA_SOLANA_WALLET_PROVIDER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_SOLANA_SOLANA_WALLET_PROVIDER_H_ #include #include "base/memory/weak_ptr.h" #include "base/timer/timer.h" -#include "brave/components/brave_rewards/core/endpoints/brave/post_challenges.h" -#include "brave/components/brave_rewards/core/rewards_engine_helper.h" -#include "brave/components/brave_rewards/core/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_challenges.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine_helper.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/wallet_provider.h" namespace brave_rewards::internal { @@ -55,4 +55,4 @@ class SolanaWalletProvider : public RewardsEngineHelper, } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_SOLANA_SOLANA_WALLET_PROVIDER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_SOLANA_SOLANA_WALLET_PROVIDER_H_ diff --git a/components/brave_rewards/core/wallet_provider/solana/solana_wallet_provider_unittest.cc b/components/brave_rewards/core/internal/wallet_provider/solana/solana_wallet_provider_unittest.cc similarity index 91% rename from components/brave_rewards/core/wallet_provider/solana/solana_wallet_provider_unittest.cc rename to components/brave_rewards/core/internal/wallet_provider/solana/solana_wallet_provider_unittest.cc index 4d5cfe50b46c..b4ded4ab8205 100644 --- a/components/brave_rewards/core/wallet_provider/solana/solana_wallet_provider_unittest.cc +++ b/components/brave_rewards/core/internal/wallet_provider/solana/solana_wallet_provider_unittest.cc @@ -3,14 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ +#include "brave/components/brave_rewards/core/internal/wallet_provider/solana/solana_wallet_provider.h" + #include #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/state/state_keys.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" -#include "brave/components/brave_rewards/core/wallet_provider/solana/solana_wallet_provider.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/state/state_keys.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" #include "net/http/http_status_code.h" namespace brave_rewards::internal::wallet_provider { diff --git a/components/brave_rewards/core/wallet_provider/transfer.cc b/components/brave_rewards/core/internal/wallet_provider/transfer.cc similarity index 94% rename from components/brave_rewards/core/wallet_provider/transfer.cc rename to components/brave_rewards/core/internal/wallet_provider/transfer.cc index 99d60667af01..a6067f0eaac0 100644 --- a/components/brave_rewards/core/wallet_provider/transfer.cc +++ b/components/brave_rewards/core/internal/wallet_provider/transfer.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/transfer.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/transfer.h" #include #include "base/strings/string_number_conversions.h" #include "base/uuid.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal::wallet_provider { diff --git a/components/brave_rewards/core/wallet_provider/transfer.h b/components/brave_rewards/core/internal/wallet_provider/transfer.h similarity index 83% rename from components/brave_rewards/core/wallet_provider/transfer.h rename to components/brave_rewards/core/internal/wallet_provider/transfer.h index 0e645549c4cb..1e671a668e7b 100644 --- a/components/brave_rewards/core/wallet_provider/transfer.h +++ b/components/brave_rewards/core/internal/wallet_provider/transfer.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_TRANSFER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_TRANSFER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_TRANSFER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_TRANSFER_H_ #include #include "base/memory/raw_ref.h" #include "base/types/expected.h" -#include "brave/components/brave_rewards/core/database/database_external_transactions.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/database/database_external_transactions.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" namespace brave_rewards::internal { class RewardsEngine; @@ -67,4 +67,4 @@ class Transfer { } // namespace wallet_provider } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_TRANSFER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_TRANSFER_H_ diff --git a/components/brave_rewards/core/wallet_provider/uphold/connect_uphold_wallet.cc b/components/brave_rewards/core/internal/wallet_provider/uphold/connect_uphold_wallet.cc similarity index 91% rename from components/brave_rewards/core/wallet_provider/uphold/connect_uphold_wallet.cc rename to components/brave_rewards/core/internal/wallet_provider/uphold/connect_uphold_wallet.cc index 5a0fb60af3c0..30058f68c441 100644 --- a/components/brave_rewards/core/wallet_provider/uphold/connect_uphold_wallet.cc +++ b/components/brave_rewards/core/internal/wallet_provider/uphold/connect_uphold_wallet.cc @@ -3,21 +3,21 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/uphold/connect_uphold_wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/uphold/connect_uphold_wallet.h" #include #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/random_util.h" -#include "brave/components/brave_rewards/core/common/url_helpers.h" -#include "brave/components/brave_rewards/core/endpoints/brave/post_connect_uphold.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/logging/event_log_keys.h" -#include "brave/components/brave_rewards/core/notifications/notification_keys.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/uphold/uphold.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/random_util.h" +#include "brave/components/brave_rewards/core/internal/common/url_helpers.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_connect_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/logging/event_log_keys.h" +#include "brave/components/brave_rewards/core/internal/notifications/notification_keys.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/wallet_provider/uphold/connect_uphold_wallet.h b/components/brave_rewards/core/internal/wallet_provider/uphold/connect_uphold_wallet.h similarity index 65% rename from components/brave_rewards/core/wallet_provider/uphold/connect_uphold_wallet.h rename to components/brave_rewards/core/internal/wallet_provider/uphold/connect_uphold_wallet.h index f0cab4d30138..c2cdd42035b4 100644 --- a/components/brave_rewards/core/wallet_provider/uphold/connect_uphold_wallet.h +++ b/components/brave_rewards/core/internal/wallet_provider/uphold/connect_uphold_wallet.h @@ -3,18 +3,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_UPHOLD_CONNECT_UPHOLD_WALLET_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_UPHOLD_CONNECT_UPHOLD_WALLET_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_UPHOLD_CONNECT_UPHOLD_WALLET_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_UPHOLD_CONNECT_UPHOLD_WALLET_H_ #include -#include "brave/components/brave_rewards/core/endpoint/uphold/uphold_server.h" -#include "brave/components/brave_rewards/core/endpoints/uphold/post_oauth_uphold.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" -#include "brave/components/brave_rewards/core/uphold/uphold_capabilities.h" -#include "brave/components/brave_rewards/core/uphold/uphold_card.h" -#include "brave/components/brave_rewards/core/uphold/uphold_user.h" -#include "brave/components/brave_rewards/core/wallet_provider/connect_external_wallet.h" +#include "brave/components/brave_rewards/core/internal/endpoint/uphold/uphold_server.h" +#include "brave/components/brave_rewards/core/internal/endpoints/uphold/post_oauth_uphold.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold_capabilities.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold_card.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold_user.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet.h" namespace brave_rewards::internal::uphold { @@ -63,4 +63,4 @@ class ConnectUpholdWallet : public wallet_provider::ConnectExternalWallet { } // namespace brave_rewards::internal::uphold -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_UPHOLD_CONNECT_UPHOLD_WALLET_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_UPHOLD_CONNECT_UPHOLD_WALLET_H_ diff --git a/components/brave_rewards/core/wallet_provider/uphold/connect_uphold_wallet_unittest.cc b/components/brave_rewards/core/internal/wallet_provider/uphold/connect_uphold_wallet_unittest.cc similarity index 80% rename from components/brave_rewards/core/wallet_provider/uphold/connect_uphold_wallet_unittest.cc rename to components/brave_rewards/core/internal/wallet_provider/uphold/connect_uphold_wallet_unittest.cc index 6805efc616f8..7adde363cb6b 100644 --- a/components/brave_rewards/core/wallet_provider/uphold/connect_uphold_wallet_unittest.cc +++ b/components/brave_rewards/core/internal/wallet_provider/uphold/connect_uphold_wallet_unittest.cc @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/uphold/connect_uphold_wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/uphold/connect_uphold_wallet.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal::uphold { diff --git a/components/brave_rewards/core/wallet_provider/uphold/uphold_transfer.cc b/components/brave_rewards/core/internal/wallet_provider/uphold/uphold_transfer.cc similarity index 92% rename from components/brave_rewards/core/wallet_provider/uphold/uphold_transfer.cc rename to components/brave_rewards/core/internal/wallet_provider/uphold/uphold_transfer.cc index 69625ee40f47..7b0a4078e2c3 100644 --- a/components/brave_rewards/core/wallet_provider/uphold/uphold_transfer.cc +++ b/components/brave_rewards/core/internal/wallet_provider/uphold/uphold_transfer.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/uphold/uphold_transfer.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/uphold/uphold_transfer.h" #include -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/uphold/uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/uphold/uphold.h" namespace brave_rewards::internal { diff --git a/components/brave_rewards/core/wallet_provider/uphold/uphold_transfer.h b/components/brave_rewards/core/internal/wallet_provider/uphold/uphold_transfer.h similarity index 63% rename from components/brave_rewards/core/wallet_provider/uphold/uphold_transfer.h rename to components/brave_rewards/core/internal/wallet_provider/uphold/uphold_transfer.h index 7f91b010b667..f38941601b07 100644 --- a/components/brave_rewards/core/wallet_provider/uphold/uphold_transfer.h +++ b/components/brave_rewards/core/internal/wallet_provider/uphold/uphold_transfer.h @@ -3,15 +3,15 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_UPHOLD_UPHOLD_TRANSFER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_UPHOLD_UPHOLD_TRANSFER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_UPHOLD_UPHOLD_TRANSFER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_UPHOLD_UPHOLD_TRANSFER_H_ #include -#include "brave/components/brave_rewards/core/endpoints/uphold/get_transaction_status_uphold.h" -#include "brave/components/brave_rewards/core/endpoints/uphold/post_commit_transaction_uphold.h" -#include "brave/components/brave_rewards/core/endpoints/uphold/post_create_transaction_uphold.h" -#include "brave/components/brave_rewards/core/wallet_provider/transfer.h" +#include "brave/components/brave_rewards/core/internal/endpoints/uphold/get_transaction_status_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/uphold/post_commit_transaction_uphold.h" +#include "brave/components/brave_rewards/core/internal/endpoints/uphold/post_create_transaction_uphold.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/transfer.h" namespace brave_rewards::internal::uphold { @@ -43,4 +43,4 @@ class UpholdTransfer final : public wallet_provider::Transfer { } // namespace brave_rewards::internal::uphold -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_UPHOLD_UPHOLD_TRANSFER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_UPHOLD_UPHOLD_TRANSFER_H_ diff --git a/components/brave_rewards/core/wallet_provider/wallet_provider.cc b/components/brave_rewards/core/internal/wallet_provider/wallet_provider.cc similarity index 95% rename from components/brave_rewards/core/wallet_provider/wallet_provider.cc rename to components/brave_rewards/core/internal/wallet_provider/wallet_provider.cc index 3601366d6913..432adca18435 100644 --- a/components/brave_rewards/core/wallet_provider/wallet_provider.cc +++ b/components/brave_rewards/core/internal/wallet_provider/wallet_provider.cc @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/wallet_provider.h" #include -#include "brave/components/brave_rewards/core/common/time_util.h" -#include "brave/components/brave_rewards/core/database/database.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet/wallet_util.h" +#include "brave/components/brave_rewards/core/internal/common/time_util.h" +#include "brave/components/brave_rewards/core/internal/database/database.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet/wallet_util.h" namespace brave_rewards::internal::wallet_provider { diff --git a/components/brave_rewards/core/wallet_provider/wallet_provider.h b/components/brave_rewards/core/internal/wallet_provider/wallet_provider.h similarity index 85% rename from components/brave_rewards/core/wallet_provider/wallet_provider.h rename to components/brave_rewards/core/internal/wallet_provider/wallet_provider.h index f2776605cd7d..8676c6048e9f 100644 --- a/components/brave_rewards/core/wallet_provider/wallet_provider.h +++ b/components/brave_rewards/core/internal/wallet_provider/wallet_provider.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_WALLET_PROVIDER_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_WALLET_PROVIDER_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_WALLET_PROVIDER_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_WALLET_PROVIDER_H_ #include #include @@ -16,9 +16,9 @@ #include "base/memory/raw_ref.h" #include "base/time/time.h" #include "base/timer/timer.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" -#include "brave/components/brave_rewards/core/wallet_provider/connect_external_wallet.h" -#include "brave/components/brave_rewards/core/wallet_provider/transfer.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/transfer.h" namespace brave_rewards::internal { class RewardsEngine; @@ -104,4 +104,4 @@ class WalletProvider { } // namespace wallet_provider } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_WALLET_PROVIDER_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_WALLET_PROVIDER_H_ diff --git a/components/brave_rewards/core/wallet_provider/zebpay/connect_zebpay_wallet.cc b/components/brave_rewards/core/internal/wallet_provider/zebpay/connect_zebpay_wallet.cc similarity index 82% rename from components/brave_rewards/core/wallet_provider/zebpay/connect_zebpay_wallet.cc rename to components/brave_rewards/core/internal/wallet_provider/zebpay/connect_zebpay_wallet.cc index 7006e80dbbb0..885741589e4b 100644 --- a/components/brave_rewards/core/wallet_provider/zebpay/connect_zebpay_wallet.cc +++ b/components/brave_rewards/core/internal/wallet_provider/zebpay/connect_zebpay_wallet.cc @@ -3,18 +3,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/zebpay/connect_zebpay_wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/zebpay/connect_zebpay_wallet.h" #include #include -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/common/url_helpers.h" -#include "brave/components/brave_rewards/core/endpoints/brave/post_connect_zebpay.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/zebpay/zebpay.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/common/url_helpers.h" +#include "brave/components/brave_rewards/core/internal/endpoints/brave/post_connect_zebpay.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/zebpay/zebpay.h" using brave_rewards::internal::endpoints::PostConnectZebPay; using brave_rewards::internal::endpoints::PostOAuthZebPay; diff --git a/components/brave_rewards/core/wallet_provider/zebpay/connect_zebpay_wallet.h b/components/brave_rewards/core/internal/wallet_provider/zebpay/connect_zebpay_wallet.h similarity index 61% rename from components/brave_rewards/core/wallet_provider/zebpay/connect_zebpay_wallet.h rename to components/brave_rewards/core/internal/wallet_provider/zebpay/connect_zebpay_wallet.h index 805d7da2c677..c86a9c0c1c1e 100644 --- a/components/brave_rewards/core/wallet_provider/zebpay/connect_zebpay_wallet.h +++ b/components/brave_rewards/core/internal/wallet_provider/zebpay/connect_zebpay_wallet.h @@ -3,14 +3,14 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_ZEBPAY_CONNECT_ZEBPAY_WALLET_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_ZEBPAY_CONNECT_ZEBPAY_WALLET_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_ZEBPAY_CONNECT_ZEBPAY_WALLET_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_ZEBPAY_CONNECT_ZEBPAY_WALLET_H_ #include -#include "brave/components/brave_rewards/core/endpoints/zebpay/post_oauth_zebpay.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" -#include "brave/components/brave_rewards/core/wallet_provider/connect_external_wallet.h" +#include "brave/components/brave_rewards/core/internal/endpoints/zebpay/post_oauth_zebpay.h" +#include "brave/components/brave_rewards/core/internal/rewards_callbacks.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/connect_external_wallet.h" namespace brave_rewards::internal { class RewardsEngine; @@ -37,4 +37,4 @@ class ConnectZebPayWallet : public wallet_provider::ConnectExternalWallet { } // namespace zebpay } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_WALLET_PROVIDER_ZEBPAY_CONNECT_ZEBPAY_WALLET_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_WALLET_PROVIDER_ZEBPAY_CONNECT_ZEBPAY_WALLET_H_ diff --git a/components/brave_rewards/core/wallet_provider/zebpay/connect_zebpay_wallet_unittest.cc b/components/brave_rewards/core/internal/wallet_provider/zebpay/connect_zebpay_wallet_unittest.cc similarity index 81% rename from components/brave_rewards/core/wallet_provider/zebpay/connect_zebpay_wallet_unittest.cc rename to components/brave_rewards/core/internal/wallet_provider/zebpay/connect_zebpay_wallet_unittest.cc index 65ad5d576dd8..70ce9f23a1ad 100644 --- a/components/brave_rewards/core/wallet_provider/zebpay/connect_zebpay_wallet_unittest.cc +++ b/components/brave_rewards/core/internal/wallet_provider/zebpay/connect_zebpay_wallet_unittest.cc @@ -3,11 +3,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/wallet_provider/zebpay/connect_zebpay_wallet.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/zebpay/connect_zebpay_wallet.h" #include "base/strings/strcat.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/test/rewards_engine_test.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/test/rewards_engine_test.h" namespace brave_rewards::internal::zebpay { diff --git a/components/brave_rewards/core/zebpay/zebpay.cc b/components/brave_rewards/core/internal/zebpay/zebpay.cc similarity index 80% rename from components/brave_rewards/core/zebpay/zebpay.cc rename to components/brave_rewards/core/internal/zebpay/zebpay.cc index 30161cfe6231..98df0f7cd2a3 100644 --- a/components/brave_rewards/core/zebpay/zebpay.cc +++ b/components/brave_rewards/core/internal/zebpay/zebpay.cc @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/core/zebpay/zebpay.h" +#include "brave/components/brave_rewards/core/internal/zebpay/zebpay.h" #include #include -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/common/environment_config.h" -#include "brave/components/brave_rewards/core/endpoints/request_for.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" -#include "brave/components/brave_rewards/core/wallet_provider/zebpay/connect_zebpay_wallet.h" +#include "brave/components/brave_rewards/core/internal/common/environment_config.h" +#include "brave/components/brave_rewards/core/internal/endpoints/request_for.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/zebpay/connect_zebpay_wallet.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" using brave_rewards::internal::endpoints::GetBalanceZebPay; using brave_rewards::internal::endpoints::RequestFor; diff --git a/components/brave_rewards/core/zebpay/zebpay.h b/components/brave_rewards/core/internal/zebpay/zebpay.h similarity index 70% rename from components/brave_rewards/core/zebpay/zebpay.h rename to components/brave_rewards/core/internal/zebpay/zebpay.h index e8b0d550c15a..c3fab5782c85 100644 --- a/components/brave_rewards/core/zebpay/zebpay.h +++ b/components/brave_rewards/core/internal/zebpay/zebpay.h @@ -3,16 +3,16 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ZEBPAY_ZEBPAY_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ZEBPAY_ZEBPAY_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ZEBPAY_ZEBPAY_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ZEBPAY_ZEBPAY_H_ #include #include "base/functional/callback_forward.h" #include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/core/endpoints/zebpay/get_balance_zebpay.h" -#include "brave/components/brave_rewards/core/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/internal/endpoints/zebpay/get_balance_zebpay.h" +#include "brave/components/brave_rewards/core/internal/wallet_provider/wallet_provider.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" namespace brave_rewards::internal { class RewardsEngine; @@ -42,4 +42,4 @@ class ZebPay final : public wallet_provider::WalletProvider { } // namespace zebpay } // namespace brave_rewards::internal -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_ZEBPAY_ZEBPAY_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_INTERNAL_ZEBPAY_ZEBPAY_H_ diff --git a/components/brave_rewards/common/mojom/BUILD.gn b/components/brave_rewards/core/mojom/BUILD.gn similarity index 100% rename from components/brave_rewards/common/mojom/BUILD.gn rename to components/brave_rewards/core/mojom/BUILD.gn diff --git a/components/brave_rewards/common/mojom/rewards.mojom b/components/brave_rewards/core/mojom/rewards.mojom similarity index 100% rename from components/brave_rewards/common/mojom/rewards.mojom rename to components/brave_rewards/core/mojom/rewards.mojom diff --git a/components/brave_rewards/common/mojom/rewards_core.mojom b/components/brave_rewards/core/mojom/rewards_core.mojom similarity index 98% rename from components/brave_rewards/common/mojom/rewards_core.mojom rename to components/brave_rewards/core/mojom/rewards_core.mojom index 2a6b86a68ee9..a6601cafadd3 100644 --- a/components/brave_rewards/common/mojom/rewards_core.mojom +++ b/components/brave_rewards/core/mojom/rewards_core.mojom @@ -5,7 +5,7 @@ module brave_rewards.mojom; -import "brave/components/brave_rewards/common/mojom/rewards.mojom"; +import "brave/components/brave_rewards/core/mojom/rewards.mojom"; // The following definitions are used internally by `brave_rewards/core`. diff --git a/components/brave_rewards/common/mojom/rewards_database.mojom b/components/brave_rewards/core/mojom/rewards_database.mojom similarity index 100% rename from components/brave_rewards/common/mojom/rewards_database.mojom rename to components/brave_rewards/core/mojom/rewards_database.mojom diff --git a/components/brave_rewards/common/mojom/rewards_engine.mojom b/components/brave_rewards/core/mojom/rewards_engine.mojom similarity index 97% rename from components/brave_rewards/common/mojom/rewards_engine.mojom rename to components/brave_rewards/core/mojom/rewards_engine.mojom index ce515e7d6fd7..b760c58783b1 100644 --- a/components/brave_rewards/common/mojom/rewards_engine.mojom +++ b/components/brave_rewards/core/mojom/rewards_engine.mojom @@ -4,8 +4,8 @@ // You can obtain one at https://mozilla.org/MPL/2.0/. module brave_rewards.mojom; -import "brave/components/brave_rewards/common/mojom/rewards.mojom"; -import "brave/components/brave_rewards/common/mojom/rewards_database.mojom"; +import "brave/components/brave_rewards/core/mojom/rewards.mojom"; +import "brave/components/brave_rewards/core/mojom/rewards_database.mojom"; import "mojo/public/mojom/base/time.mojom"; import "mojo/public/mojom/base/values.mojom"; diff --git a/components/brave_rewards/common/mojom/rewards_page.mojom b/components/brave_rewards/core/mojom/rewards_page.mojom similarity index 99% rename from components/brave_rewards/common/mojom/rewards_page.mojom rename to components/brave_rewards/core/mojom/rewards_page.mojom index a679496dcbaa..9e247aa3b0e9 100644 --- a/components/brave_rewards/common/mojom/rewards_page.mojom +++ b/components/brave_rewards/core/mojom/rewards_page.mojom @@ -6,7 +6,7 @@ module brave_rewards.mojom; import "brave/components/brave_ads/core/mojom/brave_ads.mojom"; -import "brave/components/brave_rewards/common/mojom/rewards.mojom"; +import "brave/components/brave_rewards/core/mojom/rewards.mojom"; import "mojo/public/mojom/base/time.mojom"; // Initializes messaging between the browser and the page. diff --git a/components/brave_rewards/common/mojom/rewards_panel.mojom b/components/brave_rewards/core/mojom/rewards_panel.mojom similarity index 100% rename from components/brave_rewards/common/mojom/rewards_panel.mojom rename to components/brave_rewards/core/mojom/rewards_panel.mojom diff --git a/components/brave_rewards/common/mojom/rewards_tip_panel.mojom b/components/brave_rewards/core/mojom/rewards_tip_panel.mojom similarity index 96% rename from components/brave_rewards/common/mojom/rewards_tip_panel.mojom rename to components/brave_rewards/core/mojom/rewards_tip_panel.mojom index f6704489f20e..ae1770011b30 100644 --- a/components/brave_rewards/common/mojom/rewards_tip_panel.mojom +++ b/components/brave_rewards/core/mojom/rewards_tip_panel.mojom @@ -5,7 +5,7 @@ module brave_rewards.mojom; -import "brave/components/brave_rewards/common/mojom/rewards.mojom"; +import "brave/components/brave_rewards/core/mojom/rewards.mojom"; // Used by the WebUI page to bootstrap bidirectional communication. interface TipPanelHandlerFactory { diff --git a/components/brave_rewards/common/pref_names.h b/components/brave_rewards/core/pref_names.h similarity index 96% rename from components/brave_rewards/common/pref_names.h rename to components/brave_rewards/core/pref_names.h index fdedb85b56df..f63e4feac945 100644 --- a/components/brave_rewards/common/pref_names.h +++ b/components/brave_rewards/core/pref_names.h @@ -1,10 +1,10 @@ /* 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/. */ + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_PREF_NAMES_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_PREF_NAMES_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PREF_NAMES_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PREF_NAMES_H_ namespace brave_rewards::prefs { @@ -122,4 +122,4 @@ inline constexpr char kAdsEnabledTimestamp[] = } // namespace brave_rewards::prefs -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_PREF_NAMES_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PREF_NAMES_H_ diff --git a/components/brave_rewards/common/pref_registry.cc b/components/brave_rewards/core/pref_registry.cc similarity index 97% rename from components/brave_rewards/common/pref_registry.cc rename to components/brave_rewards/core/pref_registry.cc index baf17770ab95..d5918393227f 100644 --- a/components/brave_rewards/common/pref_registry.cc +++ b/components/brave_rewards/core/pref_registry.cc @@ -3,9 +3,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/common/pref_registry.h" +#include "brave/components/brave_rewards/core/pref_registry.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "components/prefs/pref_registry_simple.h" namespace brave_rewards { diff --git a/components/brave_rewards/common/pref_registry.h b/components/brave_rewards/core/pref_registry.h similarity index 71% rename from components/brave_rewards/common/pref_registry.h rename to components/brave_rewards/core/pref_registry.h index b8e8e44851d6..d769ef5161b4 100644 --- a/components/brave_rewards/common/pref_registry.h +++ b/components/brave_rewards/core/pref_registry.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_PREF_REGISTRY_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_PREF_REGISTRY_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PREF_REGISTRY_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PREF_REGISTRY_H_ class PrefRegistrySimple; @@ -15,4 +15,4 @@ void RegisterProfilePrefsForMigration(PrefRegistrySimple* registry); } // namespace brave_rewards -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_PREF_REGISTRY_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PREF_REGISTRY_H_ diff --git a/components/brave_rewards/common/publisher_utils.cc b/components/brave_rewards/core/publisher_utils.cc similarity index 96% rename from components/brave_rewards/common/publisher_utils.cc rename to components/brave_rewards/core/publisher_utils.cc index 6293883ccbe2..106fff53ecb1 100644 --- a/components/brave_rewards/common/publisher_utils.cc +++ b/components/brave_rewards/core/publisher_utils.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/common/publisher_utils.h" +#include "brave/components/brave_rewards/core/publisher_utils.h" #include #include diff --git a/components/brave_rewards/common/publisher_utils.h b/components/brave_rewards/core/publisher_utils.h similarity index 87% rename from components/brave_rewards/common/publisher_utils.h rename to components/brave_rewards/core/publisher_utils.h index f55b6d8e6a70..71aee58c708a 100644 --- a/components/brave_rewards/common/publisher_utils.h +++ b/components/brave_rewards/core/publisher_utils.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_PUBLISHER_UTILS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_PUBLISHER_UTILS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_UTILS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_UTILS_H_ #include #include @@ -34,4 +34,4 @@ std::optional GetPublisherDomainFromURL(const GURL& url); } // namespace brave_rewards -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_PUBLISHER_UTILS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_PUBLISHER_UTILS_H_ diff --git a/components/brave_rewards/common/publisher_utils_unittest.cc b/components/brave_rewards/core/publisher_utils_unittest.cc similarity index 98% rename from components/brave_rewards/common/publisher_utils_unittest.cc rename to components/brave_rewards/core/publisher_utils_unittest.cc index f20568907499..68288fe5fe2e 100644 --- a/components/brave_rewards/common/publisher_utils_unittest.cc +++ b/components/brave_rewards/core/publisher_utils_unittest.cc @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -#include "brave/components/brave_rewards/common/publisher_utils.h" +#include "brave/components/brave_rewards/core/publisher_utils.h" #include #include diff --git a/components/brave_rewards/common/rewards_flags.cc b/components/brave_rewards/core/rewards_flags.cc similarity index 96% rename from components/brave_rewards/common/rewards_flags.cc rename to components/brave_rewards/core/rewards_flags.cc index 36cfa88ba8e4..6ba82e624399 100644 --- a/components/brave_rewards/common/rewards_flags.cc +++ b/components/brave_rewards/core/rewards_flags.cc @@ -1,9 +1,9 @@ /* 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/. */ -#include "brave/components/brave_rewards/common/rewards_flags.h" +#include "brave/components/brave_rewards/core/rewards_flags.h" #include #include diff --git a/components/brave_rewards/common/rewards_flags.h b/components/brave_rewards/core/rewards_flags.h similarity index 75% rename from components/brave_rewards/common/rewards_flags.h rename to components/brave_rewards/core/rewards_flags.h index f239e10ffdc4..e0488385683f 100644 --- a/components/brave_rewards/common/rewards_flags.h +++ b/components/brave_rewards/core/rewards_flags.h @@ -1,15 +1,14 @@ /* 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/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_REWARDS_FLAGS_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_REWARDS_FLAGS_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_FLAGS_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_FLAGS_H_ #include #include - namespace brave_rewards { struct RewardsFlags { @@ -30,4 +29,4 @@ struct RewardsFlags { } // namespace brave_rewards -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_REWARDS_FLAGS_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_FLAGS_H_ diff --git a/components/brave_rewards/common/rewards_util.cc b/components/brave_rewards/core/rewards_util.cc similarity index 89% rename from components/brave_rewards/common/rewards_util.cc rename to components/brave_rewards/core/rewards_util.cc index 45a00babd72e..36957ec5431d 100644 --- a/components/brave_rewards/common/rewards_util.cc +++ b/components/brave_rewards/core/rewards_util.cc @@ -1,9 +1,9 @@ /* 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/. */ -#include "brave/components/brave_rewards/common/rewards_util.h" +#include "brave/components/brave_rewards/core/rewards_util.h" #include @@ -15,11 +15,11 @@ #if BUILDFLAG(IS_ANDROID) #include "base/feature_list.h" -#include "brave/components/brave_rewards/common/features.h" +#include "brave/components/brave_rewards/core/features.h" #endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/core/pref_names.h" #endif // BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) namespace brave_rewards { diff --git a/components/brave_rewards/common/rewards_util.h b/components/brave_rewards/core/rewards_util.h similarity index 72% rename from components/brave_rewards/common/rewards_util.h rename to components/brave_rewards/core/rewards_util.h index fdacb7200ed9..f58f07a03c50 100644 --- a/components/brave_rewards/common/rewards_util.h +++ b/components/brave_rewards/core/rewards_util.h @@ -1,10 +1,10 @@ /* 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/. */ -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_REWARDS_UTIL_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_REWARDS_UTIL_H_ +#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_UTIL_H_ +#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_UTIL_H_ #include @@ -28,4 +28,4 @@ bool IsAutoContributeSupportedForCountry(std::string_view country_code); } // namespace brave_rewards -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_COMMON_REWARDS_UTIL_H_ +#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_REWARDS_UTIL_H_ diff --git a/components/brave_rewards/core/state/state_migration.h b/components/brave_rewards/core/state/state_migration.h deleted file mode 100644 index 1c99018fcc08..000000000000 --- a/components/brave_rewards/core/state/state_migration.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (c) 2020 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 https://mozilla.org/MPL/2.0/. */ - -#ifndef BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_H_ -#define BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_H_ - -#include "base/memory/raw_ref.h" -#include "brave/components/brave_rewards/core/rewards_callbacks.h" -#include "brave/components/brave_rewards/core/state/state_migration_v1.h" -#include "brave/components/brave_rewards/core/state/state_migration_v10.h" -#include "brave/components/brave_rewards/core/state/state_migration_v11.h" -#include "brave/components/brave_rewards/core/state/state_migration_v12.h" -#include "brave/components/brave_rewards/core/state/state_migration_v13.h" -#include "brave/components/brave_rewards/core/state/state_migration_v14.h" -#include "brave/components/brave_rewards/core/state/state_migration_v2.h" -#include "brave/components/brave_rewards/core/state/state_migration_v3.h" -#include "brave/components/brave_rewards/core/state/state_migration_v4.h" -#include "brave/components/brave_rewards/core/state/state_migration_v5.h" -#include "brave/components/brave_rewards/core/state/state_migration_v6.h" -#include "brave/components/brave_rewards/core/state/state_migration_v7.h" -#include "brave/components/brave_rewards/core/state/state_migration_v8.h" -#include "brave/components/brave_rewards/core/state/state_migration_v9.h" - -namespace brave_rewards::internal { -class RewardsEngine; - -namespace state { - -class StateMigration { - public: - explicit StateMigration(RewardsEngine& engine); - ~StateMigration(); - - void Start(ResultCallback callback); - - void Migrate(ResultCallback callback); - - private: - void FreshInstall(ResultCallback callback); - - void OnMigration(ResultCallback callback, int version, mojom::Result result); - - const raw_ref engine_; - StateMigrationV1 v1_; - StateMigrationV2 v2_; - StateMigrationV3 v3_; - StateMigrationV4 v4_; - StateMigrationV5 v5_; - StateMigrationV6 v6_; - StateMigrationV7 v7_; - StateMigrationV8 v8_; - StateMigrationV9 v9_; - StateMigrationV10 v10_; - StateMigrationV11 v11_; - StateMigrationV12 v12_; - StateMigrationV13 v13_; - StateMigrationV14 v14_; -}; - -} // namespace state -} // namespace brave_rewards::internal - -#endif // BRAVE_COMPONENTS_BRAVE_REWARDS_CORE_STATE_STATE_MIGRATION_H_ diff --git a/components/brave_rewards/core/test/BUILD.gn b/components/brave_rewards/core/test/BUILD.gn deleted file mode 100644 index 70d5b07bcf3e..000000000000 --- a/components/brave_rewards/core/test/BUILD.gn +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright (c) 2021 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 https://mozilla.org/MPL/2.0/. */ - -import("//brave/build/config.gni") -import("//build/config/sanitizers/sanitizers.gni") -import("//testing/test.gni") - -source_set("test") { - testonly = true - - sources = [ - "//brave/components/brave_rewards/core/common/brotli_util_unittest.cc", - "//brave/components/brave_rewards/core/common/request_signer_unittest.cc", - "//brave/components/brave_rewards/core/common/signer_unittest.cc", - "//brave/components/brave_rewards/core/common/url_loader_unittest.cc", - "//brave/components/brave_rewards/core/contribution/contribution_util_unittest.cc", - "//brave/components/brave_rewards/core/credentials/credentials_util_unittest.cc", - "//brave/components/brave_rewards/core/database/database_migration_unittest.cc", - "//brave/components/brave_rewards/core/database/database_mock.cc", - "//brave/components/brave_rewards/core/database/database_mock.h", - "//brave/components/brave_rewards/core/database/database_publisher_prefix_list_unittest.cc", - "//brave/components/brave_rewards/core/database/database_util_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/bitflyer/get_balance/get_balance_bitflyer_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/bitflyer/post_oauth/post_oauth_bitflyer_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/gemini/post_account/post_account_gemini_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/gemini/post_balance/post_balance_gemini_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/gemini/post_oauth/post_oauth_gemini_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/gemini/post_recipient_id/post_recipient_id_gemini_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/payment/get_credentials/get_credentials_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/payment/post_credentials/post_credentials_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/payment/post_order/post_order_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/payment/post_transaction_gemini/post_transaction_sku_gemini_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/payment/post_transaction_uphold/post_transaction_uphold_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/payment/post_votes/post_votes_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/private_cdn/get_publisher/get_publisher_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/rewards/get_prefix_list/get_prefix_list_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/uphold/get_capabilities/get_capabilities_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/uphold/get_card/get_card_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/uphold/get_cards/get_cards_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/uphold/get_me/get_me_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/uphold/patch_card/patch_card_unittest.cc", - "//brave/components/brave_rewards/core/endpoint/uphold/post_cards/post_cards_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/bitflyer/post_commit_transaction_bitflyer_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/brave/get_parameters_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/brave/get_wallet_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/brave/patch_wallets_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/brave/post_challenges_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/brave/post_wallets_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/common/post_connect_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/gemini/get_recipient_id_gemini_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/gemini/post_commit_transaction_gemini_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/uphold/get_transaction_status_uphold_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/uphold/post_commit_transaction_uphold_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/uphold/post_create_transaction_uphold_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/uphold/post_oauth_uphold_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/zebpay/get_balance_zebpay_unittest.cc", - "//brave/components/brave_rewards/core/endpoints/zebpay/post_oauth_zebpay_unittest.cc", - "//brave/components/brave_rewards/core/legacy/bat_util_unittest.cc", - "//brave/components/brave_rewards/core/legacy/client_state_unittest.cc", - "//brave/components/brave_rewards/core/legacy/publisher_settings_state_unittest.cc", - "//brave/components/brave_rewards/core/legacy/report_balance_state_unittest.cc", - "//brave/components/brave_rewards/core/legacy/wallet_info_state_unittest.cc", - "//brave/components/brave_rewards/core/parameters/rewards_parameters_provider_unittest.cc", - "//brave/components/brave_rewards/core/publisher/media/helper_unittest.cc", - "//brave/components/brave_rewards/core/publisher/media/youtube_unittest.cc", - "//brave/components/brave_rewards/core/publisher/prefix_list_reader_unittest.cc", - "//brave/components/brave_rewards/core/publisher/publisher_unittest.cc", - "//brave/components/brave_rewards/core/test/rewards_engine_test.cc", - "//brave/components/brave_rewards/core/test/rewards_engine_test.h", - "//brave/components/brave_rewards/core/test/test_rewards_engine_client.cc", - "//brave/components/brave_rewards/core/test/test_rewards_engine_client.h", - "//brave/components/brave_rewards/core/test/test_rewards_engine_client_unittest.cc", - "//brave/components/brave_rewards/core/wallet/wallet_unittest.cc", - "//brave/components/brave_rewards/core/wallet/wallet_utils_unittest.cc", - "//brave/components/brave_rewards/core/wallet_provider/bitflyer/connect_bitflyer_wallet_unittest.cc", - "//brave/components/brave_rewards/core/wallet_provider/connect_external_wallet_unittest.cc", - "//brave/components/brave_rewards/core/wallet_provider/gemini/connect_gemini_wallet_unittest.cc", - "//brave/components/brave_rewards/core/wallet_provider/linkage_checker_unittest.cc", - "//brave/components/brave_rewards/core/wallet_provider/solana/solana_wallet_provider_unittest.cc", - "//brave/components/brave_rewards/core/wallet_provider/uphold/connect_uphold_wallet_unittest.cc", - "//brave/components/brave_rewards/core/wallet_provider/zebpay/connect_zebpay_wallet_unittest.cc", - ] - - deps = [ - "//base/test:test_support", - "//brave/components/brave_rewards/common/mojom:core", - "//brave/components/brave_rewards/core", - "//brave/components/brave_rewards/core:publishers_proto", - "//brave/components/challenge_bypass_ristretto", - "//brave/third_party/rapidjson", - "//net:net", - "//sql:sql", - "//url:url", - ] - - data = [ "data/" ] -} diff --git a/components/brave_rewards/resources/internals/BUILD.gn b/components/brave_rewards/resources/internals/BUILD.gn index dda1483a9643..834471eed754 100644 --- a/components/brave_rewards/resources/internals/BUILD.gn +++ b/components/brave_rewards/resources/internals/BUILD.gn @@ -11,7 +11,7 @@ transpile_web_ui("internals") { rebase_path("brave_rewards_internals.tsx"), ] ] - deps = [ "//brave/components/brave_rewards/common/mojom:mojom_js" ] + deps = [ "//brave/components/brave_rewards/core/mojom:mojom_js" ] resource_name = "brave_rewards_internals" diff --git a/components/brave_rewards/resources/page/BUILD.gn b/components/brave_rewards/resources/page/BUILD.gn index a99e99d7ce12..6cc30f6d49c9 100644 --- a/components/brave_rewards/resources/page/BUILD.gn +++ b/components/brave_rewards/resources/page/BUILD.gn @@ -12,7 +12,7 @@ transpile_web_ui("page") { rebase_path("brave_rewards_page.tsx"), ] ] - deps = [ "//brave/components/brave_rewards/common/mojom:mojom_js" ] + deps = [ "//brave/components/brave_rewards/core/mojom:mojom_js" ] # what is the directory / pack name resource_name = "brave_rewards_page" diff --git a/components/brave_rewards/resources/page/lib/types.ts b/components/brave_rewards/resources/page/lib/types.ts index 1d128b85c85d..e1b53f410d24 100644 --- a/components/brave_rewards/resources/page/lib/types.ts +++ b/components/brave_rewards/resources/page/lib/types.ts @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -import { ConnectExternalWalletResult, WalletStatus } from 'gen/brave/components/brave_rewards/common/mojom/rewards.mojom.m.js' +import { ConnectExternalWalletResult, WalletStatus } from 'gen/brave/components/brave_rewards/core/mojom/rewards.mojom.m.js' import { Optional } from '../../shared/lib/optional' import { PublisherStatus } from '../../shared/lib/publisher_status' import { UserType } from '../../shared/lib/user_type' diff --git a/components/brave_rewards/resources/rewards_page/BUILD.gn b/components/brave_rewards/resources/rewards_page/BUILD.gn index e893e66149ac..8a917dc04a6c 100644 --- a/components/brave_rewards/resources/rewards_page/BUILD.gn +++ b/components/brave_rewards/resources/rewards_page/BUILD.gn @@ -13,7 +13,7 @@ transpile_web_ui("rewards_page") { ] ] resource_name = "rewards_page" output_module = true - deps = [ "//brave/components/brave_rewards/common/mojom:webui_js" ] + deps = [ "//brave/components/brave_rewards/core/mojom:webui_js" ] } pack_web_resources("rewards_page_generated") { diff --git a/components/brave_rewards/resources/rewards_page/webui/mojom.ts b/components/brave_rewards/resources/rewards_page/webui/mojom.ts index 4476d6a072e5..d328ad270100 100644 --- a/components/brave_rewards/resources/rewards_page/webui/mojom.ts +++ b/components/brave_rewards/resources/rewards_page/webui/mojom.ts @@ -4,5 +4,5 @@ * You can obtain one at https://mozilla.org/MPL/2.0/. */ export * from 'gen/brave/components/brave_ads/core/mojom/brave_ads.mojom.m.js' -export * from 'gen/brave/components/brave_rewards/common/mojom/rewards.mojom.m.js' -export * from 'gen/brave/components/brave_rewards/common/mojom/rewards_page.mojom.m.js' +export * from 'gen/brave/components/brave_rewards/core/mojom/rewards.mojom.m.js' +export * from 'gen/brave/components/brave_rewards/core/mojom/rewards_page.mojom.m.js' diff --git a/components/brave_rewards/resources/rewards_panel/BUILD.gn b/components/brave_rewards/resources/rewards_panel/BUILD.gn index c59bcce291aa..919c57519746 100644 --- a/components/brave_rewards/resources/rewards_panel/BUILD.gn +++ b/components/brave_rewards/resources/rewards_panel/BUILD.gn @@ -13,8 +13,8 @@ transpile_web_ui("brave_rewards_panel") { ] ] resource_name = "brave_rewards_panel" deps = [ - "//brave/components/brave_rewards/common/mojom:mojom_js", - "//brave/components/brave_rewards/common/mojom:webui_js", + "//brave/components/brave_rewards/core/mojom:mojom_js", + "//brave/components/brave_rewards/core/mojom:webui_js", ] } diff --git a/components/brave_rewards/resources/rewards_panel/lib/extension_host.ts b/components/brave_rewards/resources/rewards_panel/lib/extension_host.ts index 2a4c6ddd51eb..2ae292ce33c7 100644 --- a/components/brave_rewards/resources/rewards_panel/lib/extension_host.ts +++ b/components/brave_rewards/resources/rewards_panel/lib/extension_host.ts @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -import * as mojom from 'gen/brave/components/brave_rewards/common/mojom/rewards_panel.mojom.m.js' +import * as mojom from 'gen/brave/components/brave_rewards/core/mojom/rewards_panel.mojom.m.js' import { Host } from './interfaces' import { OpenLinkAction } from '../../shared/components/notifications' diff --git a/components/brave_rewards/resources/rewards_panel/lib/rewards_panel_proxy.ts b/components/brave_rewards/resources/rewards_panel/lib/rewards_panel_proxy.ts index 62b9fb212525..38204e3027c3 100644 --- a/components/brave_rewards/resources/rewards_panel/lib/rewards_panel_proxy.ts +++ b/components/brave_rewards/resources/rewards_panel/lib/rewards_panel_proxy.ts @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -import * as mojom from 'gen/brave/components/brave_rewards/common/mojom/rewards_panel.mojom.m.js' +import * as mojom from 'gen/brave/components/brave_rewards/core/mojom/rewards_panel.mojom.m.js' let instance: RewardsPanelProxy | null = null diff --git a/components/brave_rewards/resources/shared/lib/mojom.ts b/components/brave_rewards/resources/shared/lib/mojom.ts index c36dadcd42a8..43dcffd9ff2a 100644 --- a/components/brave_rewards/resources/shared/lib/mojom.ts +++ b/components/brave_rewards/resources/shared/lib/mojom.ts @@ -3,4 +3,4 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -export * from 'gen/brave/components/brave_rewards/common/mojom/rewards.mojom.m.js' +export * from 'gen/brave/components/brave_rewards/core/mojom/rewards.mojom.m.js' diff --git a/components/brave_rewards/resources/tip_panel/BUILD.gn b/components/brave_rewards/resources/tip_panel/BUILD.gn index 5a683e9dc78b..4f1079a9e8eb 100644 --- a/components/brave_rewards/resources/tip_panel/BUILD.gn +++ b/components/brave_rewards/resources/tip_panel/BUILD.gn @@ -12,7 +12,7 @@ transpile_web_ui("tip_panel") { rebase_path("tip_panel.tsx"), ] ] resource_name = "tip_panel" - deps = [ "//brave/components/brave_rewards/common/mojom:webui_js" ] + deps = [ "//brave/components/brave_rewards/core/mojom:webui_js" ] } pack_web_resources("tip_panel_generated") { diff --git a/components/brave_rewards/resources/tip_panel/lib/tip_panel_proxy.ts b/components/brave_rewards/resources/tip_panel/lib/tip_panel_proxy.ts index 12ef977928fc..729f8dc202d1 100644 --- a/components/brave_rewards/resources/tip_panel/lib/tip_panel_proxy.ts +++ b/components/brave_rewards/resources/tip_panel/lib/tip_panel_proxy.ts @@ -3,7 +3,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at https://mozilla.org/MPL/2.0/. */ -import * as mojom from 'gen/brave/components/brave_rewards/common/mojom/rewards_tip_panel.mojom.m.js' +import * as mojom from 'gen/brave/components/brave_rewards/core/mojom/rewards_tip_panel.mojom.m.js' let instance: TipPanelProxy | null = null diff --git a/components/brave_rewards/resources/tip_panel/lib/webui_model.ts b/components/brave_rewards/resources/tip_panel/lib/webui_model.ts index 71f17d9417db..bf57a5ea4b00 100644 --- a/components/brave_rewards/resources/tip_panel/lib/webui_model.ts +++ b/components/brave_rewards/resources/tip_panel/lib/webui_model.ts @@ -10,7 +10,7 @@ import { ExternalWalletProvider, externalWalletProviderFromString } from '../../ import { optional } from '../../shared/lib/optional' import { reconnectURL } from '../../shared/lib/rewards_urls' -import { PublisherStatus, WalletStatus } from 'gen/brave/components/brave_rewards/common/mojom/rewards.mojom.m' +import { PublisherStatus, WalletStatus } from 'gen/brave/components/brave_rewards/core/mojom/rewards.mojom.m' export function createModel (): Model { const stateManager = createStateManager(defaultState()) diff --git a/components/brave_rewards/test/BUILD.gn b/components/brave_rewards/test/BUILD.gn deleted file mode 100644 index 6d06bf992c20..000000000000 --- a/components/brave_rewards/test/BUILD.gn +++ /dev/null @@ -1,41 +0,0 @@ -# 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/. */ - -import("//brave/build/config.gni") -import("//build/config/sanitizers/sanitizers.gni") -import("//testing/test.gni") - -source_set("brave_rewards_unit_tests") { - testonly = true - - sources = [ - "//brave/components/brave_rewards/browser/rewards_protocol_navigation_throttle_unittest.cc", - "//brave/components/brave_rewards/browser/rewards_service_impl_jp_unittest.cc", - "//brave/components/brave_rewards/browser/rewards_service_impl_unittest.cc", - "//brave/components/brave_rewards/common/publisher_utils_unittest.cc", - ] - - deps = [ - "//base/test:test_support", - "//brave/browser/brave_rewards", - "//brave/components/brave_rewards/browser:browser", - "//brave/components/brave_rewards/browser:testutil", - "//brave/components/brave_rewards/common:common", - "//brave/components/brave_rewards/common:features", - "//brave/components/brave_rewards/core", - "//brave/components/brave_rewards/core:publishers_proto", - "//brave/components/brave_rewards/resources:static_resources_grit", - "//brave/components/challenge_bypass_ristretto", - "//brave/components/l10n/common:test_support", - "//brave/third_party/rapidjson", - "//chrome/browser:browser", - "//chrome/browser/profiles:profile", - "//chrome/test:test_support", - "//content/test:test_support", - "//net:net", - "//ui/base:base", - "//url:url", - ] -} # source_set("brave_rewards_unit_tests") diff --git a/components/definitions/rewardsExtensions.d.ts b/components/definitions/rewardsExtensions.d.ts index 1467a4947a48..f866d63a3f16 100644 --- a/components/definitions/rewardsExtensions.d.ts +++ b/components/definitions/rewardsExtensions.d.ts @@ -125,7 +125,7 @@ declare namespace RewardsExtension { export type TipDialogEntryPoint = 'one-time' | 'set-monthly' | 'clear-monthly' - type WalletStatus = import('gen/brave/components/brave_rewards/common/mojom/rewards.mojom.m.js').WalletStatus + type WalletStatus = import('gen/brave/components/brave_rewards/core/mojom/rewards.mojom.m.js').WalletStatus export type WalletType = 'uphold' | 'bitflyer' | 'gemini' diff --git a/components/definitions/rewardsInternals.d.ts b/components/definitions/rewardsInternals.d.ts index 1903ee3c9bae..1a2f93d72cb2 100644 --- a/components/definitions/rewardsInternals.d.ts +++ b/components/definitions/rewardsInternals.d.ts @@ -10,7 +10,7 @@ declare namespace RewardsInternals { export interface State { balance: import( - 'gen/brave/components/brave_rewards/common/mojom/rewards.mojom.m.js' + 'gen/brave/components/brave_rewards/core/mojom/rewards.mojom.m.js' ).Balance info: { isKeyInfoSeedValid: boolean @@ -46,7 +46,7 @@ declare namespace RewardsInternals { contributedAmount: number } - type WalletStatus = import('gen/brave/components/brave_rewards/common/mojom/rewards_types.mojom.m.js').WalletStatus + type WalletStatus = import('gen/brave/components/brave_rewards/core/mojom/rewards_types.mojom.m.js').WalletStatus export type WalletType = 'uphold' | 'bitflyer' | 'gemini' @@ -74,5 +74,5 @@ declare namespace RewardsInternals { diagnosticId: string } - type Environment = import('gen/brave/components/brave_rewards/common/mojom/rewards_types.mojom.m.js').Environment + type Environment = import('gen/brave/components/brave_rewards/core/mojom/rewards_types.mojom.m.js').Environment } diff --git a/components/ntp_background_images/browser/BUILD.gn b/components/ntp_background_images/browser/BUILD.gn index cbe8fefd4765..c78410634858 100644 --- a/components/ntp_background_images/browser/BUILD.gn +++ b/components/ntp_background_images/browser/BUILD.gn @@ -45,7 +45,7 @@ static_library("browser") { "//base", "//brave/components/brave_ads/core", "//brave/components/brave_component_updater/browser", - "//brave/components/brave_rewards/common", + "//brave/components/brave_rewards/core", "//brave/components/l10n/common", "//brave/components/ntp_background_images/buildflags", "//brave/components/ntp_background_images/common", diff --git a/components/ntp_background_images/browser/view_counter_service.cc b/components/ntp_background_images/browser/view_counter_service.cc index 8fa944126da8..f64d6aa7512f 100644 --- a/components/ntp_background_images/browser/view_counter_service.cc +++ b/components/ntp_background_images/browser/view_counter_service.cc @@ -19,7 +19,7 @@ #include "brave/components/brave_ads/core/browser/service/ads_service.h" #include "brave/components/brave_ads/core/mojom/brave_ads.mojom-shared.h" #include "brave/components/brave_ads/core/public/prefs/pref_provider.h" -#include "brave/components/brave_rewards/common/pref_names.h" +#include "brave/components/brave_rewards/core/pref_names.h" #include "brave/components/ntp_background_images/browser/brave_ntp_custom_background_service.h" #include "brave/components/ntp_background_images/browser/ntp_background_images_data.h" #include "brave/components/ntp_background_images/browser/ntp_p3a_helper.h" diff --git a/components/ntp_background_images/browser/view_counter_service_unittest.cc b/components/ntp_background_images/browser/view_counter_service_unittest.cc index 0f767157c16f..c97d8b86108d 100644 --- a/components/ntp_background_images/browser/view_counter_service_unittest.cc +++ b/components/ntp_background_images/browser/view_counter_service_unittest.cc @@ -18,8 +18,8 @@ #include "brave/components/brave_ads/core/public/ad_units/new_tab_page_ad/new_tab_page_ad_info.h" #include "brave/components/brave_referrals/browser/brave_referrals_service.h" #include "brave/components/brave_referrals/common/pref_names.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/constants/pref_names.h" #include "brave/components/ntp_background_images/browser/features.h" #include "brave/components/ntp_background_images/browser/ntp_background_images_data.h" diff --git a/components/services/bat_rewards/BUILD.gn b/components/services/bat_rewards/BUILD.gn index 4a0c8da80ca8..9e436a793202 100644 --- a/components/services/bat_rewards/BUILD.gn +++ b/components/services/bat_rewards/BUILD.gn @@ -16,7 +16,7 @@ static_library("lib") { public_deps = [ "public/interfaces", - "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core/internal", ] deps = [ "//mojo/public/cpp/system" ] diff --git a/components/services/bat_rewards/public/interfaces/BUILD.gn b/components/services/bat_rewards/public/interfaces/BUILD.gn index 39b7d0916d06..ec58f9679ff5 100644 --- a/components/services/bat_rewards/public/interfaces/BUILD.gn +++ b/components/services/bat_rewards/public/interfaces/BUILD.gn @@ -10,5 +10,5 @@ mojom("interfaces") { public_deps = [ "//mojo/public/mojom/base" ] - deps = [ "//brave/components/brave_rewards/common/mojom:engine" ] + deps = [ "//brave/components/brave_rewards/core/mojom:engine" ] } diff --git a/components/services/bat_rewards/public/interfaces/rewards_engine_factory.mojom b/components/services/bat_rewards/public/interfaces/rewards_engine_factory.mojom index aaa9af3dada6..00c68d2b3f81 100644 --- a/components/services/bat_rewards/public/interfaces/rewards_engine_factory.mojom +++ b/components/services/bat_rewards/public/interfaces/rewards_engine_factory.mojom @@ -4,8 +4,8 @@ // You can obtain one at https://mozilla.org/MPL/2.0/. module brave_rewards.mojom; -import "brave/components/brave_rewards/common/mojom/rewards.mojom"; -import "brave/components/brave_rewards/common/mojom/rewards_engine.mojom"; +import "brave/components/brave_rewards/core/mojom/rewards.mojom"; +import "brave/components/brave_rewards/core/mojom/rewards_engine.mojom"; interface RewardsEngineFactory { CreateRewardsEngine( diff --git a/components/services/bat_rewards/rewards_engine_factory.cc b/components/services/bat_rewards/rewards_engine_factory.cc index cf8faf9530a0..bc2512081814 100644 --- a/components/services/bat_rewards/rewards_engine_factory.cc +++ b/components/services/bat_rewards/rewards_engine_factory.cc @@ -8,7 +8,7 @@ #include #include -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" namespace brave_rewards::internal { diff --git a/ios/browser/api/ads/BUILD.gn b/ios/browser/api/ads/BUILD.gn index d0a6d9d70da8..96c767a96ffc 100644 --- a/ios/browser/api/ads/BUILD.gn +++ b/ios/browser/api/ads/BUILD.gn @@ -32,7 +32,7 @@ source_set("ads") { "//base", "//brave/components/brave_ads/core", "//brave/components/brave_news/common", - "//brave/components/brave_rewards/common", + "//brave/components/brave_rewards/core", "//brave/components/l10n/common", "//brave/components/ntp_background_images/common", "//brave/ios/browser/api/common", diff --git a/ios/browser/api/ads/DEPS b/ios/browser/api/ads/DEPS index 80f22ba3c1da..3911cf4d1151 100644 --- a/ios/browser/api/ads/DEPS +++ b/ios/browser/api/ads/DEPS @@ -2,7 +2,7 @@ include_rules = [ "+brave/components/brave_ads/core/mojom", "+brave/components/brave_ads/core/public", "+brave/components/brave_news/common", - "+brave/components/brave_rewards/common", + "+brave/components/brave_rewards/core", "+brave/components/l10n/common", "+brave/components/ntp_background_images/common", ] diff --git a/ios/browser/api/ads/brave_ads.mm b/ios/browser/api/ads/brave_ads.mm index 8e7edb5d86ec..357fbaa1db2a 100644 --- a/ios/browser/api/ads/brave_ads.mm +++ b/ios/browser/api/ads/brave_ads.mm @@ -40,9 +40,9 @@ #include "brave/components/brave_ads/core/public/flags/flags_util.h" #include "brave/components/brave_ads/core/public/prefs/pref_names.h" #include "brave/components/brave_news/common/pref_names.h" -#include "brave/components/brave_rewards/common/pref_names.h" -#include "brave/components/brave_rewards/common/pref_registry.h" -#include "brave/components/brave_rewards/common/rewards_flags.h" +#include "brave/components/brave_rewards/core/pref_names.h" +#include "brave/components/brave_rewards/core/pref_registry.h" +#include "brave/components/brave_rewards/core/rewards_flags.h" #include "brave/components/l10n/common/country_code_util.h" #include "brave/components/l10n/common/locale_util.h" #include "brave/components/l10n/common/prefs.h" diff --git a/ios/browser/api/brave_rewards/BUILD.gn b/ios/browser/api/brave_rewards/BUILD.gn index f4669161f275..18b03fb6e4f2 100644 --- a/ios/browser/api/brave_rewards/BUILD.gn +++ b/ios/browser/api/brave_rewards/BUILD.gn @@ -30,8 +30,8 @@ source_set("brave_rewards") { deps = [ ":rewards_mojom_wrappers", "//base", - "//brave/components/brave_rewards/common", "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core/internal", "//brave/ios/browser/api/common", "//components/os_crypt/sync", "//net:net", @@ -46,6 +46,6 @@ source_set("brave_rewards") { } ios_objc_mojom_wrappers("rewards_mojom_wrappers") { - mojom_target = "//brave/components/brave_rewards/common/mojom:mojom" - sources = [ "//brave/components/brave_rewards/common/mojom/rewards.mojom" ] + mojom_target = "//brave/components/brave_rewards/core/mojom:mojom" + sources = [ "//brave/components/brave_rewards/core/mojom/rewards.mojom" ] } diff --git a/ios/browser/api/brave_rewards/DEPS b/ios/browser/api/brave_rewards/DEPS index bf686d946f60..fa5e4adf6f49 100644 --- a/ios/browser/api/brave_rewards/DEPS +++ b/ios/browser/api/brave_rewards/DEPS @@ -1,5 +1,5 @@ include_rules = [ - "+brave/components/brave_rewards/common", "+brave/components/brave_rewards/core", + "+brave/components/brave_rewards/core/internal", "!components/os_crypt/sync", ] diff --git a/ios/browser/api/brave_rewards/brave_rewards_api.mm b/ios/browser/api/brave_rewards/brave_rewards_api.mm index e33ec1639816..c670d323c8e3 100644 --- a/ios/browser/api/brave_rewards/brave_rewards_api.mm +++ b/ios/browser/api/brave_rewards/brave_rewards_api.mm @@ -23,10 +23,10 @@ #include "base/types/cxx23_to_underlying.h" #include "base/values.h" #include "brave/build/ios/mojom/cpp_transformations.h" -#include "brave/components/brave_rewards/common/rewards_flags.h" -#include "brave/components/brave_rewards/core/global_constants.h" -#include "brave/components/brave_rewards/core/rewards_database.h" -#include "brave/components/brave_rewards/core/rewards_engine.h" +#include "brave/components/brave_rewards/core/internal/global_constants.h" +#include "brave/components/brave_rewards/core/internal/rewards_database.h" +#include "brave/components/brave_rewards/core/internal/rewards_engine.h" +#include "brave/components/brave_rewards/core/rewards_flags.h" #import "brave/ios/browser/api/brave_rewards/rewards.mojom.objc+private.h" #import "brave/ios/browser/api/brave_rewards/rewards_client_bridge.h" #import "brave/ios/browser/api/brave_rewards/rewards_client_ios.h" diff --git a/ios/browser/api/brave_rewards/rewards_client_bridge.h b/ios/browser/api/brave_rewards/rewards_client_bridge.h index 468a6c15f672..f6acb57c8aff 100644 --- a/ios/browser/api/brave_rewards/rewards_client_bridge.h +++ b/ios/browser/api/brave_rewards/rewards_client_bridge.h @@ -7,9 +7,11 @@ #define BRAVE_IOS_BROWSER_API_BRAVE_REWARDS_REWARDS_CLIENT_BRIDGE_H_ #import + #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_engine.mojom.h" + +#include "brave/components/brave_rewards/core/mojom/rewards_engine.mojom.h" NS_ASSUME_NONNULL_BEGIN diff --git a/ios/browser/api/brave_rewards/rewards_client_ios.h b/ios/browser/api/brave_rewards/rewards_client_ios.h index 9a79cca1f8ed..e9987f904e6d 100644 --- a/ios/browser/api/brave_rewards/rewards_client_ios.h +++ b/ios/browser/api/brave_rewards/rewards_client_ios.h @@ -7,11 +7,11 @@ #define BRAVE_IOS_BROWSER_API_BRAVE_REWARDS_REWARDS_CLIENT_IOS_H_ #import + #include #include -#include "brave/components/brave_rewards/common/mojom/rewards_engine.mojom.h" - +#include "brave/components/brave_rewards/core/mojom/rewards_engine.mojom.h" #include "mojo/public/cpp/bindings/associated_receiver.h" #include "mojo/public/cpp/bindings/associated_remote.h" diff --git a/ios/browser/api/brave_rewards/rewards_client_ios.mm b/ios/browser/api/brave_rewards/rewards_client_ios.mm index 015248712e88..8cd50165505a 100644 --- a/ios/browser/api/brave_rewards/rewards_client_ios.mm +++ b/ios/browser/api/brave_rewards/rewards_client_ios.mm @@ -5,8 +5,8 @@ #import "rewards_client_ios.h" -#include "brave/components/brave_rewards/common/mojom/rewards.mojom.h" -#include "brave/components/brave_rewards/common/mojom/rewards_database.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards.mojom.h" +#include "brave/components/brave_rewards/core/mojom/rewards_database.mojom.h" #import "rewards_client_bridge.h" #if !defined(__has_feature) || !__has_feature(objc_arc) diff --git a/ios/browser/api/features/BUILD.gn b/ios/browser/api/features/BUILD.gn index 3f4cff0802d3..0bf7eff8151d 100644 --- a/ios/browser/api/features/BUILD.gn +++ b/ios/browser/api/features/BUILD.gn @@ -14,7 +14,7 @@ source_set("features") { "//brave/components/ai_chat/core/common:common", "//brave/components/brave_component_updater/browser:browser", "//brave/components/brave_news/common:common", - "//brave/components/brave_rewards/common:features", + "//brave/components/brave_rewards/core:features", "//brave/components/brave_search/common", "//brave/components/brave_search_conversion:brave_search_conversion", "//brave/components/brave_shields/core/common:common", diff --git a/ios/browser/api/features/DEPS b/ios/browser/api/features/DEPS index e509aee556ba..c4199ac388f5 100644 --- a/ios/browser/api/features/DEPS +++ b/ios/browser/api/features/DEPS @@ -2,7 +2,7 @@ include_rules = [ "+brave/components/ai_chat/core/common/features.h", "+brave/components/brave_component_updater/browser/features.h", "+brave/components/brave_news/common/features.h", - "+brave/components/brave_rewards/common/features.h", + "+brave/components/brave_rewards/core/features.h", "+brave/components/brave_search/common/features.h", "+brave/components/brave_search_conversion/features.h", "+brave/components/brave_shields/core/common/features.h", diff --git a/ios/browser/api/features/features.mm b/ios/browser/api/features/features.mm index 5a1256270f9c..2a62f2bbd1fc 100644 --- a/ios/browser/api/features/features.mm +++ b/ios/browser/api/features/features.mm @@ -10,7 +10,7 @@ #include "brave/components/ai_chat/core/common/features.h" #include "brave/components/brave_component_updater/browser/features.h" #include "brave/components/brave_news/common/features.h" -#include "brave/components/brave_rewards/common/features.h" +#include "brave/components/brave_rewards/core/features.h" #include "brave/components/brave_search/common/features.h" #include "brave/components/brave_search_conversion/features.h" #include "brave/components/brave_shields/core/common/features.h" diff --git a/ios/browser/flags/DEPS b/ios/browser/flags/DEPS index cf9388d89769..7626138be83a 100644 --- a/ios/browser/flags/DEPS +++ b/ios/browser/flags/DEPS @@ -2,7 +2,7 @@ include_rules = [ "+brave/components/ai_chat/core/common/features.h", "+brave/components/brave_ads/core/public/ads_feature.h", "+brave/components/brave_component_updater/browser/features.h", - "+brave/components/brave_rewards/common/features.h", + "+brave/components/brave_rewards/core/features.h", "+brave/components/brave_shields/core/common/features.h", "+brave/components/brave_wallet/common/features.h", "+brave/components/de_amp/common/features.h", diff --git a/ios/browser/flags/about_flags.mm b/ios/browser/flags/about_flags.mm index 25fcd8763068..71fb0ebb3369 100644 --- a/ios/browser/flags/about_flags.mm +++ b/ios/browser/flags/about_flags.mm @@ -9,7 +9,7 @@ #include "brave/components/ai_chat/core/common/features.h" #include "brave/components/brave_ads/core/public/ads_feature.h" #include "brave/components/brave_component_updater/browser/features.h" -#include "brave/components/brave_rewards/common/features.h" +#include "brave/components/brave_rewards/core/features.h" #include "brave/components/brave_shields/core/common/features.h" #include "brave/components/brave_wallet/common/features.h" #include "brave/components/de_amp/common/features.h" diff --git a/ios/browser/flags/sources.gni b/ios/browser/flags/sources.gni index b343e7dfa2cc..800bf90eb08a 100644 --- a/ios/browser/flags/sources.gni +++ b/ios/browser/flags/sources.gni @@ -7,8 +7,8 @@ brave_flags_deps = [ "//base", "//brave/components/brave_ads/core", "//brave/components/brave_component_updater/browser", - "//brave/components/brave_rewards/common", - "//brave/components/brave_rewards/common/buildflags", + "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core/buildflags", "//brave/components/brave_shields/core/common", "//brave/components/brave_wallet/common", "//brave/components/de_amp/common", diff --git a/test/BUILD.gn b/test/BUILD.gn index c5dc2f598c9e..eca5a3fd8b2a 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -198,10 +198,11 @@ test("brave_unit_tests") { "//brave/components/brave_perf_predictor/browser", "//brave/components/brave_private_cdn", "//brave/components/brave_referrals/browser:unit_tests", - "//brave/components/brave_rewards/common", - "//brave/components/brave_rewards/common:features", - "//brave/components/brave_rewards/core/test", - "//brave/components/brave_rewards/test:brave_rewards_unit_tests", + "//brave/components/brave_rewards/content:unit_tests", + "//brave/components/brave_rewards/core", + "//brave/components/brave_rewards/core:features", + "//brave/components/brave_rewards/core:unit_tests", + "//brave/components/brave_rewards/core/internal/test", "//brave/components/brave_search/browser", "//brave/components/brave_search/common", "//brave/components/brave_search_conversion", @@ -323,7 +324,7 @@ test("brave_unit_tests") { # TODO(keur): Reminder to move this out when we migrate # stats browser tests into unit tests. "//brave/components/brave_referrals/browser", - "//brave/components/brave_rewards/browser", + "//brave/components/brave_rewards/content", "//brave/components/brave_stats/browser", ] @@ -683,7 +684,7 @@ if (!is_android) { "//brave/base/test:test_vendor_is_brave", "//brave/browser/brave_rewards", "//brave/components/brave_ads/core/public:headers", - "//brave/components/brave_rewards/browser", + "//brave/components/brave_rewards/content", "//chrome:packed_resources", "//chrome:resources", "//chrome:strings", @@ -792,25 +793,6 @@ test("brave_browser_tests") { "//brave/chromium_src/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_browsertest.cc", "//brave/common/brave_channel_info_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_autoplay_browsertest.cc", "//brave/components/content_settings/renderer/brave_content_settings_agent_impl_browsertest.cc", "//brave/components/webcompat/content/test/webcompat_exceptions_browsertest.cc", @@ -880,13 +862,7 @@ test("brave_browser_tests") { "//brave/components/brave_perf_predictor/browser", "//brave/components/brave_perf_predictor/common", "//brave/components/brave_referrals/browser", - "//brave/components/brave_rewards/browser", - "//brave/components/brave_rewards/common", - "//brave/components/brave_rewards/common:features", - "//brave/components/brave_rewards/common/buildflags:buildflags", - "//brave/components/brave_rewards/common/mojom:core", - "//brave/components/brave_rewards/core", - "//brave/components/brave_rewards/core:publishers_proto", + "//brave/components/brave_rewards/content", "//brave/components/brave_search/browser", "//brave/components/brave_search/common", "//brave/components/brave_shields/content/browser",