Skip to content

Commit

Permalink
Review feedback (part 3):
Browse files Browse the repository at this point in the history
- Update browser import name from "Brave" to "Brave (old)"
- Updated import type name from "Ledger" to "Brave Payments"
- Removed debug log statement
- Removed explicit call to `SetUserChangedContribution` (call instead made inside RewardsServiceImpl)
  • Loading branch information
bsclifton committed Nov 28, 2018
1 parent 615be78 commit 5aff1eb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/brave_generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
Stats
</message>
<message name="IDS_SETTINGS_IMPORT_LEDGER_CHECKBOX" desc="Checkbox for importing ledger">
Ledger
Brave Payments
</message>
<message name="IDS_WIDEVINE_NOT_INSTALLED_EXPLANATORY_TEXT" desc="Explanatory animated text that appears (and then disappears) in the address line when Widevine is blocked">
Widevine is not installed
Expand All @@ -173,7 +173,7 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U
</message>
<!-- Brave Importer -->
<message name="IDS_IMPORT_FROM_BRAVE" desc="browser combo box: Brave">
Brave
Brave (old)
</message>
<message name="IDS_BOOKMARK_GROUP_FROM_BRAVE" desc="The group name of bookmarks from Brave">
Imported From Brave
Expand Down
7 changes: 3 additions & 4 deletions browser/importer/brave_profile_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ void BraveProfileWriter::SetWalletProperties(brave_rewards::RewardsService*
pinned_item_count_++;
sum_of_monthly_tips += amount_in_bat;

// Add `recurring` donation entry
// Add `recurring_donation` entry
rewards_service->OnDonate(publisher.key, amount_in_bat, true);

// Add publisher to `publisher_info`
// TODO: finish me
// TODO: finish me in https://github.com/brave/brave-core/pull/926
// ledger::PublisherInfo publisher_info;
// publisher_info.id = publisher.key;
// publisher_info.verified = publisher.verified;
Expand All @@ -224,7 +224,7 @@ void BraveProfileWriter::SetWalletProperties(brave_rewards::RewardsService*
// publisher_info.url = publisher.url;
// publisher_info.provider = publisher.provider;
// publisher_info.favicon_url = "";
// publisher_info.month = ledger::PUBLISHER_MONTH::ANY;
// publisher_info.month = -1; // ledger::PUBLISHER_MONTH::ANY;
// rewards_service->SavePublisherInfo(publisher_info);
}
}
Expand All @@ -248,7 +248,6 @@ void BraveProfileWriter::SetWalletProperties(brave_rewards::RewardsService*
new_contribution_amount_ = minimum_monthly_contribution;
}
}
rewards_service->SetUserChangedContribution();
rewards_service->SetContributionAmount(new_contribution_amount_);
rewards_service->SetAutoContribute(auto_contribute_enabled);
}
Expand Down
1 change: 0 additions & 1 deletion components/brave_rewards/browser/rewards_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ void RewardsService::AddObserver(RewardsServiceObserver* observer) {
}

void RewardsService::RemoveObserver(RewardsServiceObserver* observer) {
LOG(INFO) << "RewardsService::RemoveObserver: " << observer;
observers_.RemoveObserver(observer);
}

Expand Down
4 changes: 4 additions & 0 deletions components/brave_rewards/browser/rewards_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1073,9 +1073,13 @@ void RewardsServiceImpl::SetPublisherAllowVideos(bool allow) const {
}

void RewardsServiceImpl::SetContributionAmount(double amount) const {
ledger_->SetUserChangedContribution();
ledger_->SetContributionAmount(amount);
}

// TODO: remove me (and pure virtual definition)
// see https://github.com/brave/brave-core/commit/c4ef62c954a64fca18ae83ff8ffd611137323420#diff-aa3505dbf36b5d03d8ba0751e0c99904R385
// and https://github.com/brave-intl/bat-native-ledger/commit/27f3ceb471d61c84052737ff201fe18cb9a6af32#diff-e303122e010480b2226895b9470891a3R135
void RewardsServiceImpl::SetUserChangedContribution() const {
ledger_->SetUserChangedContribution();
}
Expand Down

0 comments on commit 5aff1eb

Please sign in to comment.