@@ -313,29 +313,20 @@ ExtensionFunction::ResponseAction BraveRewardsTipUserFunction::Run() {
313
313
->AddRewardsExtension ();
314
314
315
315
rewards_service->StartProcess (
316
- base::BindOnce (
317
- &BraveRewardsTipUserFunction::OnTipUserStartProcess,
318
- this ,
319
- params->publisher_key ));
316
+ base::BindOnce (&BraveRewardsTipUserFunction::OnProcessStarted, this ,
317
+ params->publisher_key ));
320
318
321
319
return RespondNow (NoArguments ());
322
320
}
323
321
324
- void BraveRewardsTipUserFunction::OnTipUserStartProcess (
325
- const std::string& publisher_key,
326
- ledger::type::Result result) {
327
- if (result != ledger::type::Result::LEDGER_OK) {
328
- Release ();
329
- return ;
330
- }
331
-
322
+ void BraveRewardsTipUserFunction::OnProcessStarted (
323
+ const std::string& publisher_key) {
332
324
Profile* profile = Profile::FromBrowserContext (browser_context ());
333
325
auto * rewards_service = RewardsServiceFactory::GetForProfile (profile);
334
326
if (!rewards_service) {
335
327
Release ();
336
328
return ;
337
329
}
338
-
339
330
rewards_service->GetPublisherInfo (
340
331
publisher_key,
341
332
base::Bind (&BraveRewardsTipUserFunction::OnTipUserGetPublisherInfo,
@@ -677,15 +668,15 @@ ExtensionFunction::ResponseAction BraveRewardsSaveAdsSettingFunction::Run() {
677
668
Profile* profile = Profile::FromBrowserContext (browser_context ());
678
669
RewardsService* rewards_service =
679
670
RewardsServiceFactory::GetForProfile (profile);
680
- AdsService* ads_service_ = AdsServiceFactory::GetForProfile (profile);
671
+ AdsService* ads_service = AdsServiceFactory::GetForProfile (profile);
681
672
682
- if (!rewards_service || !ads_service_ ) {
673
+ if (!rewards_service || !ads_service ) {
683
674
return RespondNow (Error (" Service is not initialized" ));
684
675
}
685
676
686
677
if (params->key == " adsEnabled" ) {
687
678
const auto is_enabled =
688
- params->value == " true" && ads_service_ ->IsSupportedLocale ();
679
+ params->value == " true" && ads_service ->IsSupportedLocale ();
689
680
rewards_service->SetAdsEnabled (is_enabled);
690
681
}
691
682
@@ -1105,14 +1096,14 @@ BraveRewardsGetAdsEnabledFunction::
1105
1096
ExtensionFunction::ResponseAction
1106
1097
BraveRewardsGetAdsEnabledFunction::Run () {
1107
1098
Profile* profile = Profile::FromBrowserContext (browser_context ());
1108
- AdsService* ads_service_ =
1099
+ AdsService* ads_service =
1109
1100
AdsServiceFactory::GetForProfile (profile);
1110
1101
1111
- if (!ads_service_ ) {
1102
+ if (!ads_service ) {
1112
1103
return RespondNow (Error (" Ads service is not initialized" ));
1113
1104
}
1114
1105
1115
- const bool enabled = ads_service_ ->IsEnabled ();
1106
+ const bool enabled = ads_service ->IsEnabled ();
1116
1107
return RespondNow (OneArgument (base::Value (enabled)));
1117
1108
}
1118
1109
@@ -1122,16 +1113,16 @@ BraveRewardsGetAdsAccountStatementFunction::
1122
1113
ExtensionFunction::ResponseAction
1123
1114
BraveRewardsGetAdsAccountStatementFunction::Run () {
1124
1115
Profile* profile = Profile::FromBrowserContext (browser_context ());
1125
- AdsService* ads_service_ =
1116
+ AdsService* ads_service =
1126
1117
AdsServiceFactory::GetForProfile (profile);
1127
1118
1128
- if (!ads_service_ ) {
1119
+ if (!ads_service ) {
1129
1120
return RespondNow (Error (" Ads service is not initialized" ));
1130
1121
}
1131
1122
1132
1123
AddRef (); // Balanced in OnGetAdsAccountStatement().
1133
1124
1134
- ads_service_ ->GetAccountStatement (base::BindOnce (
1125
+ ads_service ->GetAccountStatement (base::BindOnce (
1135
1126
&BraveRewardsGetAdsAccountStatementFunction::OnGetAdsAccountStatement,
1136
1127
this ));
1137
1128
return RespondLater ();
@@ -1170,14 +1161,14 @@ BraveRewardsGetAdsSupportedFunction::
1170
1161
ExtensionFunction::ResponseAction
1171
1162
BraveRewardsGetAdsSupportedFunction::Run () {
1172
1163
Profile* profile = Profile::FromBrowserContext (browser_context ());
1173
- AdsService* ads_service_ =
1164
+ AdsService* ads_service =
1174
1165
AdsServiceFactory::GetForProfile (profile);
1175
1166
1176
- if (!ads_service_ ) {
1167
+ if (!ads_service ) {
1177
1168
return RespondNow (Error (" Ads service is not initialized" ));
1178
1169
}
1179
1170
1180
- const bool supported = ads_service_ ->IsSupportedLocale ();
1171
+ const bool supported = ads_service ->IsSupportedLocale ();
1181
1172
return RespondNow (OneArgument (base::Value (supported)));
1182
1173
}
1183
1174
0 commit comments